P2 batch — observability, tests, year-end tax, real Stripe IDs

Featurekamolos
Shipped
May 28, 2026 at 9:37 PM UTC
Author
Kamo
Commit
a8c11bd

Observability: - micrometer-registry-prometheus on the classpath - /actuator/prometheus exposed via management config (both local + k8s configmap) - LoanMetrics service: **************** **************** los_charge_off_total, los_disbursement_total, los_loan_status_count{status} gauge, **************** histogram - Counters wired into LoanPaymentPostingService + LoanChargeOffService Math + tests: - 21 unit tests covering AmortizationEngine (level payment, APR Newton- Raphson, monthly due-date progression, principal+interest invariant, bad-input guards), InterestAccrualEngine (ACT_365 / ACT_360 DPR, one-day / thirty-day accrual, LOC ADB), PaymentAllocator (fees→interest →principal order, partials, overpayment, nulls) - **Fixes 100x interest-rate bug** in **************** — divisor was 36500/36000 instead of 3,650,000/3,600,000 (annualRate fraction needs both /10000 bps→fraction AND /365 days), so accrued interest was 100× too high. Test added that would have caught it. Real Stripe identifiers (no more placeholders): - StripeConnectController.onboard now persists LoanOrgStripeConnect on successful Stripe Account creation; .status returns onboarding state - New StripeIdResolver: connectedAccountIdForOrg() + lazy getOrCreateBorrowerCustomerId() (idempotency-keyed Customer.create under the connected account, persists to Loan.stripeCustomerId) - AutoDebitRunJob.fireAchDebit + .fireDisbursement now resolve real IDs through StripeIdResolver instead of "acct_placeholder_*" Reminder cadence: - ReminderSchedulingJob: nightly sweep emits PAYMENT_DUE_3_DAYS, PAYMENT_DUE_TODAY, PAYMENT_LATE_DAY_1/5/15, OFFER_EXPIRING (24h before expiresAt), STATEMENT_AVAILABLE (on generation). Dedup-keyed via **************** so reruns are idempotent. Year-end tax: - YearEndTaxJob (cron 06:00 Jan 5): produces 1099-C for charge-offs ≥$600 + 1099-INT for borrower-credit interest > $10. PDFBox-rendered form, stored to MediaService, recorded as LoanDisclosure with form/year metadata so reruns are idempotent. - Loan.tax1099CEligible auto-set on charge-off confirm when amount ≥ $600

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