Full-codebase-audit 2026-05-30 outputs: - Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md - 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer). - Scanner docs from scratch (was zero): architecture, data model, API ref, payment flow, operations runbook + repo README. - Doc-sync updates across API reference, data models, flows, design system. - Secret Rotation Runbook (08 - Operations) for the exposed credentials. - Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js. Issues remain status:open intentionally — the code fixes are uncommitted-then-committed working-tree changes per repo and aren't "resolved" until merged/deployed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
1.6 KiB
Markdown
40 lines
1.6 KiB
Markdown
---
|
|
issue: 066
|
|
title: "Backend: payout/confirm and release/confirm need canonical terminal status — DEC-32"
|
|
severity: high
|
|
domain: Payment
|
|
labels: [bug, backend, state-machine]
|
|
status: open
|
|
created: 2026-05-30
|
|
source: Full Codebase Audit 2026-05-30
|
|
---
|
|
|
|
# Backend: payout/confirm and release/confirm need canonical terminal status — DEC-32
|
|
|
|
**Severity:** high
|
|
**Domain:** Payment
|
|
**Labels:** bug, backend, state-machine
|
|
|
|
## Description
|
|
|
|
NB-29 was applied as an interim fix (setting `status:'completed'`), but the correct terminal status for a released/paid-out payment has not been decided. The enum currently has no `'released'` value. Until DEC-32 is resolved, the interim `'completed'` value may be incorrect for payments that need to be distinguished from non-released completions.
|
|
|
|
## Options
|
|
|
|
1. Add `'released'` to the Payment status enum and update all status-dependent logic (dashboards, filters, cleanup).
|
|
2. Map release/payout to the existing `'completed'` status plus a separate `releasedAt`/payout flag.
|
|
3. Introduce a dedicated escrow/payout sub-state field instead of overloading `status`.
|
|
|
|
## Recommendation
|
|
|
|
Decide the canonical representation (likely add `'released'` to the enum or a dedicated payout state) and update dashboards/filters consistently. The NB-29 interim fix uses `'completed'` — verify this does not cause dashboard overcounting or misclassification.
|
|
|
|
## Affected Files
|
|
|
|
- `backend/src/services/payment/requestNetwork/requestNetworkRoutes.ts:526`
|
|
- `backend/src/models/Payment.ts` — enum definition
|
|
|
|
## References
|
|
|
|
- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-32
|