7c0d422228
Ground-up TypeScript rewrite of the Vector hardware parts inventory
system. Ships the full roadmap (Phases 0-8) in one initial commit:
- pnpm + Turbo monorepo: apps/{api,web,e2e}, packages/{db,shared,ui,config}
- Express 5 + Prisma 5 + zod validation + JWT w/ refresh-token rotation
- React 19 + Vite + shadcn/ui + TanStack Query/Table + nuqs URL state
- Repair/RMA, tags, bulk ops, saved views, CSV audit export
- Analytics dashboard on Recharts + EOL tracking
- Signed webhook subscriptions (HMAC-SHA256) with in-process emitter
- Vitest unit tests (shared schemas, api services/helpers) + Playwright skeleton
- Gitea Actions CI (lint, typecheck, test+coverage, build) + Renovate
Deferred follow-ups: Postgres cutover (data-migration script ready),
BullMQ worker for webhook delivery, @react-pdf PDF export, CSV import wizard.
20 lines
812 B
TypeScript
20 lines
812 B
TypeScript
import { z } from 'zod';
|
|
|
|
// ISO datetime string (e.g. "2027-12-31T00:00:00.000Z"). Clients may send date-only "2027-12-31";
|
|
// API layer is expected to coerce to Date.
|
|
const IsoDate = z.string().datetime({ offset: true }).or(z.string().regex(/^\d{4}-\d{2}-\d{2}$/));
|
|
|
|
export const CreateManufacturerRequest = z.object({
|
|
name: z.string().min(1).max(128),
|
|
eolDate: IsoDate.optional().nullable(),
|
|
});
|
|
export type CreateManufacturerRequest = z.infer<typeof CreateManufacturerRequest>;
|
|
|
|
export const UpdateManufacturerRequest = z
|
|
.object({
|
|
name: z.string().min(1).max(128).optional(),
|
|
eolDate: IsoDate.nullable().optional(),
|
|
})
|
|
.refine((v) => Object.keys(v).length > 0, { message: 'At least one field required' });
|
|
export type UpdateManufacturerRequest = z.infer<typeof UpdateManufacturerRequest>;
|