Implemented KYB, compliance decisions, integration, and testing

This commit is contained in:
Oleksandr Prokhorenko
2026-09-24 21:31:42 +03:00
parent 382f6e8841
commit 1f8721e742
36 changed files with 2279 additions and 233 deletions
@@ -0,0 +1,7 @@
-- A new missing record is not evidence of collection. Historical rows/snapshots remain intact.
INSERT INTO "KybChecklistItem" ("id", "merchantId", "documentCode", "state", "updatedAt")
SELECT gen_random_uuid()::text, "id", 'AUTHORIZED_REPRESENTATIVE', 'MISSING', CURRENT_TIMESTAMP
FROM "Merchant" WHERE "status" NOT IN ('LIVE', 'REJECTED')
ON CONFLICT ("merchantId", "documentCode") DO NOTHING;
-- Invalidate any editor opened against the old policy; preserve company/stage timestamps.
UPDATE "Merchant" SET "version" = "version" + 1 WHERE "status" NOT IN ('LIVE', 'REJECTED');