feat: add acquisition API foundation
Quality / test (push) Canceled after 0s

Add acquisition persistence, cost-basis calculation, seller-scoped admin routes, contracts, validation, migration, and focused application/HTTP tests.
This commit is contained in:
2026-09-09 00:39:56 -04:00
parent 26405d4ace
commit eee8e1978f
14 changed files with 291 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
CREATE TABLE "acquisitions" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"inventory_item_id" uuid NOT NULL REFERENCES "inventory_items"("id"),
"method" text NOT NULL,
"cost_minor" integer NOT NULL,
"currency" text NOT NULL,
"date" text,
"source" text,
"location" text,
"shipping_minor" integer DEFAULT 0 NOT NULL,
"tax_minor" integer DEFAULT 0 NOT NULL,
"other_fees_minor" integer DEFAULT 0 NOT NULL,
"estimated_trade_value_minor" integer DEFAULT 0 NOT NULL,
"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 INDEX "acquisitions_inventory_item_id_index" ON "acquisitions" USING btree ("inventory_item_id");
+7
View File
@@ -99,6 +99,13 @@
"when": 1789718400000,
"tag": "0013_void_sales",
"breakpoints": true
},
{
"idx": 14,
"version": "7",
"when": 1789804800000,
"tag": "0014_acquisitions",
"breakpoints": true
}
]
}