Tier 1 critical correctness pass

Fixkamolos
Shipped
May 28, 2026 at 11:53 PM UTC
Author
Kamo
Commit
87da074

T1.1 Stripe disbursement strategy: TREASURY (stub — requires SDK upgrade or raw HTTP) / CONNECTED_ACCOUNT (Transfer.create — works in SDK 28.2.0) / MANUAL. Default CONNECTED_ACCOUNT via **************** **************** updated to new DisbursementRequest API. The previous Payout.create call was incorrect — Payouts go to the connected account's OWN bank, not a third party's. CONNECTED_ACCOUNT uses Transfer.create + relies on the borrower owning a connected Express account (lighter than Treasury onboarding). T1.2 Collision-resistant loan number generation: 6-char Crockford base32 suffix derived from nanoTime ⊕ ThreadLocalRandom, backed by the (org_id, loan_number) unique constraint with 5-attempt retry. Replaces **************** 1000000) which collided ~0.01% at 100k loans/year. T1.3 Paged cron queries — no more findAll().stream().filter(): - **************** paged 500/batch via **************** and findByStatusAndKind - **************** paged 500/batch - ReconciliationJob: paged by status, per-batch @Transactional - **************** paged via **************** - InterestAccrualJob: paged by status, per-batch @Transactional - YearEndTaxJob: paged via **************** T1.4 LoanMetrics gauge uses loanRepository.countByStatus(s) instead of findByStatus(s).size() — O(1) COUNT(*) instead of full-table materialization on every Prometheus scrape. T1.5 **************** no longer accepts null email/name. Fetches Member via memberRepository + extracts getNameFirst/getNameLast + reflectively reads the email list (defensive against EmbEmail shape across shared-lib versions). Customers now created with real contact details. T1.6 markDisbursementSucceeded handles LOC. For REVOLVING_LOC the line opens with currentBalance = 0 + principalBalance = 0; balance only grows via LoanDraw. INSTALLMENT path unchanged. lastAccrualDate set to today for both kinds. T1.7 **************** now sums every scheduled payment from **************** per Reg Z Appendix J. financeCharge correctly subtracts the amount-financed (principal − origination fee) per §1026.18(b). Replaces the 1.10× placeholder that produced incorrect federal disclosures. T1.8 lastAccrualDate threaded through accrual + payoff quote: InterestAccrualJob.accrueBatch reads Loan.lastAccrualDate, computes days-since (capped at 30 for sanity), accrues N days, then updates lastAccrualDate to today. **************** does the same for payoff-quote precision. T1.9 HMAC-sign proxy headers: new ProxyHmacFilter validates **************** LOS_PROXY_HMAC_SECRET) with ±60s timestamp skew. Webhooks + actuator bypass. Disabled by default for local dev; production sets los.proxy-hmac.enabled=true + a strong shared secret (also referenced as env var in configmap). SecurityConfig wires the filter before **************** and adds HSTS + frameOptions(DENY) + contentTypeOptions security headers. T1.10 ReconciliationJob drift guard: if |cached − ledger| > $1000, logs + emits STATE_RULE_VIOLATION_DETECTED audit and DOES NOT correct (manual intervention required). Below threshold, silently corrects. Prevents reconciliation from "fixing" to a corrupt ledger. All 30 unit tests pass.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing