summaryrefslogtreecommitdiff
path: root/lib/items-tech/validations.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/items-tech/validations.ts')
-rw-r--r--lib/items-tech/validations.ts42
1 files changed, 6 insertions, 36 deletions
diff --git a/lib/items-tech/validations.ts b/lib/items-tech/validations.ts
index 09c7878b..653f0af8 100644
--- a/lib/items-tech/validations.ts
+++ b/lib/items-tech/validations.ts
@@ -63,23 +63,9 @@ export const offshoreHullSearchParamsCache = createSearchParamsCache({
})
-export const createItemSchema = z.object({
- itemCode: z.string(),
- itemName: z.string(),
- description: z.string(),
-})
-
-export const updateItemSchema = z.object({
- itemCode: z.string().optional(),
- itemName: z.string().optional(),
- description: z.string().nullish(),
-})
-
// 조선 아이템 업데이트 스키마
export const updateShipbuildingItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string().optional(),
- description: z.string().optional(),
workType: z.string().optional(),
shipTypes: z.string().optional(),
itemList: z.string().optional(),
@@ -89,15 +75,11 @@ export type GetShipbuildingSchema = Awaited<ReturnType<typeof shipbuildingSearch
export type GetOffshoreTopSchema = Awaited<ReturnType<typeof offshoreTopSearchParamsCache.parse>>
export type GetOffshoreHullSchema = Awaited<ReturnType<typeof offshoreHullSearchParamsCache.parse>>
-export type CreateItemSchema = z.infer<typeof createItemSchema>
-export type UpdateItemSchema = z.infer<typeof updateItemSchema>
export type UpdateShipbuildingItemSchema = z.infer<typeof updateShipbuildingItemSchema>
// 조선 아이템 스키마
export const createShipbuildingItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string(),
- description: z.string(),
workType: z.string(),
shipTypes: z.string(),
itemList: z.string().optional(),
@@ -105,15 +87,9 @@ export const createShipbuildingItemSchema = z.object({
export type CreateShipbuildingItemSchema = z.infer<typeof createShipbuildingItemSchema>
-// 기본 아이템 생성 데이터 타입
-export interface ItemCreateData {
- itemCode: string
- itemName: string
- description: string | null
-}
-
// 조선 아이템 생성 데이터 타입
-export interface ShipbuildingItemCreateData extends ItemCreateData {
+export interface ShipbuildingItemCreateData {
+ itemCode: string
workType: string | null
shipTypes: string | null
itemList?: string | null
@@ -125,8 +101,6 @@ export type TypedItemCreateData = ShipbuildingItemCreateData
// 해양 TOP 아이템 스키마
export const createOffshoreTopItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string(),
- description: z.string(),
workType: z.enum(["TM", "TS", "TE", "TP"]),
itemList: z.string().optional(),
subItemList: z.string().optional(),
@@ -135,8 +109,6 @@ export const createOffshoreTopItemSchema = z.object({
// 해양 HULL 아이템 스키마
export const createOffshoreHullItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string(),
- description: z.string(),
workType: z.enum(["HA", "HE", "HH", "HM", "NC"]),
itemList: z.string().optional(),
subItemList: z.string().optional(),
@@ -148,8 +120,6 @@ export type CreateOffshoreHullItemSchema = z.infer<typeof createOffshoreHullItem
// 해양 TOP 아이템 업데이트 스키마
export const updateOffshoreTopItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string().optional(),
- description: z.string().optional(),
workType: z.enum(["TM", "TS", "TE", "TP"]).optional(),
itemList: z.string().optional(),
subItemList: z.string().optional(),
@@ -158,8 +128,6 @@ export const updateOffshoreTopItemSchema = z.object({
// 해양 HULL 아이템 업데이트 스키마
export const updateOffshoreHullItemSchema = z.object({
itemCode: z.string(),
- itemName: z.string().optional(),
- description: z.string().optional(),
workType: z.enum(["HA", "HE", "HH", "HM", "NC"]).optional(),
itemList: z.string().optional(),
subItemList: z.string().optional(),
@@ -169,14 +137,16 @@ export type UpdateOffshoreTopItemSchema = z.infer<typeof updateOffshoreTopItemSc
export type UpdateOffshoreHullItemSchema = z.infer<typeof updateOffshoreHullItemSchema>
// 해양 TOP 아이템 생성 데이터 타입
-export interface OffshoreTopItemCreateData extends ItemCreateData {
+export interface OffshoreTopItemCreateData {
+ itemCode: string
workType: "TM" | "TS" | "TE" | "TP"
itemList?: string | null
subItemList?: string | null
}
// 해양 HULL 아이템 생성 데이터 타입
-export interface OffshoreHullItemCreateData extends ItemCreateData {
+export interface OffshoreHullItemCreateData {
+ itemCode: string
workType: "HA" | "HE" | "HH" | "HM" | "NC"
itemList?: string | null
subItemList?: string | null