feat(loyalty-discount): implement loyalty and discount system

- Add discount campaign management and validation logic
- Update booking handlers with discount application flow
- Add customer relationship endpoints for loyalty tracking
- Update frontend modals (booking, approval, payment, reschedule)
- Add DiscountsManagement and loyalty reference documentation
- Update dev scripts and database init for discount tables
- Clean up completed plan files
This commit is contained in:
2026-06-04 23:13:02 +01:00
parent 79b23a3cf7
commit 6d4bc4d637
28 changed files with 2248 additions and 1461 deletions
+1 -2
View File
@@ -237,8 +237,7 @@ CREATE TABLE bookings (
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_by CHAR(12),
idempotency_key VARCHAR(64) UNIQUE,
discount_eligible BOOLEAN NOT NULL DEFAULT FALSE
idempotency_key VARCHAR(64) UNIQUE
);
CREATE INDEX idx_bookings_userid ON bookings(user_id);