Skip to content

Commit

Permalink
Update to FsCodec 2.0.0-rc3
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 14, 2020
1 parent 3c0eb80 commit ad83728
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions equinox-fc/Domain/Allocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module Allocation
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
module Events =

let [<Literal>] CategoryId = "Allocation"
let (|For|) id = FsCodec.StreamName.create CategoryId (AllocationId.toString id)

type Commenced = { ticketIds : TicketId[] }
type Tickets = { ticketIds : TicketId[] }
type Allocated = { ticketIds : TicketId[]; listId : TicketListId }
Expand Down Expand Up @@ -31,8 +34,6 @@ module Events =
| Snapshotted
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] categoryId = "Allocation"
let (|For|) id = Equinox.AggregateId(categoryId, AllocationId.toString id)

module Fold =

Expand Down
5 changes: 3 additions & 2 deletions equinox-fc/Domain/Allocator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ open System
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
module Events =

let [<Literal>] CategoryId = "Allocator"
let (|For|) id = FsCodec.StreamName.create CategoryId (AllocatorId.toString id)

type Commenced = { allocationId : AllocationId; cutoff : DateTimeOffset }
type Completed = { allocationId : AllocationId; reason : Reason }
and [<Newtonsoft.Json.JsonConverter(typeof<FsCodec.NewtonsoftJson.TypeSafeEnumConverter>)>]
Expand All @@ -15,8 +18,6 @@ module Events =
| Completed of Completed
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] category = "Allocator"
let (|For|) id = Equinox.AggregateId(category, AllocatorId.toString id)

module Fold =

Expand Down
5 changes: 3 additions & 2 deletions equinox-fc/Domain/Ticket.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module Ticket
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
module Events =

let [<Literal>] CategoryId = "Ticket"
let (|For|) id = FsCodec.StreamName.create CategoryId (TicketId.toString id)

type Reserved = { allocatorId : AllocatorId }
type Allocated = { allocatorId : AllocatorId; listId : TicketListId }

Expand All @@ -12,8 +15,6 @@ module Events =
| Revoked
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] category = "Ticket"
let (|For|) id = Equinox.AggregateId(category, TicketId.toString id)

module Fold =

Expand Down
5 changes: 3 additions & 2 deletions equinox-fc/Domain/TicketList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module TicketList
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
module Events =

let [<Literal>] CategoryId = "TicketList"
let (|For|) id = FsCodec.StreamName.create CategoryId (TicketListId.toString id)

type Allocated = { allocatorId : AllocatorId; ticketIds : TicketId[] }
type Snapshotted = { ticketIds : TicketId[] }
type Event =
| Allocated of Allocated
| Snapshotted of Snapshotted
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] categoryId = "TicketList"
let (|For|) id = Equinox.AggregateId(categoryId, TicketListId.toString id)

module Fold =

Expand Down

0 comments on commit ad83728

Please sign in to comment.