feat: improve commerce checkout flow

This commit is contained in:
Codex
2026-06-29 02:44:28 +08:00
parent 9122bb0829
commit c767b87c6f
15 changed files with 1214 additions and 72 deletions

View File

@@ -0,0 +1,13 @@
create unique index if not exists idx_coupon_redemptions_user_coupon_once
on public.coupon_redemptions(tenant_id, user_id, coupon_id)
where coupon_id is not null;
create index if not exists idx_coupon_redemptions_order_user
on public.coupon_redemptions(tenant_id, order_id, user_id)
where order_id is not null;
create index if not exists idx_payments_order_updated
on public.payments(tenant_id, order_id, updated_at desc);
create index if not exists idx_order_items_order
on public.order_items(tenant_id, order_id);