Files
GearBox/src/shared/types.ts
Jean-Luc Makiola 81b70a72ac feat(18-01): add Zod schemas, types, and global items seed data
- Add searchGlobalItemsSchema, linkItemSchema, updateProfileSchema to schemas.ts
- Add isPublic field to createSetupSchema and updateSetupSchema
- Add GlobalItem, ItemGlobalLink, SearchGlobalItems, LinkItem, UpdateProfile types
- Create global-items-seed.json with 18 bikepacking gear items across 7 categories
- Format fix in schema.ts (pre-existing biome formatting)
2026-04-05 12:59:21 +02:00

64 lines
2.2 KiB
TypeScript

import type { z } from "zod";
import type {
categories,
globalItems,
itemGlobalLinks,
items,
setupItems,
setups,
threadCandidates,
threads,
} from "../db/schema.ts";
import type {
createCandidateSchema,
createCategorySchema,
createItemSchema,
createSetupSchema,
createThreadSchema,
linkItemSchema,
reorderCandidatesSchema,
resolveThreadSchema,
searchGlobalItemsSchema,
syncSetupItemsSchema,
updateCandidateSchema,
updateCategorySchema,
updateClassificationSchema,
updateItemSchema,
updateProfileSchema,
updateSetupSchema,
updateThreadSchema,
} from "./schemas.ts";
// Types inferred from Zod schemas
export type CreateItem = z.infer<typeof createItemSchema>;
export type UpdateItem = z.infer<typeof updateItemSchema>;
export type CreateCategory = z.infer<typeof createCategorySchema>;
export type UpdateCategory = z.infer<typeof updateCategorySchema>;
export type CreateThread = z.infer<typeof createThreadSchema>;
export type UpdateThread = z.infer<typeof updateThreadSchema>;
export type CreateCandidate = z.infer<typeof createCandidateSchema>;
export type UpdateCandidate = z.infer<typeof updateCandidateSchema>;
export type ResolveThread = z.infer<typeof resolveThreadSchema>;
export type ReorderCandidates = z.infer<typeof reorderCandidatesSchema>;
// Setup types
export type CreateSetup = z.infer<typeof createSetupSchema>;
export type UpdateSetup = z.infer<typeof updateSetupSchema>;
export type SyncSetupItems = z.infer<typeof syncSetupItemsSchema>;
export type UpdateClassification = z.infer<typeof updateClassificationSchema>;
// Global item types
export type SearchGlobalItems = z.infer<typeof searchGlobalItemsSchema>;
export type LinkItem = z.infer<typeof linkItemSchema>;
export type UpdateProfile = z.infer<typeof updateProfileSchema>;
// Types inferred from Drizzle schema
export type Item = typeof items.$inferSelect;
export type Category = typeof categories.$inferSelect;
export type Thread = typeof threads.$inferSelect;
export type ThreadCandidate = typeof threadCandidates.$inferSelect;
export type Setup = typeof setups.$inferSelect;
export type SetupItem = typeof setupItems.$inferSelect;
export type GlobalItem = typeof globalItems.$inferSelect;
export type ItemGlobalLink = typeof itemGlobalLinks.$inferSelect;