Files
apskel-pos-backend/internal/processor
efrilmandClaude Opus 5.5 0c4dd72583 feat(loyalty): one-time EnakPoint payment code
Adds POST /customer/wallet/payment-code (docs/prd-point-coin.md F9, K8,
PC-304). The customer approves with their PIN on their own phone and gets a
6-digit code, as digits and as a QR payload (enakpoint:<code>) for the app
to render, valid for two minutes. The PIN is never typed at the cashier.

Codes are drawn from crypto/rand and stored in Redis with SET NX and a TTL,
bound to the customer; a new code retires the previous one. Redeeming is a
single Lua step that uses the code up only if it belongs to the order's
customer, so it stays one-time under a race, and a cashier scanning it
against the wrong order does not burn it for its owner, which a plain
GETDEL would. Expired, used, unknown and other customers' codes are all
refused alike.

Tests run against miniredis, added as a test dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 11:37:20 +07:00
..
Fix
2025-09-12 15:41:08 +07:00
2026-08-11 22:41:10 +07:00
2026-08-05 19:28:38 +07:00
2026-08-13 14:38:28 +07:00
2026-08-13 14:38:28 +07:00
2025-09-12 16:37:16 +07:00
2025-09-18 12:01:20 +07:00
2026-08-13 14:38:28 +07:00
2026-08-13 14:38:28 +07:00
2026-06-03 14:56:27 +07:00
2025-09-18 13:39:37 +07:00
2025-09-17 19:30:17 +07:00
2026-05-10 10:57:38 +07:00
2026-09-30 11:20:29 +07:00
2026-04-20 12:31:33 +07:00
2026-08-13 14:38:28 +07:00
2025-09-17 23:55:11 +07:00
2026-05-10 14:52:02 +07:00
2026-08-13 14:38:28 +07:00
2025-09-17 19:30:17 +07:00
2025-09-12 15:37:19 +07:00
2026-05-10 10:42:09 +07:00