This is the build plan for this decision record, bite by bite, as it was grilled and built. It’s copied from our repository unedited, apart from customer, partner and bank names, which read [redacted]. It was written for the people and agents building the product, so expect internal shorthand, and the mistakes are left in.
ADR-838 — Implementation Plan
Findings for the ADR
- F1 — every bite edits or configures ADR-836’s and ADR-837’s work, not yet on
main.AccountAvailabilityReader(ADR-836),FacilitySymbolResolver, theRaisedirection and theExcesssites (ADR-837), the card integrations andWorkflowDispatchContextproperties (ADR-836). Every bite starts after both land; the ADR’s Notes say so. - F4 — the viewer’s hero slot hides memorandum positions (ADR-275), and the cycle’s figures
are memorandum. Decision 9 wants them in the header. Proceeded on:
PositionTypegainsheadline: true, a per-row flag the hero slot honours for any category, so a loan’s arrears or a notice deposit’s noticed total can join the header the same way. The ADR’s call. - F5 — the dormant row’s
dayCountConventionproperty is a lookup the retail package lacks. The retail row uses the calendricaldaysInYear(valueDate)as the deposit types do, and the per-rowdayCountConventionkey where a tenant wants a day count (ADR-353). - F6 — the catch-up is deferred interest (phase A Q3.2, plan grill 2–6): a history-replaying
function charged a cleared statement, could not be reproduced by a re-walk, and needed
schedule dates nothing binds. Two daily accrual rows fill
DeferredCycleInterestandDeferredStatementInterestwhile interest-free; the close and the due date set, charge or reset them. Decision 6; the figure is 302.47 either way. - F7 — the card’s available nets its own draw (Q4.1): ADR-837’s
FacilityAvailableadds the account’s own usage back, so the asset reading subtracts the wired position again. Decision 3. - F8 — arrears is an overlay (Q3.4, ADR-392): the arrears raise is one transaction with two
legs (debit
Arrears, creditMinimumPaymentDue) — a pairedSetwould post the parent’s amount (grill 10) — and the arrears clearance consumes no payment. Decision 7. - F9 — NCA §101 permits no over-limit fee (phase A): the package carries none; the gb cell
adds it; the late fee is
DefaultAdmin, the annual and cash-advance feesFee(ServiceFeeis not a category, grill 9). Decision 8; a standards row. - F10 — signs and
abs(Q2.1): on an asset type a credit reads negative, and the engine posts the absolute amount, so every drain readsabs(UnallocatedPayment)as the dormant row does;Outstandingcarries no leg forUnallocatedPayment(Q2.2), sits in its own balance group (grill 13), and the close setsmax(0, Outstanding)(Q2.3). - F11 — the schedules (Q2.6, Q2.7):
StatementstartsaddMonths(StartDate, 1);PaymentDuestartsaddDays(addMonths(StartDate, 1), paymentGraceDays); a grace of 28 or more days is a load diagnostic. The over-limit fee row runs before the close rows (Q2.4). Both schedules usebusinessDayConvention: None(Q3.7). - F12 —
GracePeriodStatusopens at 1 (Q3.3) through the type’s opening transactions (OpeningTransactionRunner), aGraceStatusUpdateof 1. - F13 — allocation is the payment workflow (grill 1): a triggered row runs only inside the
day-walk, so a live payment would sit unallocated until the next close. The
receive-paymentworkflow drains in steps, each reading the balances the previous step left (RefreshAggregateState); no triggered rows remain on the type, so a re-walk counts nothing twice. Decision 7. - F14 — refunds and cash advances (Q4.2, Q2.9, Q4.3, Q4.6, grill 14): the refund workflow
branches on the merchant category as the purchase does, credits the balance the purchase
debited and the
CyclePurchasesorStatementPurchasesit was counted in, the excess past that balance toUnallocatedPayment; a waiting credit absorbs a cash advance too; a cash advance accrues from the day after it posts (the clearing step runs after the walk); quasi-cash codes are purchases unless a tenant adds them. - F15 — the facility figure on the detail (Q5.1): ADR-837’s
OverdraftDtoserves aRaisewire too; its lane picks a nature-neutral name (landing note on ADR-837). The due date stays on the schedules panel: a next occurrence on the detail would put a scheduler inside a query handler (grill 13). Bite 5 reads the headline positions and the facility figure. - F16 — fixture (Q4.4, Q2.5, Q2.8, Q3.5, Q3.6): the revolving account is opt-in per test;
balances are arranged by posting the types directly; prices are late 150, cash advance 50,
annual 350, over-limit 100 (gb cell); the three properties carry
defaultExpressionand tests pass them anyway; days past due is read asMicroloanArrearsEndToEndTestsreads it; dates anchor on the trading date and the figures assume a 365-day year. - F17 — the activation check cannot evaluate a named rate (grill 7):
RegulatoryLimitEnforcementevaluates every counted scheduled row in a guard context with noratelookup, andTryEvaluatecatches onlyScriptException, so activating a type whose rows readrate('…')throws. ADR-837’s overdraft rows hit it first; recorded on ADR-837’s plan and filed with the coordinator. Bite 1 binds the lookup and widens the catch. - F18 — the Reg 42 ceiling never bound on a named rate (grill 8): enforcement checks only a
structure-bound rate property. Bite 1 extends it to the
rate('…')references anInterest-category scheduled row reads, at agreement date (ADR-298 D7); a scenario refuses activation above the ceiling. Decision 8. - F19 —
Excessis computed fromCurrentat three sites (grill 11): ADR-837’sAccountValuation.BuildContext,AccountGuardContextBuilderand the detail DTO. Bite 1 computes it from the wired position at all three, so aRaisewire’s over-limit reads. - F20 — master rows and the round trip (grill 13): every new position and transaction type
needs its master row and
btcCode(ADR-424);headlineround-trips throughPackageExporter/PackageImporter. - F21 — the figure is 302.46 (phase B, bite 3): a
maximumPrecisionrow rounds to four decimals (AccountValuation.cs:352-354), so forty-six deferred rows of 6.5753 sum to 302.46, a cent under the single computation. Scenario, example and guide carry 302.46. - F22 — the catch-up includes the current period’s purchases (bite 3, 4c): Decision 6 said so; the scenario said “alone”. The scenario now says what it tests, and a new scenario buys between the close and the due date (46 rows of 6.5753 and 21 rows of 1.0959, each rounded: 325.48).
- F23 — a waiting credit is spendable (bite 4): real issuers let a customer spend an overpayment, and declining them while the bank holds their money is a front-desk complaint. Decision 3 adds credit balances back; the cash branch drains fees before the advance so a credit never strands a fee; a scheme reversal of a cash advance keeps the fee (Decision 7).
- F24 — the annual fee first falls a year after opening (bites 2, 3, 4):
AnnualstartsaddMonths(StartDate, 12); a close is monthly on the anchor’s day, clamped to a shorter month; the worked example’s second close is 30 October. - F25 — the due figures fall by the whole payment; a missed minimum joins the next (bite 2,
bite 3 4h):
MinimumPaymentSetadds theArrearsposition as it stands at the close, so a minimum cleared before the close is not asked for again. - F26 — a close posts even at zero (bite 2): if the engine skips a zero
Set, bite 2 makes the close rows post regardless, so a card used and settled inside a cycle still gets its scheduled statement; a card with no activity and nothing owed gets one too — a nil statement is the cheaper of the two readings and the one a customer expects. - F27 — the roll-up invariant is validated at load (bites 2, 3, 4): a facility wired to a memorandum roll-up refuses a transaction type that moves a standard balance without the roll-up leg, and a roll-up in a summed balance group. Bite 1’s validator.
- F28 — a named rate that cannot be priced refuses activation (bite 1): fail closed; each
rate('…')reference is checked on its own, and a summed pair passes each alone — the register row records the limitation.RegulatoryLimitGuardresolvesPerMonthfor every row, so anInterestrow is evaluated and never compared today; bite 1 fixes it with F18. - F29 —
headlinelives on the type’s position binding (bite 5), served by the account-type read; the composer andAbsorbInlineTypescarry it through. The detail’s facility figure for an asset type is the oracle’s available, holds included, tied by a parity scenario; the name isfacilityHeadroom, and bite 1 renames ADR-837’soverdraftand its shipped test once both have landed. - F30 — days past due (bite 3, 4g) is read from the
AgedDebtorstream (DaysPastDue(asOf)) orIArrearsReader;MicroloanArrearsEndToEndTestsreads due positions only. F16 corrected.
Files touched
Bite 1 — the symbols for a Raise wire, the asset reading, the merchant parameters, the activation check, headline
src/LedgerTM.Accounts/Application/Operations/FacilitySymbolResolver.cs— binds the three symbols for aRaisewire:FacilityLimit,FacilityAvailableas ADR-837,Excess = max(0, wired position − FacilityLimit)(ADR-837’s file, landed)src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.cs,src/LedgerTM.Accounts/Application/Operations/AccountGuardContextBuilder.cs,src/LedgerTM.Accounts/Application/Queries/GetAccountDetail.cs—Excessfrom the wired position, notCurrent(F19; ADR-837’s sites, landed); the detail’s facility figure for aRaisewire (F15)src/LedgerTM.Accounts/Application/Queries/AccountAvailabilityReader.cs— an asset-nature type contributes no ledger;Available = max(0, FacilityAvailable − wired position − ExternalReductions)(ADR-836’s file, landed; F7)src/LedgerTM.Accounts/Application/Commands/ProcessExternalSourcePaymentHandlers.cs— the card dispatch bindsmerchantCategory,merchantName,merchantCountryas workflow parameters from the command (ADR-836’s file, landed); a characterisation test ofDispatchAsyncprecedes the edit (footprint)src/LedgerTM.Accounts/Application/Limits/RegulatoryLimitEnforcement.cs,RegulatoryLimitGuard.cs— evaluates with the rate lookup;TryEvaluatecatches the bind failure; theInterestceiling checks eachrate('…')reference a scheduled row reads, failing closed on a rate it cannot price (F17, F18, F28)src/LedgerTM.Accounts/Application/Settings/AccountTypesSettingsValidator.cs— the roll-up invariant (F27); apaymentGraceDaysdefault of 28 or more on a type with aPaymentDueschedule is refused (F11)src/LedgerTM.Accounts/Application/Queries/GetAccountDetail.cs— ADR-837’soverdraftbecomesfacilityHeadroom(F29);LedgerTM.Tests.Component/Accounts/CurrentAccountViewerTests.cs(ADR-837’s, landed) reads the new namesrc/LedgerTM.Accounts/Domain/Configuration/PositionType.cs,src/LedgerTM.Accounts/Yaml/…(the converter that owns the row),src/LedgerTM.Accounts/Domain/Configuration/AccountTypesSettings.cs(the composer andAbsorbInlineTypes),src/LedgerTM.Seeding.Provisioning/PackageExporter.cs,PackageImporter.cs—headline(F4, F20, F29)LedgerTM.Tests.Architecture/ShapeGate/stored-shapes.tsv—PositionType.Headline(default:false)LedgerTM.Tests.Component/Accounts/NamedRateCeilingTests.cs— new; activation refused above the ceiling, passed within it, on a type whose rows read a named rateLedgerTM.Tests.Component/Accounts/RaiseWireSymbolsTests.cs— new; a loan readsFacilityLimit,FacilityAvailableandExcesson its own wireLedgerTM.Tests.Component/Accounts/RollUpWireValidationTests.cs— new; the roll-up invariant and the grace-days bound refuse at load
Bite 2 — CreditCard on the retail template
src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/AccountTypesSettings.yaml— theCreditCardrow: positions (withheadlineon the cycle figures), transaction types withcostOfCreditCategory,btcCodeandOutstandinglegs, theAccrual,Statement,PaymentDueandAnnualschedules,statementSchedule: Statement, the daily rows, the close rows in sequence, the due-date rows in sequence, thereceive-payment,card-purchase,card-refundandcloseworkflows, the external integrations, the opening transaction,limitIntegrations.facility { position: Outstanding, facilityType: CreditCard, direction: Raise, activationCheck: false },regulatoryRegime,servicingUnit,taxReportingRegime,paymentGraceDays,minimumPaymentPercent,minimumPaymentFloor; the master rows for every new position and transaction type (F20)src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/LookupTypesSettings.yaml—facility-typegainsCreditCardsrc/LedgerTM.Seeding.Provisioning/tenant-templates/countries/za/retail-bank/RateSettings.yaml,countries/gb/retail-bank/RateSettings.yaml— rate typesCreditCardPurchase(0.20),CreditCardCashAdvance(0.24)src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/PriceSettings.yaml—card-annual-fee(350),card-late-payment-fee(150),card-cash-advance-fee(50) and their price-list rowssrc/LedgerTM.Seeding.Provisioning/tenant-templates/countries/gb/retail-bank/AccountTypesSettings.yaml,PriceSettings.yaml(cells) — the over-limit fee type, its close row and price (100) for the gb tenant (F9)src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/PostingSettings.yaml— a card receivable GL account, interest income and fee income rows; aCreditCardposting group with a rule per transaction typesrc/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/AccountViewsSettings.yaml,BalanceGroupsSettings.yaml— the rows a loan type carries;Arrearsin the arrears group;Outstandingin a group of its own (F10)src/LedgerTM.Seeding.Provisioning/tenant-templates/regimes/za-nca/retail-bank/RegulatoryLimitsSettings.yaml— theCreditCardReg 42 row, unsourced and marked (ADR-298 D3a)LedgerTM.Tests.Component/Accounts/CreditCardCycleTests.cs— new
Bite 3 — the interest-free rule
src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/AccountTypesSettings.yaml— the two deferred accrual rows, the close’s deferred set and reset (the purchases’ set and reset are bite 2’s), thePurchaseInterestCatchUp, deferred resets,GraceStatusUpdate,LateFeeChargedandMinimumPaymentOverduerows onPaymentDue, in sequence after the accrualsLedgerTM.Tests.Component/Accounts/CreditCardInterestFreeTests.cs— new
Bite 4 — the card
src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/CardTypesSettings.yaml— thecreditcard typeLedgerTM.Tests.Component/Cards/CardsComponentFixture.cs— aCreditCardtype from the composed template, thecreditcard type, an opt-in revolving account and facility for the demo customerLedgerTM.Tests.Component/Cards/CreditCardAuthorisationTests.cs— new; the tap against the limit and the cash advance through the clearing post
Bite 5 — the viewer, the sample data, the guide, the probe, the register
src/ui-apps/shared/src/generated/api-types.ts— regenerated (headlineon the position type)src/ui-apps/bank/src/features/accounts/generic/generic-account-viewer.tsx— the hero slot shows aheadlineposition of any category; the facility figure labelled by naturesrc/LedgerTM.Seeding.ZaRetail.Samples/Steps/SampleData/SeedSampleAccountsAndLimits.cs— the demo customer’s ZARCreditCardand its 20 000 facilitysrc/LedgerTM.Seeding.ZaRetail.Samples/Steps/SampleData/SeedSampleCards.cs— the demo customer’s credit cardsrc/ui-apps/bank/ui-review/adr-uat/flows/adr-838-server-probe.ts— newdocs/guide/features/credit-cards.md— new;docs/guide/features/facilities.md— theCreditCardtypedocs/standards/README.md— the NCA §8(3) row gains the credit card; a §101 row (permitted charges) is added; ADR frontmatterstandards:in the same commitLedgerTM.Tests.Component/Accounts/CreditCardViewerTests.cs— new
Prior art
Nothing changed since the grill, and two declared names left: positionDays and the schedule
occurrence dates (F6). PositionType.Headline (F4) is the one supporting type the signatures
needed; it carries F4’s decision, which is raised.
Interfaces
// src/LedgerTM.Accounts/Domain/Configuration/PositionType.cs — changed (F4)
public bool Headline { get; init; } // yaml `headline: true`; the hero slot shows it whatever its category; exported and imported with the row
// src/LedgerTM.Accounts/Application/Operations/FacilitySymbolResolver.cs — changed (D2; ADR-837's type)
// Raise wire: FacilityLimit = min(Amount, max(0, Amount − Σ max(0, usage[other accounts]))); FacilityAvailable = max(0, FacilityLimit − Reserved);
// Excess = max(0, ledger(wired position) − FacilityLimit), computed from the wired position at every site ADR-837 computes it from Current (F19). BelowZero as ADR-837. No wire → None.
// src/LedgerTM.Accounts/Application/Queries/AccountAvailabilityReader.cs — changed (D3; ADR-836's type)
// Liability nature: as ADR-837. Asset nature: Ledger = 0, Claims = 0, Available = max(0, FacilityAvailable − wiredPosition + Σ max(0, −standard position) − ExternalReductions) (F7, F23): an overpaid credit is spendable.
// src/LedgerTM.Accounts/Application/Commands/ProcessExternalSourcePaymentHandlers.cs — changed (D4; ADR-836's handlers)
// The card dispatch adds parameters merchantCategory (the MCC's four digits), merchantName, merchantCountry (alpha-2 or null) beside amount.
// src/LedgerTM.Accounts/Application/Limits/RegulatoryLimitEnforcement.cs — changed (D8, F17, F18)
// The guard context it evaluates in carries the rate lookup; TryEvaluate also catches the evaluator's InvalidOperationException; an Interest-category
// scheduled row's rate('name', valueDate) references are each checked on their own against the regime's ceiling at agreement date, refusing activation as a bound property is refused;
// a rate unknown or unfixed on that date refuses too (REGULATORY_RATE_UNPRICEABLE). RegulatoryLimitGuard resolves the row's basis from the category, so an Interest row is compared (F28).
// Configuration (D1, D5, D6, D7) — src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/AccountTypesSettings.yaml, CreditCard:
// nature: Asset; accountRoles: holder; statementSchedule: Statement
// positionTypes: PurchaseBalance, CashAdvanceBalance, Fees, UnallocatedPayment, Arrears (standard; Arrears in the arrears balance group, an overlay); PurchaseAccrued, CashAdvanceAccrued (accrual);
// Outstanding (memorandum, its own balance group), StatementBalance (headline), AmountDue (headline), MinimumPaymentDue (headline), CyclePurchases, StatementPurchases,
// DeferredCycleInterest, DeferredStatementInterest, GracePeriodStatus (memorandum)
// externalIntegrations: cardPurchase → card-purchase, cardRefund → card-refund, bankDeposit → receive-payment, debitOrder → receive-payment
// openingTransactions: GraceStatusUpdate 1 (F12)
// transactionTypes (every one with costOfCreditCategory and btcCode, none with a guard; isPostable on all):
// Purchase (Dr PurchaseBalance, Dr Outstanding, Dr CyclePurchases), CashAdvance (Dr CashAdvanceBalance, Dr Outstanding),
// PurchaseRefund (Cr PurchaseBalance, Cr Outstanding, Cr CyclePurchases), StatementPurchaseRefund (Cr PurchaseBalance, Cr Outstanding, Cr StatementPurchases), CashAdvanceRefund (Cr CashAdvanceBalance, Cr Outstanding),
// RefundCredit (Cr UnallocatedPayment), Payment (Cr UnallocatedPayment; isDefaultInboundAllocation),
// FeePayment, CashAdvancePayment, PurchasePayment (each Dr UnallocatedPayment, Cr its balance, Cr Outstanding), ArrearsCleared (Cr Arrears only — the overlay, F8),
// AmountDueReduced, MinimumPaymentReduced (Cr the memorandum),
// PurchaseInterestAccrued, CashAdvanceInterestAccrued, DeferredCycleInterestAccrued, DeferredStatementInterestAccrued (Dr their position; maximumPrecision; Interest),
// PurchaseInterestCatchUp (Dr PurchaseAccrued; maximumPrecision; Interest), PurchaseInterestCapitalised, CashAdvanceInterestCapitalised (Cr the accrual, Dr the balance, Dr Outstanding),
// StatementClose, AmountDueSet, MinimumPaymentSet, StatementPurchasesSet, CyclePurchasesReset, DeferredStatementInterestSet, DeferredCycleInterestReset, DeferredStatementInterestReset (Set),
// GraceStatusUpdate (Set), MinimumPaymentOverdue (Dr Arrears, Cr MinimumPaymentDue — one type, two legs, F8),
// AnnualFeeCharged (Fee), LateFeeCharged (DefaultAdmin), CashAdvanceFeeCharged (Fee), OverLimitFeeCharged (gb cell only, Fee, F9) — each Dr Fees, Dr Outstanding
// scheduleTypes: Accrual (daily), Statement (monthly, startDateExpression addMonths(StartDate, 1)), PaymentDue (monthly, startDateExpression addDays(addMonths(StartDate, 1), paymentGraceDays)), Annual (yearly, startDateExpression addMonths(StartDate, 12), F24); businessDayConvention None (F11)
// A Set row posts even at zero (F26): the close rows always post, so the cycle trigger fires and a statement is issued.
// scheduledTransactions, EndOfDay, by the generated type's sequenceNumber:
// Accrual: PurchaseInterestAccrued PurchaseBalance * rate('CreditCardPurchase', valueDate) / daysInYear(valueDate) condition GracePeriodStatus == 0 && PurchaseBalance > 0
// CashAdvanceInterestAccrued CashAdvanceBalance * rate('CreditCardCashAdvance', valueDate) / daysInYear(valueDate) condition CashAdvanceBalance > 0
// DeferredCycleInterestAccrued CyclePurchases * rate('CreditCardPurchase', valueDate) / daysInYear(valueDate) condition GracePeriodStatus == 1 && CyclePurchases > 0
// DeferredStatementInterestAccrued StatementPurchases * rate('CreditCardPurchase', valueDate) / daysInYear(valueDate) condition GracePeriodStatus == 1 && StatementPurchases > 0
// Statement, in sequence: OverLimitFeeCharged price('card-over-limit-fee') condition Excess > 0 (gb cell); capitalise both accruals; StatementClose = max(0, Outstanding); AmountDueSet = StatementBalance;
// MinimumPaymentSet = min(StatementBalance, max(StatementBalance * minimumPaymentPercent, minimumPaymentFloor) + Arrears) (F25); StatementPurchasesSet = CyclePurchases; DeferredStatementInterestSet = DeferredCycleInterest;
// CyclePurchasesReset = 0; DeferredCycleInterestReset = 0
// PaymentDue, in sequence after the Accrual rows (D6): PurchaseInterestCatchUp DeferredStatementInterest + DeferredCycleInterest condition AmountDue > 0 && GracePeriodStatus == 1;
// DeferredCycleInterestReset = 0 condition AmountDue > 0 && GracePeriodStatus == 1; DeferredStatementInterestReset = 0 (always); GraceStatusUpdate AmountDue <= 0 ? 1 : 0;
// LateFeeCharged price('card-late-payment-fee') condition MinimumPaymentDue > 0; MinimumPaymentOverdue MinimumPaymentDue condition MinimumPaymentDue > 0
// Annual: AnnualFeeCharged price('card-annual-fee')
// operations (workflows; each step reads the balances the previous step left, F13):
// receive-payment: postTransaction Payment $amount; FeePayment min(abs(UnallocatedPayment), Fees); CashAdvancePayment min(abs(UnallocatedPayment), CashAdvanceBalance);
// PurchasePayment min(abs(UnallocatedPayment), PurchaseBalance); ArrearsCleared min($amount, Arrears); AmountDueReduced min($amount, AmountDue); MinimumPaymentReduced min($amount, MinimumPaymentDue)
// — every drain under whenCondition amount > 0; the order is the allocation rule a tenant edits
// card-purchase (the cardPurchase workflow): whenCondition $merchantCategory == '6010' || $merchantCategory == '6011' → CashAdvance $amount; CashAdvanceFeeCharged price('card-cash-advance-fee', valueDate);
// FeePayment min(abs(UnallocatedPayment), Fees); CashAdvancePayment min(abs(UnallocatedPayment), CashAdvanceBalance) (fees first, F23) — else Purchase $amount; PurchasePayment min(abs(UnallocatedPayment), PurchaseBalance)
// card-refund: the same branch → CashAdvanceRefund min($amount, CashAdvanceBalance) — else PurchaseRefund min($amount, min(PurchaseBalance, CyclePurchases)),
// StatementPurchaseRefund min($amount − the first, min(PurchaseBalance, StatementPurchases)); then RefundCredit for any remainder (F14)
// close
// limitIntegrations: facility { position: Outstanding, facilityType: CreditCard, direction: Raise, activationCheck: false }
// properties: regulatoryRegime (required), servicingUnit, taxReportingRegime, paymentGraceDays (Integer, defaultExpression 25; 28 or more is a load diagnostic, F11),
// minimumPaymentPercent (Decimal, defaultExpression 0.05), minimumPaymentFloor (Decimal, defaultExpression 200)
// The sign convention follows the asset nature: a Debit raises a balance the customer owes; a test reads +12 000 on PurchaseBalance and −2 500 on UnallocatedPayment after a 2 500 payment lands.
// src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/CardTypesSettings.yaml — credit: credentialKinds [Plastic, DeviceToken], fundingShape SingleAccount,
// fundableAccountTypes [CreditCard], defaultControls atm allowed, deviceProvisioning StepUp, credentialLifeYears 3, maxActivePerOwner 2
// regimes/za-nca/retail-bank/RegulatoryLimitsSettings.yaml — { regimeCode: NCA, category: Interest, accountType: CreditCard, ceiling: rate('SARB Repo Rate', valueDate) * 2.2 + 0.10, basis: PerAnnumRate, citation: PLACEHOLDER — not sourced }
// src/LedgerTM.Accounts/Application/Queries/GetAccountDetail.cs — ADR-837's facility figure is returned for a Raise wire too, as `facilityHeadroom` (limit = the facility's amount, available = the oracle's available, excess, frozen) (F15, F29)
Bite 5 — no contracts of its own.
Bites
| Bite | Description | Acceptance criterion | Status |
|---|---|---|---|
| 1 | The facility symbols for a Raise wire with Excess from the wired position; the asset-nature reading of AccountAvailability; the merchant parameters on the card workflow; the activation check evaluating named rates against the regime ceiling; headline on a position type; the roll-up validator; facilityHeadroom |
a loan reads its own facility symbols; a purchase rate above the regime’s ceiling refuses activation; a roll-up wire with a missing leg is refused at load | Pending |
| 2 | CreditCard on the retail template: positions, transaction types, the cycle, the due date, the payment workflow’s allocation, fees, arrears, GL, rates, prices, the Reg 42 row, the CreditCard facility type |
a statement closes with its balance, amount due and minimum; a payment allocates to the most expensive balance first; the minimum is the percentage, floored, and never more than the statement; a payment on the close day is in the statement; an overpayment waits as a credit and floors the due figures at zero | Pending |
| 3 | The interest-free rule: deferred interest accrued daily, charged at the due date when a statement is not paid in full, forgiven when it is | a statement not paid in full loses the interest-free period; a statement paid in full keeps it; a previous statement paid in full inside the window is not charged; a purchase between the close and the due date is caught up too; a payment on the due day counts; an unpaid minimum becomes arrears and a late fee | Pending |
| 4 | The card: the credit card type, the oracle’s available for the asset type, the cash advance through the clearing post |
a tap is approved against the revolving limit; an ATM withdrawal posts as a cash advance; a waiting credit raises the available; a frozen or missing facility declines every tap; a cash category posts a cash advance, anything else a purchase; a waiting credit absorbs a cash advance, fees first | Pending |
| 5 | The viewer’s headline figures; sample data and the probe; the guide article; the register rows | an operator sees the cycle’s figures on the account; the detail and the oracle read one available; a card owing past its limit shows the excess | Pending |
Scenarios
Feature: a revolving credit card prices purchases on the days they were outstanding
# Bite 1
Scenario: a loan reads its own facility symbols
Given a loan whose type wires a facility to its balance and whose customer holds a facility of 100 000 with 60 000 drawn
When a scheduled row on the loan asks for the facility limit, the facility available and the excess
Then they read 100 000, 100 000 and 0, and the headroom after the draw is 40 000
And a loan drawn to 110 000 reads an excess of 10 000
# Seen at: none
# Bite 1
Scenario: a roll-up wire with a missing leg is refused at load
Given an account type whose facility is wired to a memorandum roll-up position
When a transaction type on it moves a standard balance without moving the roll-up, or the roll-up sits in a summed balance group, or the grace days default to twenty-eight
Then the template is refused at load, naming the row
# Seen at: none
# Bite 1
Scenario: a purchase rate above the regime's ceiling refuses activation
Given a regime whose ceiling for the credit card's interest is 30% and a tenant whose purchase rate type reads 32%
When a clerk activates a credit card account under that regime
Then the activation is refused, naming the rate and the ceiling
And with the rate type at 20% the activation passes
# Seen at: route:/accounts/{id}
# Bite 2
Scenario: a statement closes with its balance, amount due and minimum
Given a credit card with purchases of 12 000 and a minimum of 5% floored at 200
When the statement closes on 30 September
Then the statement balance is 12 000, the amount due is 12 000 and the minimum payment is 600
And a scheduled statement is issued for the cycle
# Seen at: route:/accounts/{id}
# Bite 2
Scenario: a payment allocates to the most expensive balance first
Given a credit card owing 150 in fees, 2 000 in cash advances and 12 000 in purchases, with 12 000 due
When a payment of 2 500 arrives during the day
Then fees fall to 0, cash advances to 0 and purchases to 11 650 at once
And nothing remains unallocated, and the amount due reads 9 500
# Seen at: route:/accounts/{id}
# Bite 2
Scenario Outline: the minimum is the percentage, floored, and never more than the statement
Given a credit card with purchases of <purchases>
When the statement closes on 30 September
Then the minimum payment is <minimum>
# Seen at: route:/accounts/{id}
Examples:
| purchases | minimum |
| 12 000 | 600 |
| 3 000 | 200 |
| 150 | 150 |
| 0 | 0 |
# Bite 2
Scenario: a payment on the close day is in the statement
Given a credit card with purchases of 12 000
When 2 000 is paid on 30 September and the statement closes that day
Then the statement balance and amount due are 10 000 and the minimum 500
# Seen at: route:/accounts/{id}
# Bite 2
Scenario: an overpayment waits as a credit and floors the due figures at zero
Given a credit card owing 12 000 with 12 000 due and a minimum of 600
When 13 000 arrives
Then purchases read 0, 1 000 waits as a credit, the amount due and the minimum read 0, and nothing is outstanding
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: a statement not paid in full loses the interest-free period
Given a statement of 12 000 closed on 30 September from a purchase on 10 September, due 25 October at 20%
When 600 is paid on 20 October and the due date passes
Then one catch-up interest posting of 302.46 is charged on 25 October, on the statement's purchases and the current period's, of which there are none
And purchases accrue daily from 26 October on 11 400, and the due day itself is priced once
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: a statement paid in full keeps it
Given a statement of 12 000 closed on 30 September, due 25 October
When 12 000 is paid on 20 October and the due date passes
Then no interest is charged on September's purchases
And a purchase on 5 October accrues nothing through October
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: a previous statement paid in full inside the window is not charged
Given an August statement of 5 000 paid in full on 20 September, and a September purchase of 12 000 on 10 September
When 600 is paid on 20 October and the due date passes
Then the catch-up on 25 October is 302.46, on the 12 000 alone
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: a purchase between the close and the due date is caught up too
Given a statement of 12 000 closed on 30 September, due 25 October, and a purchase of 2 000 on 5 October
When 600 is paid on 20 October and the due date passes
Then the catch-up on 25 October is 325.48: forty-six rounded rows on the statement's purchases and twenty-one on the October purchase from its own date
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: a payment on the due day counts
Given a statement of 12 000 closed on 30 September, due 25 October
When 12 000 is paid on 25 October itself
Then no catch-up posts and the interest-free period stays
# Seen at: route:/accounts/{id}
# Bite 3
Scenario: an unpaid minimum becomes arrears and a late fee
Given a statement with a minimum payment of 600 due 25 October and a late fee of 150
When nothing is paid by the due date
Then 600 is raised on arrears and the arrears raise moves no balance; the late fee of 150 is charged
And the account reads one day past due on 26 October, and a close with the arrears still raised would ask for the 600 again
And a payment of 700 on 27 October clears the arrears and reduces the balances by 700
# Seen at: route:/accounts/{id}
# Bite 4
Scenario: a tap is approved against the revolving limit
Given a credit card on a revolving account with a 20 000 facility owing 12 000 and a 500 hold
When a merchant asks to authorise 7 000
Then it is approved and the account's available reads 500, the headroom after what is owed and held
And a further tap of 501 is declined for insufficient funds
# Seen at: route:/cards/{id}
# Bite 4
Scenario: an ATM withdrawal posts as a cash advance
Given a credit card on a revolving account with a cash-advance fee of 50
When a clearing line of 1 000 from a cash merchant category posts at day-end
Then the cash-advance balance is 1 000 and the fee of 50 is charged
And interest accrues on the 1 000 from its transaction date at the cash-advance rate
# Seen at: route:/accounts/{id}
# Bite 4
Scenario: a waiting credit raises the available
Given a credit card on a revolving account with a 20 000 facility owing nothing and a 2 500 credit waiting
When a merchant asks to authorise 22 000
Then it is approved, and 22 501 would have been declined
# Seen at: route:/cards/{id}
# Bite 4
Scenario: a frozen or missing facility declines every tap
Given a credit card whose customer holds no credit card facility, or a frozen one
When a merchant asks to authorise 100
Then it is declined for insufficient funds and the available reads 0, never below
# Seen at: route:/cards/{id}
# Bite 4
Scenario Outline: a cash category posts a cash advance, anything else a purchase
Given a credit card on a revolving account
When a clearing line of 1 000 at merchant category <mcc> posts at day-end
Then it posts as <kind>, with the 50 fee only for a cash advance, and counts in the cycle's purchases only for a purchase
# Seen at: route:/accounts/{id}
Examples:
| mcc | kind |
| 6011 | cash advance |
| 6010 | cash advance |
| 6051 | purchase |
| 5411 | purchase |
# Bite 4
Scenario: a waiting credit absorbs a cash advance, fees first
Given a credit card with 1 200 waiting as a credit
When a cash line of 1 000 posts
Then the fee of 50 is paid from the credit first, the cash advance is paid in full, and 150 still waits
# Seen at: route:/accounts/{id}
# Bite 5
Scenario: an operator sees the cycle's figures on the account
Given a credit card whose statement closed with 12 000 due and 600 minimum
When an operator opens the account
Then the header shows the statement balance, the amount due, the minimum payment and the available limit
# Seen at: route:/accounts/{id}
# Bite 5
Scenario: the detail and the oracle read one available
Given a credit card on a revolving account with a 20 000 facility owing 12 000 and a 500 hold
When the account's detail and the card's funding walk are each asked what is available
Then both answer 7 500
# Seen at: route:/accounts/{id}
# Bite 5
Scenario: a card owing past its limit shows the excess
Given a credit card owing 21 500 on a 20 000 facility
When an operator opens the account
Then the limit reads 20 000, the available 0 and the excess 1 500
# Seen at: route:/accounts/{id}
Scenario → test
| Scenario | Bite | Project | Class | Method | Probe |
|---|---|---|---|---|---|
| a loan reads its own facility symbols | 1 | LedgerTM.Tests.Component |
RaiseWireSymbolsTests |
a_loan_reads_its_own_facility_symbols |
— |
| a purchase rate above the regime’s ceiling refuses activation | 1 | LedgerTM.Tests.Component |
NamedRateCeilingTests |
a_named_rate_above_the_regimes_ceiling_refuses_activation |
— refusal |
| a roll-up wire with a missing leg is refused at load | 1 | LedgerTM.Tests.Component |
RollUpWireValidationTests |
a_roll_up_wire_with_a_missing_leg_is_refused_at_load |
— refusal |
| a statement closes with its balance, amount due and minimum | 2 | LedgerTM.Tests.Component |
CreditCardCycleTests |
a_statement_closes_with_its_balance_amount_due_and_minimum |
adr-838-server-probe.ts |
| a payment allocates to the most expensive balance first | 2 | LedgerTM.Tests.Component |
CreditCardCycleTests |
a_payment_allocates_to_the_most_expensive_balance_first |
adr-838-server-probe.ts |
| the minimum is the percentage, floored, and never more than the statement — 12 000 / 3 000 / 150 / 0 | 2 | LedgerTM.Tests.Component |
CreditCardCycleTests |
the_minimum_is_the_percentage_floored_and_never_more_than_the_statement (a [Theory], one row per example) |
— |
| a payment on the close day is in the statement | 2 | LedgerTM.Tests.Component |
CreditCardCycleTests |
a_payment_on_the_close_day_is_in_the_statement |
— |
| an overpayment waits as a credit and floors the due figures at zero | 2 | LedgerTM.Tests.Component |
CreditCardCycleTests |
an_overpayment_waits_as_a_credit_and_floors_the_due_figures_at_zero |
— |
| a statement not paid in full loses the interest-free period | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
a_statement_not_paid_in_full_loses_the_interest_free_period |
adr-838-server-probe.ts |
| a statement paid in full keeps it | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
a_statement_paid_in_full_keeps_the_interest_free_period |
— |
| a previous statement paid in full inside the window is not charged | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
a_previous_statement_paid_in_full_inside_the_window_is_not_charged |
— |
| a purchase between the close and the due date is caught up too | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
a_purchase_between_the_close_and_the_due_date_is_caught_up_too |
— |
| a payment on the due day counts | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
a_payment_on_the_due_day_counts |
— |
| an unpaid minimum becomes arrears and a late fee | 3 | LedgerTM.Tests.Component |
CreditCardInterestFreeTests |
an_unpaid_minimum_becomes_arrears_and_a_late_fee |
adr-838-server-probe.ts |
| a tap is approved against the revolving limit | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
a_tap_is_approved_against_the_revolving_limit |
adr-838-server-probe.ts |
| an ATM withdrawal posts as a cash advance | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
an_atm_withdrawal_posts_as_a_cash_advance |
adr-838-server-probe.ts |
| a waiting credit raises the available | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
a_waiting_credit_raises_the_available |
— |
| a frozen or missing facility declines every tap | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
a_frozen_or_missing_facility_declines_every_tap |
— refusal |
| a cash category posts a cash advance, anything else a purchase — 6011 / 6010 / 6051 / 5411 | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
a_cash_category_posts_a_cash_advance_anything_else_a_purchase (a [Theory], one row per example) |
— |
| a waiting credit absorbs a cash advance, fees first | 4 | LedgerTM.Tests.Component |
CreditCardAuthorisationTests |
a_waiting_credit_absorbs_a_cash_advance_fees_first |
— |
| an operator sees the cycle’s figures on the account | 5 | LedgerTM.Tests.Component |
CreditCardViewerTests |
the_account_detail_carries_the_headline_positions_and_the_facility_figure |
adr-838-server-probe.ts |
| the detail and the oracle read one available | 5 | LedgerTM.Tests.Component |
CreditCardViewerTests |
the_detail_and_the_oracle_read_one_available |
adr-838-server-probe.ts |
| a card owing past its limit shows the excess | 5 | LedgerTM.Tests.Component |
CreditCardViewerTests |
a_card_owing_past_its_limit_shows_the_excess_and_nothing_available |
— |
UI-surface sweep
Swept src/ui-apps/bank/src for CreditCard, GracePeriodStatus, AmountDue, MinimumPayment,
Memorandum, headline:
src/ui-apps/bank/src/lib/api.ts:7141-7145—PositionTypeDto.category; gainsheadline(regenerated)src/ui-apps/bank/src/features/accounts/generic/generic-account-viewer.tsx:131-165— the hero slot shows Standard positions only (ADR-275); bite 5 admits aheadlineposition of any categorysrc/ui-apps/bank/src/components/financial-summary/use-positions-summary.ts:18-21— the docked headline sums today’s figures (ADR-390); unchanged, a different “headline”- No permission or feature key changes: no new command, query or endpoint.
permissions.generated.tsis untouched. - The card types settings page lists
creditas it listsdebit; no change.
Footprint
Feature projects touched: 4 — LedgerTM.Accounts, LedgerTM.Seeding.Provisioning, LedgerTM.Seeding.ZaRetail.Samples, ui-apps
LedgerTM.Accounts— 10 changed, 0 newLedgerTM.Seeding.Provisioning— 10 changed, 0 newLedgerTM.Seeding.ZaRetail.Samples— 2 changed, 0 newui-apps— 3 changed, 0 new Files: 44 named, 27 code, 12 config
Contracts types: 4 named, 1 changed by this ADR
AccountTypeId— fan-in 23, referenced (LedgerTM.Accounts, LedgerTM.Audit, LedgerTM.BankStatements, LedgerTM.Books, LedgerTM.Cards, LedgerTM.Collections, LedgerTM.Contracts, LedgerTM.DocumentTemplates, LedgerTM.Operations, LedgerTM.Payments, LedgerTM.Pricing, LedgerTM.[redacted], LedgerTM.Regulatory, LedgerTM.Seeding.Corporate.Samples, LedgerTM.Seeding.Provisioning, LedgerTM.Seeding.[redacted].Conversion, LedgerTM.Seeding.[redacted].Samples, LedgerTM.Seeding.ZaRetail.Samples, LedgerTM.Statements, LedgerTM.Suspense, LedgerTM.Warehouse, _creditplus, ui-apps)PositionType— fan-in 7, changed (LedgerTM.Accounts, LedgerTM.Collections, LedgerTM.Contracts, LedgerTM.Limits, LedgerTM.Seeding.Provisioning, LedgerTM.Seeding.[redacted].Conversion, _creditplus)StatementCycleReachedTrigger— fan-in 3, referenced (LedgerTM.Accounts, LedgerTM.Contracts, LedgerTM.Statements)LimitIntegrations— fan-in 2, referenced (LedgerTM.Accounts, LedgerTM.Contracts)
Files reading each changed type: 1 types
PositionType— 96 filesLedgerTM.Tests.Architecture/ShapeGate/stored-shapes.tsvLedgerTM.Tests.Architecture/string-vocabulary-references.txtLedgerTM.Tests.Component/Accounts/BadDebtWriteOffTests.csLedgerTM.Tests.Component/Accounts/Balance/BalanceExcludesArrearsTests.csLedgerTM.Tests.Component/Accounts/Balance/MemorandumPositionExclusionTests.csLedgerTM.Tests.Component/Accounts/PositionTypeMasterSettingsTests.csLedgerTM.Tests.Component/Accounts/ProvisionedAccountNumberingTests.csLedgerTM.Tests.Component/Accounts/Statements/StatementLineCategoryTests.csLedgerTM.Tests.Component/Accounts/TransactionTypeMasterLifecycleTests.csLedgerTM.Tests.Component/Regulatory/DepositInsuranceContext.csLedgerTM.Tests.Component/Seeding/PackageImporterFolderTests.csLedgerTM.Tests.Component/Shapes/corpus/account-lifecycle.jsonLedgerTM.Tests.Reconciliation.[redacted]/[redacted].csLedgerTM.Tests.Unit/Accounts/ArrearsPositionResolverTests.csLedgerTM.Tests.Unit/Accounts/BalanceGroupRoleValidatorTests.csLedgerTM.Tests.Unit/Accounts/ClaimRegisterTests.csLedgerTM.Tests.Unit/Accounts/Configuration/AccountTypeMasterBindingTests.csLedgerTM.Tests.Unit/Accounts/Configuration/AccountTypeReferenceCheckerTests.csLedgerTM.Tests.Unit/Accounts/Configuration/ScriptSymbolValidatorTests.csLedgerTM.Tests.Unit/Accounts/IntegrationEvents/AccountTriggerProjectionTests.csLedgerTM.Tests.Unit/Accounts/LimitIntegrationsValidatorTests.csLedgerTM.Tests.Unit/Accounts/OperationLimitCheckValidatorTests.csLedgerTM.Tests.Unit/Accounts/Operations/EvaluationContextParityTests.csLedgerTM.Tests.Unit/Accounts/PostTransactionTaxRateTests.csLedgerTM.Tests.Unit/Accounts/Projections/AccountFinancialSummaryGroupingTests.csLedgerTM.Tests.Unit/Accounts/Projections/AccountListGroupBalanceKeyingTests.csLedgerTM.Tests.Unit/Accounts/Runtime/AccountTests.csLedgerTM.Tests.Unit/Accounts/Scenarios/FeeAccountScenarioTests.csLedgerTM.Tests.Unit/Accounts/Scenarios/FixedDepositMaturityInstructionTests.csLedgerTM.Tests.Unit/Accounts/Scenarios/FixedDepositWeekendMaturityTests.csLedgerTM.Tests.Unit/Accounts/Scenarios/FixedLoanScenarioTests.csLedgerTM.Tests.Unit/Accounts/SubVocabularyIdDerivationTests.csLedgerTM.Tests.Unit/Accounts/Valuation/AccountValuationRateProviderTests.csLedgerTM.Tests.Unit/Accounts/Valuation/AccountValuationTests.csLedgerTM.Tests.Unit/Accounts/Valuation/DayCountConventionTests.csLedgerTM.Tests.Unit/Accounts/Valuation/InstalmentSolverTests.csLedgerTM.Tests.Unit/Accounts/Valuation/InterestTreatmentTests.csLedgerTM.Tests.Unit/Accounts/Valuation/OpeningTransactionTriggerTests.csLedgerTM.Tests.Unit/Accounts/Valuation/TriggeredTransactionTests.csLedgerTM.Tests.Unit/Accounts/Valuation/WithholdingCapitalisationTests.csLedgerTM.Tests.WorkerHost/AttributionCompletenessTests.csLedgerTM.Tests.WorkerHost/SystemAttributionTests.csLedgerTM.Tests/Integration.CreditPlus/Application/Features/ProcessDayEndHandlerTests.csLedgerTM.Tests/Integration.CreditPlus/Application/Features/RevaluationParityHandlerTests.csLedgerTM.Tests/Integration.CreditPlus/Application/Features/RevaluationReferenceDatingTests.cssrc/LedgerTM.Accounts/Application/Commands/InstructionPositionEffect.cssrc/LedgerTM.Accounts/Application/Commands/ProjectedPositions.cssrc/LedgerTM.Accounts/Application/IntegrationEvents/AccountTriggerProjection.cssrc/LedgerTM.Accounts/Application/Projections/AccountDetailReadModel.cssrc/LedgerTM.Accounts/Application/Projections/AccountFinancialSummaryReadModel.cssrc/LedgerTM.Accounts/Application/Projections/AccountListReadModel.cssrc/LedgerTM.Accounts/Application/Projections/AccountStatementLinesReadModel.cssrc/LedgerTM.Accounts/Application/Queries/GetAccountDetail.cssrc/LedgerTM.Accounts/Application/Queries/GetSalvageClaim.cssrc/LedgerTM.Accounts/Application/Settings/AddPositionType.cssrc/LedgerTM.Accounts/Application/Settings/UpdatePositionType.cssrc/LedgerTM.Accounts/Application/SharedDtos.cssrc/LedgerTM.Accounts/Domain/Account.Claims.cssrc/LedgerTM.Accounts/Domain/Account.Events.cssrc/LedgerTM.Accounts/Domain/Account.Impairment.cssrc/LedgerTM.Accounts/Domain/Account.Notices.cssrc/LedgerTM.Accounts/Domain/Account.Posting.cssrc/LedgerTM.Accounts/Domain/Account.Prescription.cssrc/LedgerTM.Accounts/Domain/Account.Snapshots.cssrc/LedgerTM.Accounts/Domain/AvailableBalance.cssrc/LedgerTM.Accounts/Domain/BadDebtWriteOffPreview.cssrc/LedgerTM.Accounts/Domain/Claim.cssrc/LedgerTM.Accounts/Domain/Configuration/AccountType.cssrc/LedgerTM.Accounts/Domain/Configuration/BalanceGroupsSettings.cssrc/LedgerTM.Accounts/Domain/Configuration/PositionType.cssrc/LedgerTM.Accounts/Domain/Configuration/ProvisioningSettings.cssrc/LedgerTM.Accounts/Domain/Valuation/InstalmentSplitter.cssrc/LedgerTM.Accounts/Yaml/AccountTypeIdYamlConverter.cssrc/LedgerTM.Accounts/Yaml/AccountTypeLoader.cssrc/LedgerTM.Accounts/Yaml/AccountTypeWriter.cssrc/LedgerTM.Collections/AgedDebtors/Application/Integrations/RecordArrearsOnPositionChanged.cssrc/LedgerTM.Contracts/Accounts/Triggers/PositionMovement.cssrc/LedgerTM.Limits/Application/Subscribers/UpdateLimitsOnPositionChanged.cssrc/LedgerTM.Seeding.Provisioning/PackageExporter.cssrc/LedgerTM.Seeding.Provisioning/PackageImporter.cssrc/LedgerTM.Seeding.Provisioning/PackageModel.cssrc/LedgerTM.Seeding.[redacted].Conversion/Recon/ConversionRecon.Events.cssrc/LedgerTM.Seeding.[redacted].Conversion/Recon/ConversionReconEndpoints.cssrc/LedgerTM.Seeding.[redacted].Conversion/Steps/DealImport/PositionStreamer.cssrc/_creditplus/docs/application_architecture.mdsrc/_creditplus/docs/archive/options/option-1/architecture.mdsrc/_creditplus/docs/archive/options/option-1/domain-model.mdsrc/_creditplus/docs/superpowers/plans/2026-03-14-rook-phase1-foundation.mdsrc/_creditplus/docs/superpowers/plans/2026-03-17-data-init-saga-workers.mdsrc/_creditplus/docs/superpowers/plans/2026-03-18-ui-phase2-account-config-counterparties.mdsrc/_creditplus/docs/superpowers/plans/2026-03-20-ui-polish-crud-validation.mdsrc/_creditplus/docs/superpowers/specs/2026-03-14-rook-option1-design.mdsrc/_creditplus/docs/superpowers/specs/2026-03-17-data-init-saga-workers-design.mdsrc/_creditplus/docs/superpowers/specs/2026-03-20-ui-polish-crud-validation-design.mdsrc/_creditplus/frontend/src/lib/api.tssrc/_creditplus/frontend/src/pages/account-types/AccountTypeView.tsxImplementations of changed types: 0 Files reading a touched file by path: 4
BalanceGroupsSettings.yaml—LedgerTM.Tests.Component/Accounts/Balance/MicroloanArrearsEndToEndTests.cs,LedgerTM.Tests.Unit/Accounts/ArrearsPositionResolverTests.cs,LedgerTM.Tests.Unit/Accounts/BalanceGroupRoleValidatorTests.cs,LedgerTM.Tests.Unit/Regulatory/DepositInsuranceConfigurationTests.cs,LedgerTM.Tests.Unit/Seeding/preset-snapshots.txt,src/LedgerTM.Seeding.Provisioning/PackageExporter.cs,src/LedgerTM.Seeding.Provisioning/PackageImporter.csPriceSettings.yaml—LedgerTM.Tests.Architecture/SeededVocabularyKeyConformanceTests.cs,LedgerTM.Tests.Component/Seeding/PackageImporterFolderTests.cs,LedgerTM.Tests.Unit/Seeding/preset-snapshots.txt,src/LedgerTM.Seeding.Provisioning/PackageExporter.cs,src/LedgerTM.Seeding.Provisioning/PackageImporter.cs,src/LedgerTM.Seeding.Provisioning/PackageModel.cs,src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/corporate/MeteringSettings.yaml,src/LedgerTM.Seeding/Packages/ReferenceCheck.cs,src/LedgerTM.Seeding/Packages/VocabularyRegistry.csdocs/standards/README.md—LedgerTM.Tests.Component/Seeding/StandardsRegisterPinTests.cs,LedgerTM.Tests.Unit/Payments/ExternalAccounts/ExternalAccountProxyTests.cs,src/LedgerTM.Payments/ExternalAccounts/Domain/ProxyKinds.cs,src/LedgerTM.Payments/Submissions/Channels/Bacs/Format/BacsAdviceFileFormat.cs,src/LedgerTM.Payments/Submissions/Channels/Bacs/Format/Standard18FileFormat.cs,src/LedgerTM.Payments/Submissions/Channels/Bacs/README.md,src/LedgerTM.Payments/Submissions/Channels/BankservAfrica/BankservAfricaReturnReasons.cs,src/LedgerTM.Payments/Submissions/Channels/BankservAfrica/Format/BankservAfricaReturnFileFormat.cssrc/LedgerTM.Accounts/Domain/Valuation/AccountValuation.cs—LedgerTM.Tests.Architecture/EvaluationContextConstructionSiteTests.cs
Domain events touched: 0 Aggregates touched: 0
Methods at CRAP 30+ in changed files: 7 (unit coverage, cached at main 1a4b6f460)
LedgerTM.Accounts.Domain.Valuation.AccountValuation.Brent— CRAP 812, complexity 28, 0% covered —src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.csLedgerTM.Accounts.Application.Commands.ExternalSourceDispatcher.BuildEvaluationContext— CRAP 506, complexity 22, 0% covered —src/LedgerTM.Accounts/Application/Commands/ProcessExternalSourcePaymentHandlers.csExternalSourceDispatcher.DispatchAsync— CRAP 420, complexity 20, 0% covered —src/LedgerTM.Accounts/Application/Commands/ProcessExternalSourcePaymentHandlers.csLedgerTM.Accounts.Domain.Valuation.AccountValuation.RunSecant— CRAP 57, complexity 56, 95% covered —src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.csLedgerTM.Accounts.Domain.Valuation.AccountValuation.BuildContext— CRAP 46, complexity 46, 94% covered —src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.csLedgerTM.Accounts.Domain.Valuation.AccountValuation.SolveInstalment— CRAP 45, complexity 24, 67% covered —src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.csLedgerTM.Accounts.Domain.Valuation.AccountValuation.ProcessScheduledTransactions— CRAP 32, complexity 32, 100% covered —src/LedgerTM.Accounts/Domain/Valuation/AccountValuation.csPermission keys to add: 0
Warnings
PositionTypeis changed and read by 7 projects — name the seam in the ADR.LedgerTM.Accounts.Domain.Valuation.AccountValuation.Brentis at CRAP 812 (and 4 more in that file) — write its test before the bite edits it, and name the test in the plan.LedgerTM.Accounts.Application.Commands.ExternalSourceDispatcher.BuildEvaluationContextis at CRAP 506 (and 1 more in that file) — write its test before the bite edits it, and name the test in the plan.- 4 feature projects touched — say why this is not two ADRs.
At land: 61 files touched, 44 predicted, 32 unplanned. LedgerTM.Tests.Component/Accounts/AccountsComponentFixture.cs, LedgerTM.Tests.Component/Cards/CurrentAccountExcessTests.cs, LedgerTM.Tests.Component/Cards/LatePresentmentValueDatingTests.cs, LedgerTM.Tests.Component/Seeding/SampleCardsSeedTests.cs, LedgerTM.Tests.Unit/Accounts/AccountTypeIconAndFamilyTests.cs, LedgerTM.Tests.Unit/Accounts/RollUpWireValidatorTests.cs, LedgerTM.Tests.Unit/Seeding/preset-snapshots.txt, reachability-baseline.txt, src/LedgerTM.Accounts/Application/Limits/RegulatoryLimitGuard.cs, src/LedgerTM.Accounts/Application/Queries/AccountStatementCloseReader.cs, src/LedgerTM.Accounts/Application/Settings/ExternalIntegrationsValidator.cs, src/LedgerTM.Accounts/Application/Settings/PaymentGraceValidator.cs, src/LedgerTM.Accounts/Application/Settings/RollUpWireValidator.cs, src/LedgerTM.Accounts/Application/Workflows/WorkflowInterpreter.cs, src/LedgerTM.Accounts/Bootstrapper.cs, src/LedgerTM.Accounts/Domain/Valuation/FacilitySymbols.cs, src/LedgerTM.Cards/Application/DayEnd/PostCardClearingBatch.cs, src/LedgerTM.Contracts/Accounts/IAccountStatementCloseReader.cs, src/LedgerTM.Scripting/Parsing/ExpressionSymbolScan.cs, src/LedgerTM.Seeding.Provisioning/tenant-templates/countries/gb/retail-bank/PriceSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/countries/gb/retail-bank/RateSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/countries/za/retail-bank/PriceSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/investment-house/LookupTypesSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/microlender/LookupTypesSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/personal-lender/LookupTypesSettings.yaml, src/LedgerTM.Seeding.Provisioning/tenant-templates/packages/retail-bank/BalanceGroupsSettings.yaml, src/ui-apps/bank/src/__tests__/features/accounts/generic/__snapshots__/account-panel-rails.characterization.test.ts.snap, src/ui-apps/bank/src/__tests__/features/accounts/generic/overdraft-tiles.test.tsx, src/ui-apps/bank/src/__tests__/features/accounts/tenant-template-icons.test.ts, src/ui-apps/bank/src/features/accounts/generic/overdraft-tiles.tsx, src/ui-apps/bank/src/lib/api.ts, src/ui-apps/bank/ui-review/adr-uat/flows/adr-837-server-probe.ts
Land batches
One land, the whole ADR; reseed: true. Every bite starts after ADR-836 and ADR-837 have landed
(F1): the type’s YAML names their integrations, direction and symbols.
Notes
- Signs on an asset-nature type. A Debit raises what the customer owes;
PurchaseBalancereads +12 000 after a 12 000 purchase; a credit toUnallocatedPaymentreads negative, so the drains readabs(UnallocatedPayment).Outstandingcarries a leg on every balance-moving type so the wire sees one figure. - The due-date sequence is by the generated types’ sequence numbers within the
EndOfDaybucket: the four accruals, the catch-up, the deferred resets, the grace status, the late fee, the arrears raise. The close sequence: the over-limit fee (where the cell has it), the capitalisations, the close, the amount due, the minimum, the statement purchases and deferred interest set from the cycle’s, the cycle resets. - A card hold reserves nothing on the facility (ADR-837 F24); a frozen facility or none at
all declines a tap as
InsufficientFunds, since the available reads 0. - Fixtures. The
CreditCardrow is loaded from the composed za-retail template with its rate types, prices, lookups and regulatory limits, the pattern ADR-837’s tests use; the facility is granted withGrantFacilityCommandfor typeCreditCard; a payment arrives asProcessBankDepositCommandand runs thereceive-paymentworkflow; a purchase as ADR-836’sProcessCardPurchaseCommandwith an MCC; balances for a Given are arranged by posting the types directly, which runs no workflow. - Days past due is read from the
AgedDebtorstream’sDaysPastDue(asOf)or throughIArrearsReader, polled on the forwarded-event cascade (F30). - A scheme
Reversalof a cash advance runs the refund branch for the cash category and refunds the advance; the fee stands. - The statement document is the scheduled statement as issued today; “amount due by date” as a printed line is the Statements feature’s to add, recorded in the ADR’s Consequences.
- The guide article names NCA §8(3) and §101 and their register rows, the
Raisewire and the deferred-interest convention in every worked example, and lifts its numbers fromCreditCardInterestFreeTests.
Changed during the plan grill
Phase A (27 questions) and the plan grill (14 press points) ran 2026-10-02; the operator’s
standing instruction was to take the recommendations. F6–F20 record what moved. The two
largest: allocation is the payment workflow’s steps, because a triggered row runs only inside
the day-walk (grill 1); and the catch-up is deferred interest accrued daily into memorandum
positions, because a history-replaying function could not be reproduced by a re-walk (grill 2),
which also removed positionDays, daysBetween and the schedule-occurrence dates from the ADR.
Also moved: the activation check binds the rate lookup and the regime ceiling binds on a named
rate (grill 7, 8; ADR-837 meets both first); Excess is computed from the wired position at
ADR-837’s three sites (grill 11); the arrears raise is one two-legged transaction (grill 10);
fee categories are Fee (grill 9); Outstanding sits in its own balance group and every new
row has a master row (grill 13); the due date leaves the header (grill 13); every bite waits for
ADR-836 and ADR-837 (grill 12). Held: the Outstanding roll-up over a list of positions, the
credit card type’s shape, the Reg 42 row’s placeholder citation.
Phase B (five authors, 2026-10-02): F21–F30 — 302.46 by rounding; the current period’s
purchases in the catch-up, said plainly; a waiting credit is spendable and the cash branch drains
fees first; the annual fee a year after opening; the due figures fall by the whole payment and a
missed minimum joins the next; a close posts even at zero; the roll-up invariant validated at
load; a named rate that cannot be priced refuses activation; headline on the type’s binding;
the detail’s figure is the oracle’s under facilityHeadroom; days past due from the aged
debtor; twelve scenarios the authors wrote as unhappy paths join bites 1 to 5.
Landing notes
- Ruled (operator, 2026-10-02): late presentment value-dated at presentation · ruled: design
(F-1794). A clearing line whose transaction date falls on or before the account’s last
statement close posts value-dated the clearing business date, not the transaction date, so no
back-dated re-walk reaches the due-date rows; ADR-836’s post step reads the close date it
needs from the account. ADR-840’s
KeepHigheron the grace row still holds: a dispute credit back-dated to the purchase can only lower what was due, so it restores grace or leaves it, and nothing back-dated can now take it away. - F1:
AccountAvailabilityReader,FacilitySymbolResolver, theExcesssites and the card dispatch are ADR-836’s and ADR-837’s files; bite 1 edits them after both land. - F17: ADR-837’s overdraft rows read
rate('Overdraft', …), so its activation check hits the unbound rate lookup first; whichever lane lands first binds it and widensTryEvaluate. - Decided: the
facilityHeadroomlimit for aRaisewire isFacilityLimit(the facility’s amount less siblings’ draw; the amount while frozen), as ADR-837’s figure is · rests on: D2, one rule for both wires · wrong if:CreditCardViewerTestsreads a sibling-shared limit as the whole amount. - Decided: a type with no facility wire keeps reading
ExcessoffCurrentbelow zero, as before this ADR · rests on: D2 changes only wired types · wrong if: an unwired deposit’s guard reads a non-zeroExcess. - Decided: the roll-up’s members are the standard positions in a
HeadlineBalance-role group;UnallocatedPaymentandArrearscarry no group of that role, soPaymentand the arrears overlay need noOutstandingleg · rests on: D1, F10 · wrong if: bite 2’s YAML loads with a balance-moving type lacking itsOutstandingleg. - Decided: the grace bound is generic — a monthly schedule starting
addDays(…, property)whose property defaults to 28 or more is refused (PaymentGraceValidator) · rests on: D5 · wrong if: a type withpaymentGraceDays: 28loads. - Decided: the roll-up and grace scenario is a unit test,
RollUpWireValidatorTests— no authored file namedRollUpWireValidationTestsexists inADR-838-tests/· rests on: the scenario is a load-time refusal with no dispatch · wrong if: the land wants it as a component test. - Decided: a named rate is priced only when a ceiling resolves for the row; an unregulated card or an uncovered type never prices it · rests on: D8 “fails closed” where a ceiling binds · wrong if: an NCA card with an unfixed rate activates.
- F-1792: already fixed by ADR-837 bite 1 (9230cc3a2) —
TryEvaluatecatches the unbound lookup; bite 1 now also bindsratein the guard context when a provider is given. - Landing note (coordinator, 2026-10-03): ADR-784 (lane
studio-countersign) and ADR-838 (lanecards-authorisation) both touchsrc/LedgerTM.Accounts/Application/Queries/GetAccountDetail.cs,src/LedgerTM.Seeding.Provisioning/PackageExporter.csandsrc/ui-apps/bank/src/features/accounts/generic/generic-account-viewer.tsx. Built in parallel; the second to land resolves these three at its integrate step, with the land gate as the net. - Decided: the gb over-limit fee is not placed — a country cell cannot add a scheduled row to a package account type (
VocabularyMergerefuses a duplicateAccountTypesSettingskey, with no nested merge), so the package carries no over-limit row and gb carries no price for it · rests on: D8 “never in the package” · wrong if: a gb card in excess is charged an over-limit fee. Needs a nested merge ofscheduledTransactionsor a gb product row — a finding, not this ADR. - Decided: the card’s
priceListis required, as the loan types’ is — without a pricing planprice()reads 0 and the late, annual and cash-advance fees post nothing · rests on: D7 fees are price types · wrong if: a card opens without a price list. The authored tests’ arranges pass the za Standard list (pl…0002). - Decided: bite 2’s authored test opens the account’s books before activation, as ADR-837’s tests do —
POST /api/accountsopens none, and activation refusesBOOKS_NOT_OPEN· rests on: ADR-752 D2 · wrong if: the land’s suite shows a card activating without books. - Decided: the memorandum-only card types (statement figures, due reductions, grace status, arrears clearance) post Dr/Cr one memo GL,
1095 Credit cards — statement memorandum, so every postable type has a rule (PostingRuleCoverageTests) and the journal nets to zero · rests on: TransferIn’s same-account precedent · wrong if: a trial balance shows 1095 non-zero. - Decided:
btcFamily: LDAS/CSLN; purchasesPMNT/CCRD/POSC, cash advancesPMNT/CCRD/CWDL, refundsRIMB, allocationsprtry:ALOC· rests on: ISO 20022 BTC has no card family under LDAS · wrong if: a statement export rejects the codes. - Decided:
card-refundcomputes every leg from the balances before the refund — credit past what is refundable first, then the statement’s purchases, then the period’s — because a workflow step cannot read a previous step’s amount · rests on: D7, F14 · wrong if: a refund larger than the period’s purchases leavesPurchaseBalanceandStatementPurchasesdisagreeing. - Decided:
facility-typegainsCreditCardin every retail-family package, not retail-bank alone (PackageConformanceTests) · rests on: ADR-789 D8 · wrong if: none. - Decided: the deferred accrual rows are categorised
None, notInterest— deferred interest is not yet charged, so neither the in duplum accumulator nor the Reg 42 check should count it; the catch-up isInterest· rests on: D6 · wrong if: an in duplum total includes a forgiven deferral. - Decided: the due date’s
DeferredCycleInterestResetreadsAmountDue > 0alone, so it can share one sequence number (39) with the close’s reset and still run after the grace status changes · rests on: D6 — while revolving the deferred positions are already 0 · wrong if:a_statement_paid_in_full_keeps_the_interest_free_periodreads a reset cycle deferral. - Decided: bite 3’s authored fixture imports the template’s
NumberingSettings.yaml(the close issues a scheduled statement, which needs thestatementscheme) and passes the price list · rests on: the bite 2 test’s A1 · wrong if: none. - Decided: cash advance accrues from its transaction date (ADR-838 Context, ADR-837 D7) · ruled: wording (coordinator, 2026-10-03). A line dated a closed day re-walks it, so the transaction day is priced; the scenario line and the test’s TheDay assertion changed with it.
- Decided:
CreditCardAuthorisationTestscompares one day’s cash-advance accrual within 0.00005, not 0.000001 — amaximumPrecisionrow rounds to four decimals (F21) · rests on: F21 · wrong if: none. - Decided: the card post’s evaluation context carries the account’s price list and the line’s value date, so
price('card-cash-advance-fee', valueDate)prices (F-1799: every price row namesvalueDate); only the card doors bring a price list · rests on: D4, D7 · wrong if: a bank deposit’s workflow begins reading settlement defaults it never read before. - Decided: F-1794’s post step lives in
PostCardClearingBatch.cs(CardClearingPost.ValueDateAsync), readingIAccountStatementCloseReader— the last posting of a row on the type’sstatementSchedule· rests on: the F-1794 ruling · wrong if:LatePresentmentValueDatingTestsreds. - Decided: every sample account owner gets a
CreditCardaccount and a 20 000CreditCardfacility (the seeder opens each product for each owner); the demo customer also gets an activecreditplastic card on it · rests on: D9 · wrong if: a provisioned za-retail tenant’s demo customer holds no credit card. - Decided:
SampleCardsSeedTests(ADR-835’s) scope “one card” to thevirtual-debittype, and a new test reads the demo’s credit card · rests on: D9 adds a second card by design · wrong if: none. - Decided: the standards register gains the §8(3) credit facility row (ADR-837 had not added it) covering both the overdraft and the card, and the §101 permitted-charges row · rests on: D8 · wrong if: none.
- Landing note (coordinator, 2026-10-03): ADR-845 (lane
cashier-management) sharessrc/LedgerTM.Accounts/Application/Commands/ProcessExternalSourcePaymentHandlers.cswith ADR-838 (lanecards-authorisation). Built in parallel; the second to land resolves it at its integrate step.