Files
Verde-Web/config/qr.php
admin e84444a56b feat(customer-web): Phase 4 — buy QR codes (cash flow)
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>
2026-05-01 20:23:58 +08:00

28 lines
936 B
PHP

<?php
return [
/*
| How many free QR codes a verified household receives.
*/
'free_allocation_per_household' => (int) env('QR_FREE_ALLOCATION_PER_HOUSEHOLD', 10),
/*
| When a household's active code count drops to or below this number,
| a QrBalanceLow event fires (notification listeners hook off it).
*/
'low_balance_threshold' => (int) env('QR_LOW_BALANCE_THRESHOLD', 5),
/*
| Default expiry for a generated batch (months from creation). Null
| means no expiry.
*/
'default_batch_expiry_months' => env('QR_DEFAULT_BATCH_EXPIRY_MONTHS', null),
/*
| Default retail price per QR code (in centavos) shown to residents on
| the partner-store browse + purchase pages. The LGU sets one official
| price; per-store overrides aren't modeled yet.
*/
'default_retail_price_per_code_centavos' => (int) env('QR_DEFAULT_RETAIL_PRICE_PER_CODE_CENTAVOS', 1000),
];