Skip to content

Commit 9517bda

Browse files
feat(OUT-4005): add qb_payout_sync table schema and migration
New table stores the payout payload so a failed reconciliation can be rebuilt on resync. Amounts are integer cents, matching line_items. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e12f849 commit 9517bda

7 files changed

Lines changed: 1377 additions & 1 deletion

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TABLE "qb_payout_sync" (
2+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3+
"portal_id" varchar(255) NOT NULL,
4+
"payout_id" varchar(100) NOT NULL,
5+
"line_items" jsonb NOT NULL,
6+
"net_amount" integer NOT NULL,
7+
"fee_amount" integer NOT NULL,
8+
"arrival_date" integer NOT NULL,
9+
"qb_deposit_id" varchar(100),
10+
"created_at" timestamp DEFAULT now() NOT NULL,
11+
"updated_at" timestamp DEFAULT now() NOT NULL,
12+
"deleted_at" timestamp
13+
);
14+
--> statement-breakpoint
15+
CREATE UNIQUE INDEX "uq_qb_payout_sync_portal_payout_active" ON "qb_payout_sync" USING btree ("portal_id","payout_id") WHERE "qb_payout_sync"."deleted_at" is null;

0 commit comments

Comments
 (0)