Skip to content

test(finance): union of the finance train for deploy-preview verification — DO NOT MERGE - #1422

Closed
teetangh wants to merge 6 commits into
devfrom
test/finance-union
Closed

test(finance): union of the finance train for deploy-preview verification — DO NOT MERGE#1422
teetangh wants to merge 6 commits into
devfrom
test/finance-union

Conversation

@teetangh

@teetangh teetangh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for familiarise ready!

Name Link
🔨 Latest commit ff7cf5d
🔍 Latest deploy log https://app.netlify.com/projects/familiarise/deploys/6a9bd2c57b7bf200082f1b75
😎 Deploy Preview https://deploy-preview-1422--familiarise.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 39 (🔴 down 14 from production)
Accessibility: 90 (no change from production)
Best Practices: 83 (no change from production)
SEO: 90 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (3)
  • WIP
  • [skip review]
  • DO NOT MERGE

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Essentials

Run ID: f25eeafd-ab15-4856-8b3f-d398fa22168d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

teetangh and others added 6 commits September 5, 2026 08:55
…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
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@teetangh

teetangh commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

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).

@teetangh teetangh closed this Sep 5, 2026
@teetangh
teetangh deleted the test/finance-union branch September 5, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant