feat: complete inventory image and sales workflows
Quality / test (push) Canceled after 0s

Commit the working vertical slices for inventory image processing and the Sale workflow, including Sale history, audited voiding, multi-item persistence, admin UI, migrations, documentation, and tests.
This commit is contained in:
2026-09-09 00:35:57 -04:00
parent ea145191df
commit 8e5ce80196
32 changed files with 1092 additions and 226 deletions
+30
View File
@@ -0,0 +1,30 @@
CREATE TABLE "sales" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"seller_id" uuid NOT NULL REFERENCES "sellers"("id"),
"sale_date" text NOT NULL,
"sale_location" text,
"sold_price_minor" integer NOT NULL,
"currency" text NOT NULL,
"platform_fees_minor" integer DEFAULT 0 NOT NULL,
"payment_processing_fees_minor" integer DEFAULT 0 NOT NULL,
"shipping_cost_minor" integer DEFAULT 0 NOT NULL,
"taxes_minor" integer DEFAULT 0 NOT NULL,
"other_fees_minor" integer DEFAULT 0 NOT NULL,
"buyer_name" text,
"buyer_contact" text,
"notes" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "sale_items" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"sale_id" uuid NOT NULL REFERENCES "sales"("id"),
"inventory_item_id" uuid NOT NULL REFERENCES "inventory_items"("id"),
"sold_price_minor" integer NOT NULL,
"cost_basis_minor" integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX "sale_items_inventory_item_id_unique" ON "sale_items" USING btree ("inventory_item_id");
--> statement-breakpoint
CREATE INDEX "sale_items_sale_id_index" ON "sale_items" USING btree ("sale_id");