test(finance): union of the finance train for deploy-preview verification — DO NOT MERGE - #1422
test(finance): union of the finance train for deploy-preview verification — DO NOT MERGE#1422teetangh wants to merge 6 commits into
Conversation
✅ Deploy Preview for familiarise ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
58fa905 to
e03ac71
Compare
a5af00f to
cc0d1fc
Compare
cc0d1fc to
f62cf9e
Compare
…t the reconciler loads
`@react-pdf/renderer` is in Next's built-in server-externals list, so the
deployed function loads it — and `@react-pdf/reconciler` with it — through
Node. That reconciler picks one of three bundled reconcilers by reading
`React.version`, lands on this project's userland React 18.3.1, and
reconciler-23 accepts only elements stamped `Symbol.for("react.element")`.
Route-handler code is compiled in the `rsc` layer against Next's vendored
React 19.2, which stamps `Symbol.for("react.transitional.element")`. Every
element therefore reached the reconciler as an unrecognised object and all
four statutory PDF routes answered 500 with React error #31.
A `@jsxImportSource` pragma routes element creation in lib/pdf back through
the runtime Node resolves, so both sides of the external boundary share one
React. The tracer cannot see that require, so `react` is named explicitly for
the four PDF routes.
Closes #1468
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgadJydWEKkdhhzY58yiL7
…ng, and org earnings are released from hold (#1470, #1471) The ORG_PAYOUT posting read `netPayoutPaise` as if it were post-TDS. It is the pre-withholding host-org share; `amountPaise` is what the rail actually transfers. The old legs (Dr ORG_PAYABLE net+tds, Cr CASH net) balanced, so the write-time check and the nightly imbalance finding both accepted them while clearing the payable and crediting cash by exactly the withholding too much on every host-org payout, and `markOrgPayoutReversed` mirrored the same wrong shape so only a payout that stayed COMPLETED carried the overstatement. Completion and reversal now post the corrected legs under one shared assertion that `amountPaise + tdsAmountPaise === netPayoutPaise`, and they refuse to journal a guess when it fails: a SystemEvent plus a Sentry report raised from outside the transaction (a global-client write while a $transaction holds the only pooled connection deadlocks under PG_POOL_MAX=1), then a throw so the CAS rolls back for the at-least-once webhook and the stuck-payout sweep to re-drive. The #1354 TDS return input stops adding `tdsAmountPaise` on top of a figure that already includes it. The two schema columns now say which is pre- and post-withholding. Every scheduled release-earnings entry point imports the script, and the script touched only `consultantEarnings`, so `OrganizationEarnings` rows never left PENDING and a hosting organisation's retained share could never reach a payout batch (`createOrgPayoutBatch` selects READY only). The script now releases both tables, each in its own Serializable transaction with `status: PENDING` restated on the claim and its own copy of the ticker limit, oldest hold first, and the two counts are reported separately through the cleanup twin, the GitHub Actions outputs and the admin system-jobs runner. The dead dual implementation in earnings-service, which nothing called, is deleted with its barrel export. The reconciler's ORG_PAYOUT_TOTAL_MISMATCH check is scoped to the statuses where the earnings attachment is expected to hold. FAILED, REVERSED and CANCELLED payouts release their earnings back to READY with `orgPayoutId` cleared by design, so every one of them was being reported as drift. Closes #1470 Closes #1471 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgadJydWEKkdhhzY58yiL7
…me' and 'origin/fix/org-payout-rail-ledger-and-release' into test/finance-union
…w replay gate Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgadJydWEKkdhhzY58yiL7
f62cf9e to
ff7cf5d
Compare
|
|
The finance-train union preview is retired: every PR it carried has merged to dev and the train is released to prod via #1491 (release/dev-to-prod-2026-09-05). |




Throwaway union of #1385 #1386 #1389 #1390 #1391 #1392 #1393 #1414 so the money paths can be verified end to end on a Netlify deploy preview in Razorpay test mode (the local dev server exhausts the owner's RAM). Never merge this PR; it is closed once the train has merged. Part of #1421.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MgadJydWEKkdhhzY58yiL7