Document till money-safety model, nonce retry design, and verified customer_id assumption
Adds critical_payment_log to the admin_notification_reason enum (fresh installs + ALTER TYPE for existing deploys); corrects the README's false cash-with-change claim; updates Gap Backlog T14 with the scan job stopgap; documents the till flow's clawback/cash-reconciliation model in the Technical Manual; records the frontend's re-tokenize-on-failure design in P11; and marks the P14 customer_id assumption VERIFIED (Square runtime enforces it per its SDK maintainer; only the OpenAPI schema stays ambiguous, so the P12 sandbox test remains the definitive live check).
This commit is contained in:
@@ -837,7 +837,17 @@ INSERT INTO business_settings (
|
||||
'https://www.website.co.uk'
|
||||
);
|
||||
|
||||
CREATE TYPE admin_notification_reason AS ENUM ('pending_booking', 'cancelled_booking', 'rescheduled_booking', '1_week_no_pay', '1_month_no_pay', 'affiliate_claim', 'late_cancellation', 'deposit_paid', 'edit_request', 'edit_requested', 'new_booking', 'deposit_not_paid_by_deadline', 'gift_card_purchased_for_friend', 'default_hours_changed', 'refund_failed');
|
||||
-- 'critical_payment_log' surfaces unresolved money events (stale pending
|
||||
-- payments/till sales, refunds at the retry cap) in the admin notification
|
||||
-- centre — the DB-backed stand-in for the un-watched CRITICAL payment logs.
|
||||
-- Fresh installs get it from the CREATE TYPE below; existing deployments must
|
||||
-- apply the ALTER TYPE after it (NOTE: ALTER TYPE ... ADD VALUE cannot run
|
||||
-- inside a transaction block — run on a connection with autocommit). The
|
||||
-- value is a no-op here on fresh installs (it is already in the CREATE TYPE).
|
||||
CREATE TYPE admin_notification_reason AS ENUM ('pending_booking', 'cancelled_booking', 'rescheduled_booking', '1_week_no_pay', '1_month_no_pay', 'affiliate_claim', 'late_cancellation', 'deposit_paid', 'edit_request', 'edit_requested', 'new_booking', 'deposit_not_paid_by_deadline', 'gift_card_purchased_for_friend', 'default_hours_changed', 'refund_failed', 'critical_payment_log');
|
||||
|
||||
-- Existing-deployment migration for the value added to the CREATE TYPE above.
|
||||
ALTER TYPE admin_notification_reason ADD VALUE IF NOT EXISTS 'critical_payment_log';
|
||||
|
||||
CREATE TABLE admin_notifications (
|
||||
id CHAR(12) PRIMARY KEY DEFAULT generate_admin_notifications_id(),
|
||||
|
||||
Reference in New Issue
Block a user