Backend:
- Surface a default retail price per code on the public partner-store
payload (config qr.default_retail_price_per_code_centavos, env
QR_DEFAULT_RETAIL_PRICE_PER_CODE_CENTAVOS, default ₱10 = 1000c).
Per-store overrides can come later — the LGU sets one official price
for now.
- Resident-facing flow uses the existing ManualPaymentDriver: resident
POSTs /me/payments/code-purchase, payment is created in pending,
admin marks it paid via /admin/payments/{uuid}/mark-paid, fulfillment
runs StoreOperations::sellToHousehold which activates the codes +
fires the CodesPurchased notification.
Frontend (customer-web/):
- /stores — list nearby partner stores (1/2/5/10/25 km radius pills),
shows in-stock pill + price + distance, links into purchase page
only when has_stock.
- /stores/[uuid] — store detail with stat row (price / stock /
distance) and PurchaseForm: quantity presets (5/10/20/50) + custom
input clamped to inventory, live total computation, blue "cash
payment" callout explaining the flow.
- /payments/[uuid] — three states:
- Pending: ticket-style card with reference + amount + 4-step
instructions; auto-polls every 8 s until paid.
- Paid: success card with checkmark + paid_at timestamp + link
to /codes.
- Failed/refunded: red card with retry CTA back to /stores.
- Resident nav adds "Buy codes" link.
- API client: PartnerStore now carries retail_price_per_code_centavos;
Payment + PaymentStatus types added; payments.show() returns the
typed status union.
Build: 21 routes, all type-check + lint clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.3 KiB
1.3 KiB