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
@@ -242,6 +242,25 @@ export const inventoryItems = pgTable('inventory_items', {
...timestamps,
});
export const acquisitions = pgTable('acquisitions', {
id: uuid('id').defaultRandom().primaryKey(),
inventoryItemId: uuid('inventory_item_id')
.notNull()
.references(() => inventoryItems.id),
method: text('method').notNull(),
costMinor: integer('cost_minor').notNull(),
currency: text('currency').notNull(),
date: text('date'),
source: text('source'),
location: text('location'),
shippingMinor: integer('shipping_minor').default(0).notNull(),
taxMinor: integer('tax_minor').default(0).notNull(),
otherFeesMinor: integer('other_fees_minor').default(0).notNull(),
estimatedTradeValueMinor: integer('estimated_trade_value_minor').default(0).notNull(),
notes: text('notes'),
...timestamps,
});
export const inventoryImages = pgTable(
'inventory_images',
{