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