Add scheduled invoice delivery

This commit is contained in:
2026-08-17 13:54:45 -04:00
parent 29589c1f32
commit 67ab6b78bd
26 changed files with 2099 additions and 835 deletions
@@ -0,0 +1,23 @@
ALTER TABLE "beenvoice_invoice" ADD COLUMN IF NOT EXISTS "sentAt" timestamp with time zone;
--> statement-breakpoint
ALTER TABLE "beenvoice_invoice" ADD COLUMN IF NOT EXISTS "scheduledSendAt" timestamp with time zone;
--> statement-breakpoint
ALTER TABLE "beenvoice_invoice" ADD COLUMN IF NOT EXISTS "scheduledSendTimeZone" varchar(100);
--> statement-breakpoint
ALTER TABLE "beenvoice_invoice" ADD COLUMN IF NOT EXISTS "scheduledSendJobId" varchar(255);
--> statement-breakpoint
ALTER TABLE "beenvoice_invoice" ADD COLUMN IF NOT EXISTS "scheduledSendStatus" varchar(20);
--> statement-breakpoint
ALTER TABLE "beenvoice_background_job" ALTER COLUMN "runAt" TYPE timestamp with time zone USING "runAt" AT TIME ZONE 'UTC';
--> statement-breakpoint
ALTER TABLE "beenvoice_background_job" ALTER COLUMN "lockedAt" TYPE timestamp with time zone USING "lockedAt" AT TIME ZONE 'UTC';
--> statement-breakpoint
ALTER TABLE "beenvoice_background_job" ALTER COLUMN "completedAt" TYPE timestamp with time zone USING "completedAt" AT TIME ZONE 'UTC';
--> statement-breakpoint
ALTER TABLE "beenvoice_background_job" ALTER COLUMN "createdAt" TYPE timestamp with time zone USING "createdAt" AT TIME ZONE 'UTC';
--> statement-breakpoint
ALTER TABLE "beenvoice_background_job" ALTER COLUMN "updatedAt" TYPE timestamp with time zone USING "updatedAt" AT TIME ZONE 'UTC';
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "invoice_scheduled_send_at_idx" ON "beenvoice_invoice" USING btree ("scheduledSendAt");
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "invoice_scheduled_send_job_idx" ON "beenvoice_invoice" USING btree ("scheduledSendJobId");