Add acquisition persistence, cost-basis calculation, seller-scoped admin routes, contracts, validation, migration, and focused application/HTTP tests.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const createAcquisitionSchema = z.object({
|
||||
inventoryItemId: z.uuid(),
|
||||
method: z.string().trim().min(1).max(100),
|
||||
costMinor: z.int().nonnegative(),
|
||||
currency: z.string().trim().regex(/^[A-Za-z]{3}$/).optional(),
|
||||
date: z.string().trim().max(10).optional(),
|
||||
source: z.string().trim().max(255).optional(),
|
||||
location: z.string().trim().max(255).optional(),
|
||||
shippingMinor: z.int().nonnegative().optional(),
|
||||
taxMinor: z.int().nonnegative().optional(),
|
||||
otherFeesMinor: z.int().nonnegative().optional(),
|
||||
estimatedTradeValueMinor: z.int().nonnegative().optional(),
|
||||
notes: z.string().trim().max(10000).optional(),
|
||||
}).strict();
|
||||
@@ -4,6 +4,7 @@
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./auth": "./auth.js",
|
||||
"./acquisition": "./acquisition.js",
|
||||
"./inventory": "./inventory.js",
|
||||
"./image": "./image.js",
|
||||
"./listing": "./listing.js",
|
||||
|
||||
Reference in New Issue
Block a user