diff --git a/equinox-fc/Domain.Tests/AllocationTests.fs b/equinox-fc/Domain.Tests/AllocationTests.fs index f6c92ff1c..a8f7fd3d4 100644 --- a/equinox-fc/Domain.Tests/AllocationTests.fs +++ b/equinox-fc/Domain.Tests/AllocationTests.fs @@ -5,6 +5,6 @@ open FsCheck.Xunit open Swensen.Unquote let [] ``codec can roundtrip`` event = - let ee = Events.codec.Encode(None,event) + let ee = Events.codec.Encode(None, event) let ie = FsCodec.Core.TimelineEvent.Create(0L, ee.EventType, ee.Data) test <@ Some event = Events.codec.TryDecode ie @> \ No newline at end of file diff --git a/equinox-fc/Domain.Tests/Infrastructure.fs b/equinox-fc/Domain.Tests/Infrastructure.fs index 0711ee67b..1c6c0b920 100644 --- a/equinox-fc/Domain.Tests/Infrastructure.fs +++ b/equinox-fc/Domain.Tests/Infrastructure.fs @@ -26,7 +26,7 @@ module Cosmos = let context = Context(connection, d, c) let cache = Equinox.Cache (appName, 10) context, cache - | s,d,c -> + | s, d, c -> failwithf "Connection, Database and Container EQUINOX_COSMOS_* Environment variables are required (%b,%b,%b)" (Option.isSome s) (Option.isSome d) (Option.isSome c) diff --git a/equinox-fc/Domain.Tests/LocationSeriesTests.fs b/equinox-fc/Domain.Tests/LocationSeriesTests.fs index b972071d0..6c7b33ae7 100644 --- a/equinox-fc/Domain.Tests/LocationSeriesTests.fs +++ b/equinox-fc/Domain.Tests/LocationSeriesTests.fs @@ -39,6 +39,6 @@ let [] properties c1 c2 = test <@ List.isEmpty l @> let [] ``codec can roundtrip`` event = - let ee = Events.codec.Encode(None,event) + let ee = Events.codec.Encode(None, event) let ie = FsCodec.Core.TimelineEvent.Create(0L, ee.EventType, ee.Data) test <@ Some event = Events.codec.TryDecode ie @> diff --git a/equinox-fc/Domain/Allocation.fs b/equinox-fc/Domain/Allocation.fs index 9ce07e7d5..502a06d91 100644 --- a/equinox-fc/Domain/Allocation.fs +++ b/equinox-fc/Domain/Allocation.fs @@ -32,7 +32,7 @@ module Events = interface TypeShape.UnionContract.IUnionContract let codec = FsCodec.NewtonsoftJson.Codec.Create() let [] categoryId = "Allocation" - let (|AggregateId|) id = Equinox.AggregateId(categoryId, AllocationId.toString id) + let (|For|) id = Equinox.AggregateId(categoryId, AllocationId.toString id) module Fold = @@ -216,9 +216,9 @@ let sync (updates : Update seq, command : Command) (state : Fold.State) : (bool* (* Yield outstanding processing requirements (if any), together with events accumulated based on the `updates` *) (accepted, ProcessState.FromFoldState state), acc.Accumulated -type Service internal (log, resolve, ?maxAttempts) = +type Service internal (log, resolve, maxAttempts) = - let resolve (Events.AggregateId id) = Equinox.Stream(log, resolve id, maxAttempts = defaultArg maxAttempts 3) + let resolve (Events.For id) = Equinox.Stream(log, resolve id, maxAttempts) member __.Sync(allocationId, updates, command) : Async = let stream = resolve allocationId diff --git a/equinox-fc/Domain/ListAllocation.fs b/equinox-fc/Domain/ListAllocation.fs index 51662d008..0485d9077 100644 --- a/equinox-fc/Domain/ListAllocation.fs +++ b/equinox-fc/Domain/ListAllocation.fs @@ -8,15 +8,15 @@ type Service(maxListLen, allocators : Allocator.Service, allocations : Allocatio let cutoff = let now = DateTimeOffset.UtcNow in now.Add transactionTimeout let! state = allocators.Commence(allocatorId, allocationId, cutoff) // TODO cancel timed out conflicting work - let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Commence tickets) + let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Commence tickets) return state } member __.Read(allocationId) : Async<_> = async { - let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Apply ([],[])) + let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Apply ([], [])) // TODO incorporate allocator state return state } - member __.Cancel(allocatorId,allocationId) : Async<_> = async { - let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Cancel) + member __.Cancel(allocatorId, allocationId) : Async<_> = async { + let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Cancel) // TODO propagate to allocator with reason return state } diff --git a/equinox-fc/Domain/TicketList.fs b/equinox-fc/Domain/TicketList.fs index a21e8265e..fa5205e6a 100644 --- a/equinox-fc/Domain/TicketList.fs +++ b/equinox-fc/Domain/TicketList.fs @@ -11,7 +11,7 @@ module Events = interface TypeShape.UnionContract.IUnionContract let codec = FsCodec.NewtonsoftJson.Codec.Create() let [] categoryId = "TicketList" - let (|AggregateId|) id = Equinox.AggregateId(categoryId, TicketListId.toString id) + let (|For|) id = Equinox.AggregateId(categoryId, TicketListId.toString id) module Fold = @@ -31,7 +31,7 @@ let interpret (allocatorId : AllocatorId, allocated : TicketId list) (state : Fo type Service internal (log, resolve, maxAttempts) = - let resolve (Events.AggregateId id) = Equinox.Stream(log, resolve id, maxAttempts) + let resolve (Events.For id) = Equinox.Stream(log, resolve id, maxAttempts) member __.Sync(pickListId, allocatorId, assignedTickets) : Async = let stream = resolve pickListId