Skip to content

Instantly share code, notes, and snippets.

@jonasdw
Last active December 19, 2018 16:43
Show Gist options
  • Save jonasdw/1a67791e54ec6901ff2515fda6ba930d to your computer and use it in GitHub Desktop.
Save jonasdw/1a67791e54ec6901ff2515fda6ba930d to your computer and use it in GitHub Desktop.
module Server
let historiek =
dagHistoriek
|> List.append werknemerHistoriek
|> List.sortBy (fun h -> h.At)
|> List.map (fun h -> { Naam = h.Naam })
return { Historiek = historiek}
module Library
type HistoriekTest = {
Naam : string
}
type HistoriekData = { Historiek : HistoriekTest list }
type IInternalApi = {
popularAlbums : Async<list<Album>>
historiek : string -> Async<HistoriekData>
}
module Server
let historiek =
dagHistoriek
|> List.append werknemerHistoriek
|> List.sortBy (fun h -> h.At)
return { Historiek = [
{ Naam = (List.head historiek).Naam }
{ Naam = "Test2"; }
]}
module SharedModels
open System
type HistoriekTest = {
Naam : string
At : DateTime
By : string
PayloadBeja : Object
}
type HistoriekData = { Historiek : HistoriekTest list }
type IInternalApi = {
historiek : string -> Async<HistoriekData>
}
module Server
let internalApi config : IInternalApi = {
popularAlbums = async {
return [ { Title = "Love Supreme" } ]
}
historiek = fun roosterId -> async {
let fetchHistoriek : FetchHistoriekVanRooster = { RoosterId = new Guid(roosterId) }
let dagHistoriek = Queries.historiekVanRooster (conn config.DatabaseConfiguration) { Claims = []; Payload = fetchHistoriek; CorrelationId = Guid.Empty } DagOutbox
let werknemerHistoriek = Queries.historiekVanRooster (conn config.DatabaseConfiguration) { Claims = []; Payload = fetchHistoriek; CorrelationId = Guid.Empty } WerknemerOutbox
let historiek =
dagHistoriek
|> List.append werknemerHistoriek
|> List.sortBy (fun h -> h.At)
|> List.map (fun h ->
{
Naam = h.Naam
By = h.By
At = h.At
PayloadBeja = h.Payload
}
)
return { Historiek = historiek}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment