feat: persist pricing refresh jobs
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-09 11:53:14 -04:00
parent 39b4aab058
commit 409d2cd0ca
9 changed files with 136 additions and 5 deletions
@@ -0,0 +1,16 @@
CREATE TABLE "pricing_refresh_jobs" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"seller_id" uuid NOT NULL REFERENCES "sellers"("id"),
"inventory_item_id" uuid NOT NULL REFERENCES "inventory_items"("id"),
"product_id" uuid NOT NULL REFERENCES "products"("id"),
"condition_id" uuid NOT NULL REFERENCES "conditions"("id"),
"provider_id" text NOT NULL,
"status" text DEFAULT 'PENDING' NOT NULL,
"observations" jsonb DEFAULT '[]'::jsonb NOT NULL,
"valuation" jsonb,
"error" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE INDEX "pricing_refresh_jobs_status_created_at_index" ON "pricing_refresh_jobs" USING btree ("status", "created_at");