spec: unify income payment cards and drop period comparisons (WealthLedger/main#33) (#37)
Specs security / security (push) Successful in 9s
Specs verify / verify (push) Successful in 12s

spec: unify income payment cards and drop period comparisons (WealthLedger/main#33)
This commit was merged in pull request #37.
This commit is contained in:
2026-10-13 18:16:27 +03:00
parent fe295aa73a
commit 6c858a8858
14 changed files with 1014 additions and 0 deletions
@@ -0,0 +1,26 @@
sequenceDiagram
actor User
participant UI as WealthLedger frontend
participant API as WealthLedger backend
participant Store as Saved investment data
participant Broker as T-Bank
User->>UI: Open income page / apply from,to
UI->>API: GET income-analytics(accountId or all, from, to)
API->>Store: Verify session, membership, selected-period coverage and operations
alt Access denied or invalid period
API-->>UI: Problem Details (access/input error)
UI-->>User: Account/period error; preserve last applied data on invalid draft
else Selected period complete
Store-->>API: Confirmed selected operations and source state
API-->>UI: data with selected totals/entries + meta(selected)
UI-->>User: Totals and executed payment cards, no comparisons
else Selected period missing or incomplete
Store-->>API: Incomplete coverage + resource state
API-->>UI: data null + meta(selected)
UI-->>User: Loading or recoverable error, no partial final totals
opt First read of missing historical interval
API->>Broker: Begin bounded acquisition of missing selected interval
Broker-->>Store: Publish only confirmed complete result
end
end
Note over API,Store: No previous/year-ago interval is requested for comparison
@@ -0,0 +1,22 @@
sequenceDiagram
actor User
participant UI as WealthLedger frontend
participant API as WealthLedger backend
participant Source as Broker / market source
alt Executed coupon or dividend
Source-->>API: Confirmed operation with signed payment and timestamp
API-->>UI: Ledger/income entry with original Money and instrument identity
UI-->>User: Shared payout card - executed, original signed amount
else Upcoming coupon or dividend
Source-->>API: Forecast event based on position at calculatedAt
API-->>UI: Future event, date kind and nullable projected Money
UI-->>User: Same payout card - forecast, registry date where applicable
else Instrument schedule event
Source-->>API: Published coupon/dividend terms, possibly undated/unknown
API-->>UI: Per-security amount, optional estimate and dates
UI-->>User: Same payout card - schedule, not a confirmed receipt
else Other operation or future event
API-->>UI: Trade/tax/fee/maturity/offer data
UI-->>User: Existing non-payout representation
end
Note over UI,User: Same payout presentation; source and certainty remain explicit