Files
apskel-pos-backend/migrations
efrilmandClaude Opus 5.5 84401cc708 feat(wallet): add wallet, ledger and lot tables
Migration 000090 creates customer_wallets, wallet_transactions, wallet_lots
and wallet_lot_allocations as specified in docs/prd-point-coin.md §8 (PC-101).

The CHECK constraints enforce K5 at the database: every ledger row names its
source or destination, PAYMENT and the other point-only types cannot carry
COIN, transfers need a counterparty, reversals need the row they reverse,
adjustments need an admin and a reason, and EXPIRE must point at a lot.
Balances and lot remainders cannot go negative, and a lot cannot hold more
than it was created with.

Beyond §8, adds idx_wallet_lot_allocations_lot_id: the primary key cannot
serve lookups by lot, which the reconciliation job needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 01:01:01 +07:00
..
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-18 20:10:29 +07:00
2025-07-30 23:18:20 +07:00
2025-07-30 23:18:20 +07:00