-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
67 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace global | ||
|
||
module Guid = | ||
let gen () = System.Guid.NewGuid() | ||
let parse: string -> System.Guid = System.Guid.Parse | ||
let toStringN (x: System.Guid): string = x.ToString "N" | ||
|
||
type DateTimeOffset = System.DateTimeOffset | ||
type HashSet<'t> = System.Collections.Generic.HashSet<'t> | ||
|
||
/// Handles symmetric generation and decoding of StreamNames composed of a series of elements via the FsCodec.StreamId helpers | ||
type internal CategoryId<'elements>(name, gen: 'elements -> FsCodec.StreamId, dec: FsCodec.StreamId -> 'elements) = | ||
member _.StreamName = gen >> FsCodec.StreamName.create name | ||
member _.TryDecode = FsCodec.StreamName.tryFind name >> ValueOption.map dec | ||
|
||
[<AutoOpen>] | ||
module DeciderExtensions = | ||
|
||
type Equinox.Decider<'E, 'S> with | ||
|
||
member x.TransactWithPostVersion(decide: 'S -> Async<'R * 'E[]>): Async<'R * int64> = | ||
x.TransactEx((fun c -> decide c.State), | ||
(fun r (c: Equinox.ISyncContext<'S>) -> (r, c.Version))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,20 @@ | ||
namespace Domain | ||
|
||
open FSharp.UMX | ||
open System | ||
|
||
module Guid = | ||
let toString (x: Guid): string = x.ToString "N" | ||
|
||
type GroupCheckoutId = Guid<groupCheckoutId> | ||
and [<Measure>] groupCheckoutId | ||
module GroupCheckoutId = | ||
let toString: GroupCheckoutId -> string = UMX.untag >> Guid.toString | ||
let parse: string -> GroupCheckoutId = Guid.Parse >> UMX.tag | ||
let toString: GroupCheckoutId -> string = UMX.untag >> Guid.toStringN | ||
let parse: string -> GroupCheckoutId = Guid.parse >> UMX.tag | ||
|
||
type GuestStayId = Guid<guestStayId> | ||
and [<Measure>] guestStayId | ||
module GuestStayId = | ||
let toString: GuestStayId -> string = UMX.untag >> Guid.toString | ||
let toString: GuestStayId -> string = UMX.untag >> Guid.toStringN | ||
|
||
type ChargeId = Guid<chargeId> | ||
and [<Measure>] chargeId | ||
|
||
type PaymentId = Guid<paymentId> | ||
and [<Measure>] paymentId | ||
|
||
type DateTimeOffset = System.DateTimeOffset | ||
type HashSet<'t> = System.Collections.Generic.HashSet<'t> | ||
|
||
/// Handles symmetric generation and decoding of StreamNames composed of a series of elements via the FsCodec.StreamId helpers | ||
type internal CategoryId<'elements>(name, gen: 'elements -> FsCodec.StreamId, dec: FsCodec.StreamId -> 'elements) = | ||
member _.StreamName = gen >> FsCodec.StreamName.create name | ||
member _.TryDecode = FsCodec.StreamName.tryFind name >> ValueOption.map dec | ||
|
||
[<AutoOpen>] | ||
module DeciderExtensions = | ||
|
||
type Equinox.Decider<'E, 'S> with | ||
|
||
member x.TransactWithPostVersion(decide: 'S -> Async<'R * 'E[]>): Async<'R * int64> = | ||
x.TransactEx((fun c -> decide c.State), | ||
(fun r (c: Equinox.ISyncContext<'S>) -> (r, c.Version))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters