summaryrefslogtreecommitdiff
path: root/src/FundLab.Api
diff options
context:
space:
mode:
Diffstat (limited to 'src/FundLab.Api')
-rw-r--r--src/FundLab.Api/App.fs2
-rw-r--r--src/FundLab.Api/Persistence.fs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/FundLab.Api/App.fs b/src/FundLab.Api/App.fs
index b5b2064..38debc3 100644
--- a/src/FundLab.Api/App.fs
+++ b/src/FundLab.Api/App.fs
@@ -156,6 +156,7 @@ type DividendResponse =
navDate: string
dps: string
mode: string
+ sourceKey: string
status: string
grossCash: string option
creditedUnits: string option
@@ -613,6 +614,7 @@ module App =
navDate = dateText record.NavDate
dps = decimalText record.Dps
mode = DividendPolicy.modeText record.Mode
+ sourceKey = DividendPolicy.schemeKey record.FundId record.InstrumentCode record.NavDate record.Mode
status = record.Status
grossCash = record.GrossCash |> Option.map cashText
creditedUnits = record.CreditedUnits |> Option.map decimalText
diff --git a/src/FundLab.Api/Persistence.fs b/src/FundLab.Api/Persistence.fs
index e252d0a..973544f 100644
--- a/src/FundLab.Api/Persistence.fs
+++ b/src/FundLab.Api/Persistence.fs
@@ -1922,7 +1922,7 @@ type FundRepository(connectionString: string) =
Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(payload)))
let dividendSchemeKey (fundId: Guid) (command: DividendCommand) =
- sprintf "dividend-scheme:%O:%s:%s:%s" fundId command.InstrumentCode (command.NavDate.ToString("yyyy-MM-dd")) (DividendPolicy.modeText command.Mode)
+ DividendPolicy.schemeKey fundId command.InstrumentCode command.NavDate command.Mode
let validateDividendCommand (today: DateOnly) (command: DividendCommand) =
if String.IsNullOrWhiteSpace command.InstrumentCode then