Add migration program; Add RequestAction DU

This commit is contained in:
Daniel J. Summers
2019-07-28 20:47:11 -05:00
parent 221d95a2e2
commit a2ef84bc1e
4 changed files with 139 additions and 6 deletions

View File

@@ -175,7 +175,7 @@ module Request =
history = [
{ History.empty with
asOf = now
status = "Created"
status = Created
text = Some r.requestText
}
]
@@ -197,14 +197,15 @@ module Request =
| Some req ->
let! hist = ctx.BindJsonAsync<Models.HistoryEntry> ()
let now = jsNow ()
let act = RequestAction.fromString hist.status
{ History.empty with
asOf = now
status = hist.status
status = act
text = match hist.updateText with null | "" -> None | x -> Some x
}
|> sess.AddHistory reqId
match hist.status with
| "Prayed" ->
match act with
| Prayed ->
(Ticks.toLong now) + (Recurrence.duration req.recurType * int64 req.recurCount)
|> (Ticks >> sess.UpdateShowAfter reqId)
| _ -> ()