Repository navigation
docs: financial architecture simplification audit - #241
Conversation
Audit of the Stripe/QBO/Ollie payment and reconciliation stack: inventory, flow traces, overengineering findings, native alternatives, and a keep/simplify/replace/remove plan. Investigation only — no code or accounting behavior changes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
Comment |
Reviewer's GuideThis documentation-only PR audits the financial architecture and recommends retaining payment settlement, QBO Sales Receipt sync, and observe-mode payout reporting while retiring the dormant payout execution path and simplifying related reconciliation and matching infrastructure after owner/accountant review. Sequence diagram for the live DDB payment settlement pathsequenceDiagram
actor Staff
participant PaymentsAdmin as payments-admin.ts
participant Stripe
participant Webhook as Stripe webhook
participant Firestore
participant QBO
Staff->>PaymentsAdmin: createAdminPayment
PaymentsAdmin->>Firestore: Create payment and event
PaymentsAdmin->>Stripe: Create Checkout Session
Stripe-->>Webhook: checkout.session.completed
Webhook->>Stripe: Canonical session re-fetch
Webhook->>Firestore: Dedupe, settle payment, enqueue qboSyncRecords
Webhook->>QBO: postPaidPaymentToQbo
QBO-->>Webhook: SalesReceipt result
Webhook->>Firestore: Record sync status
Sequence diagram for observe-only Stripe payout analysissequenceDiagram
participant Stripe
participant Webhook as Stripe webhook
participant Ledger as processStripePayoutLedger
participant QBO
participant Firestore
actor Accountant
Stripe-->>Webhook: payout.*
Webhook->>Stripe: Canonical payout fetch
Webhook->>Firestore: Record stripePayouts/{id}
Webhook->>Ledger: processStripePayoutLedger
Ledger->>Stripe: Fetch balance transactions
Ledger->>QBO: Scan Undeposited Funds payments
Ledger->>Firestore: Persist accounting proposals and exceptions
Accountant->>Firestore: Review read-only payout worklist
Flow diagram for the proposed simplified financial architectureflowchart TD
Payment[DDB payment] --> Receipt[QBO Sales Receipt sync]
OllieTxn[Ollie transaction] --> UF[QBO Undeposited Funds]
Payout[Stripe payout] --> Report[Observe-only ledger and exception report]
Receipt --> QBO[QuickBooks Online]
UF --> Close[Human monthly close]
Report --> Close
Close --> QBO
Executor[Dormant payout executor] -.->|Retire| Removed[No app-executed payout writes]
Removed --> Close
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The owner clarified that automatic Stripe payout accounting is a mandatory business requirement, so the original "retire the dormant executor / manual monthly journals" recommendation is rescinded. Sections 6-12 are revised to a commissioning plan: keep and validate the proposal/executor machinery through an approval-mode pilot, enable automatic mode on a cutover boundary, and simplify only what weakens nothing (QBO webhook dead path, recon consolidation after activation). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Exec summary, F1/F3/F4 verdicts, the bank-feed alternative, and the Ollie UF-vs-clearing section still argued for manual posting as the target. Reframe them under the mandatory-automation requirement: the executor and verified-tier matching are load-bearing safety controls, bank-feed match is the exception fallback, and UF-native is an accountant decision that would be new build rather than simplification. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Read-only audit of the Stripe / QuickBooks Online / Ollie POS payment, payout, and reconciliation infrastructure. No code changes — this adds one document:
docs/architecture/financial-simplification-audit.mdCloses nothing directly; tracked under #240.
Changes
Verification
npm run check:md-links— all links resolvetsc/lint/testunaffected (CI will confirm).Risk / deployment notes
None — documentation only. No env, rules, or behavior changes. Do not merge until the owner reviews findings and the #240 decision list.
Generated with Devin
Summary by Sourcery
Document the financial architecture audit and define a gated path to commission automated payout accounting while identifying dead and duplicative infrastructure for later simplification.
Enhancements:
Documentation:
Summary by CodeRabbit