Add acquisition persistence, cost-basis calculation, seller-scoped admin routes, contracts, validation, migration, and focused application/HTTP tests.
This commit is contained in:
@@ -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',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user