feat: items数据结构添加category字段

This commit is contained in:
2025-12-10 19:43:25 +08:00
parent d79c6362f2
commit fe3e736c99
2 changed files with 2 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ model Item {
id Int @id @default(autoincrement())
name String // 名称(必填)
source String? // 来源(可选)
category String? // 分类(可选)
// 数量管理
quantity Decimal? @db.Decimal(10, 3) // 总数量(如 1.5 kg

View File

@@ -20,6 +20,7 @@ const jsonValueSchema: z.ZodType<z.infer<typeof jsonValueSchema>> = z.lazy(() =>
const createItemSchema = z.object({
name: z.string().min(1, '名称不能为空'),
source: z.string().optional().nullable(),
category: z.string().optional().nullable(),
quantity: z
.string()