From 1c1c1019b6af72771358d387a2ae70ca965cd9f9 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 26 May 2025 04:25:47 +0000 Subject: (김준회) 아이템 리스트를 자재그룹으로 변경하고 PLM 인터페이스 처리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/items/validations.ts | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'lib/items/validations.ts') diff --git a/lib/items/validations.ts b/lib/items/validations.ts index d299959c..14fc27b1 100644 --- a/lib/items/validations.ts +++ b/lib/items/validations.ts @@ -22,6 +22,14 @@ export const searchParamsCache = createSearchParamsCache({ itemCode: parseAsString.withDefault(""), itemName: parseAsString.withDefault(""), description: parseAsString.withDefault(""), + parentItemCode: parseAsString.withDefault(""), + itemLevel: parseAsInteger.withDefault(5), + deleteFlag: parseAsString.withDefault(""), + unitOfMeasure: parseAsString.withDefault(""), + steelType: parseAsString.withDefault(""), + gradeMaterial: parseAsString.withDefault(""), + changeDate: parseAsString.withDefault(""), + baseUnitOfMeasure: parseAsString.withDefault(""), // advanced filter filters: getFiltersStateParser().withDefault([]), @@ -31,15 +39,31 @@ export const searchParamsCache = createSearchParamsCache({ }) export const createItemSchema = z.object({ - itemCode: z.string(), - itemName: z.string(), - description: z.string(), + itemCode: z.string().min(1, "아이템 코드는 필수입니다"), + itemName: z.string().min(1, "아이템명은 필수입니다"), + description: z.string().nullable().optional(), + parentItemCode: z.string().max(18).nullable().optional(), + itemLevel: z.number().int().min(1).max(5).nullable().optional(), + deleteFlag: z.string().max(1).nullable().optional(), + unitOfMeasure: z.string().max(3).nullable().optional(), + steelType: z.string().max(2).nullable().optional(), + gradeMaterial: z.string().max(50).nullable().optional(), + changeDate: z.string().max(8).nullable().optional(), + baseUnitOfMeasure: z.string().max(3).nullable().optional(), }) export const updateItemSchema = z.object({ itemCode: z.string().optional(), itemName: z.string().optional(), description: z.string().optional(), + parentItemCode: z.string().max(18).nullable().optional(), + itemLevel: z.number().int().min(1).max(5).nullable().optional(), + deleteFlag: z.string().max(1).nullable().optional(), + unitOfMeasure: z.string().max(3).nullable().optional(), + steelType: z.string().max(2).nullable().optional(), + gradeMaterial: z.string().max(50).nullable().optional(), + changeDate: z.string().max(8).nullable().optional(), + baseUnitOfMeasure: z.string().max(3).nullable().optional(), }) export type GetItemsSchema = Awaited> -- cgit v1.2.3