Skip to content

Commit ad83728

Browse files
committed
Update to FsCodec 2.0.0-rc3
1 parent 3c0eb80 commit ad83728

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

equinox-fc/Domain/Allocation.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module Allocation
33
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
44
module Events =
55

6+
let [<Literal>] CategoryId = "Allocation"
7+
let (|For|) id = FsCodec.StreamName.create CategoryId (AllocationId.toString id)
8+
69
type Commenced = { ticketIds : TicketId[] }
710
type Tickets = { ticketIds : TicketId[] }
811
type Allocated = { ticketIds : TicketId[]; listId : TicketListId }
@@ -31,8 +34,6 @@ module Events =
3134
| Snapshotted
3235
interface TypeShape.UnionContract.IUnionContract
3336
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
34-
let [<Literal>] categoryId = "Allocation"
35-
let (|For|) id = Equinox.AggregateId(categoryId, AllocationId.toString id)
3637

3738
module Fold =
3839

equinox-fc/Domain/Allocator.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ open System
55
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
66
module Events =
77

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

2122
module Fold =
2223

equinox-fc/Domain/Ticket.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module Ticket
33
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
44
module Events =
55

6+
let [<Literal>] CategoryId = "Ticket"
7+
let (|For|) id = FsCodec.StreamName.create CategoryId (TicketId.toString id)
8+
69
type Reserved = { allocatorId : AllocatorId }
710
type Allocated = { allocatorId : AllocatorId; listId : TicketListId }
811

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

1819
module Fold =
1920

equinox-fc/Domain/TicketList.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ module TicketList
33
// NOTE - these types and the union case names reflect the actual storage formats and hence need to be versioned with care
44
module Events =
55

6+
let [<Literal>] CategoryId = "TicketList"
7+
let (|For|) id = FsCodec.StreamName.create CategoryId (TicketListId.toString id)
8+
69
type Allocated = { allocatorId : AllocatorId; ticketIds : TicketId[] }
710
type Snapshotted = { ticketIds : TicketId[] }
811
type Event =
912
| Allocated of Allocated
1013
| Snapshotted of Snapshotted
1114
interface TypeShape.UnionContract.IUnionContract
1215
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
13-
let [<Literal>] categoryId = "TicketList"
14-
let (|For|) id = Equinox.AggregateId(categoryId, TicketListId.toString id)
1516

1617
module Fold =
1718

0 commit comments

Comments
 (0)