Files
nick-doc/Issues/ISSUE-073-backend-payment-provider-enum-missing-shkeeper.md
Siavash Sameni dceaf82934 audit: 2026-05-30 full-codebase audit — report, issues, docs, runbooks
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>
2026-05-30 18:48:04 +04:00

40 lines
1.3 KiB
Markdown

---
issue: 073
title: "Backend: Payment provider enum missing 'shkeeper' — records silently dropped"
severity: high
domain: Payment
labels: [bug, backend, data-model]
status: open
created: 2026-05-30
source: Full Codebase Audit 2026-05-30
---
# Backend: Payment provider enum missing 'shkeeper' — records silently dropped
**Severity:** high
**Domain:** Payment
**Labels:** bug, backend, data-model
## Description
`backend/src/models/Payment.ts:46` defines the `provider` enum without including `'shkeeper'`. Any Payment document saved with `provider: 'shkeeper'` will fail Mongoose validation or be silently dropped. All downstream `Payment.find({provider: 'shkeeper'})` filters also return empty results.
## Options
1. Add `'shkeeper'` to the enum and audit all provider filters/migrations.
2. Migrate existing shkeeper records and standardize the provider taxonomy.
3. Add enum value plus a data migration to repair any silently-dropped values.
## Recommendation
Add `'shkeeper'` to the enum AND run a data audit/migration to repair records and verify every `Payment.find({provider})` filter.
## Affected Files
- `backend/src/models/Payment.ts:46`
- All `Payment.find({ provider: ... })` call sites
## References
- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-30