OUT-4006: land payout test suite + shared test infra#268
OUT-4006: land payout test suite + shared test infra#268SandipBajracharya wants to merge 5 commits into
Conversation
Mock QB_ACCOUNT_COLUMNS on the intuitAPI mock, add createDeposit and account-status (getAnAccount/updateAccount) mocks, and seed TEST_BANK_ACCOUNT_REF on the portal connection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Happy path plus abort guards (refund line, negative fee, sum mismatch, duplicate/empty/unresolved line items), idempotent redelivery, flag-off no-op, inactive/deleted bank account, claim idempotency, and invoice->QBO-payment resolution. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
payment.succeeded creates no per-payment deposit in batched mode; stale PENDING payout claims flip to non-retryable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…uest schema Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@greptileai review |
Greptile SummaryAdds shared integration-test infrastructure and broad coverage for payout reconciliation, bank-deposit settings, stale payout claims, and token propagation.
Confidence Score: 5/5The test-only pull request appears safe to merge, with no concrete defects identified in the added coverage or shared test infrastructure. The new fixtures and mocks align with their production contracts, and the added tests consistently isolate database state while exercising the intended payout, settings, and token paths. Important Files Changed
Reviews (1): Last reviewed commit: "test(OUT-4003): cover bank-account listi..." | Re-trigger Greptile |
Greptile SummaryAdds shared test infrastructure and comprehensive coverage for payout reconciliation.
Confidence Score: 5/5The PR appears safe to merge, with no actionable defects identified in the added test infrastructure or coverage. The new fixtures match the payout schema, the integration suite is configured for sequential shared-database execution with per-test cleanup, and the mock additions match the production exports and APIs exercised by these tests. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Payout reconciliation webhook] --> B{Bank-deposit mode enabled?}
B -- No --> C[No-op]
B -- Yes --> D{Payload and account valid?}
D -- No --> E[Record terminal failure]
D -- Yes --> F[Resolve invoice payment IDs]
F --> G{All lines resolved and totals valid?}
G -- No --> E
G -- Yes --> H[Create one QuickBooks deposit]
H --> I[Record payout success]
I --> J[Ignore duplicate delivery]
Reviews (2): Last reviewed commit: "test(OUT-4003): cover bank-account listi..." | Re-trigger Greptile |
Adds integration + unit coverage for the bank-deposit payout flow so CI exercises it, plus the shared test infra those tests depend on. Test-only — no source changes.
Shared test infra
test/integration/setup.ts— mockQB_ACCOUNT_COLUMNSon the@/utils/intuitAPImocktest/helpers/mocks.ts—createDeposit+ account-status (getAnAccount/updateAccount) mockstest/helpers/seed.ts—TEST_BANK_ACCOUNT_REF+ bank-account seeding on the portal connectionTests
payoutReconciliation/— happy path + abort guards (refund line, negative fee, sum mismatch, duplicate/empty/unresolved line items), idempotent redelivery, flag-off no-op, inactive/deleted bank account, claim idempotency, invoice→QBO-payment resolutionpaymentSucceeded/bankDepositFlagNoOp.test.ts—payment.succeededcreates no per-payment deposit in batched modesyncLog/staleReaperPayoutTerminal.test.ts— stale PENDING payout claims flip to non-retryableunit/utils/tokenRefresh.test.ts—bankAccountRefcarried on every token pathunit/type/settingRequestSchema.test.ts+setting/— bank-account listing, invoice settings, request schema (OUT-4003)test/fixtures/payout.webhook.ts— payout webhook fixtureExcludes the local
captureWebhookEventGETharness (webhook/route.ts,webhook/webhook.controller.ts) — a dev-only manual testing aid.🤖 Generated with Claude Code