Quality / test (push) Canceled after 0s
Add robust outlier detection, stale valuation metadata, and audited seller-scoped market-value overrides with migration and tests.
19 lines
696 B
JavaScript
19 lines
696 B
JavaScript
import { z } from 'zod';
|
|
|
|
export const createPricingObservationSchema = z.object({
|
|
productId: z.uuid(),
|
|
inventoryItemId: z.uuid(),
|
|
providerId: z.string().trim().min(1).max(100),
|
|
priceMinor: z.int().positive(),
|
|
currency: z.string().trim().regex(/^[A-Za-z]{3}$/).optional(),
|
|
sourceIdentifier: z.string().trim().min(1).max(255),
|
|
conditionId: z.uuid(),
|
|
sourceUrl: z.string().trim().url().optional(),
|
|
qualityScore: z.int().min(0).max(100).optional(),
|
|
}).strict();
|
|
|
|
export const createMarketValueOverrideSchema = z.object({
|
|
valueMinor: z.int().nonnegative(),
|
|
currency: z.string().trim().regex(/^[A-Za-z]{3}$/).optional(),
|
|
reason: z.string().trim().min(3).max(1000),
|
|
}).strict(); |