summaryrefslogtreecommitdiff
path: root/lib/vendors/validations.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vendors/validations.ts')
-rw-r--r--lib/vendors/validations.ts18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/vendors/validations.ts b/lib/vendors/validations.ts
index ecadd67a..2538e1c8 100644
--- a/lib/vendors/validations.ts
+++ b/lib/vendors/validations.ts
@@ -121,7 +121,9 @@ export type CreditAgencyType = z.infer<typeof creditAgencyEnum>;
export const updateVendorSchema = z.object({
vendorName: z.string().min(1, "업체명은 필수 입력사항입니다"),
vendorCode: z.string().optional(),
- address: z.string().optional(),
+ address: z.string().min(1, "주소는 필수 입력사항입니다."),
+ addressDetail: z.string().optional(),
+ postalCode: z.string().optional(),
country: z.string().optional(),
phone: z.string().optional(),
email: z.string().email("유효한 이메일 주소를 입력해주세요").optional(),
@@ -220,7 +222,15 @@ export const createVendorSchema = z
// Other fields remain the same
vendorCode: z.string().max(100, "Max length 100").optional(),
- address: z.string().optional(),
+ address: z.string()
+ .min(1, "주소는 필수입니다.")
+ .max(500, "주소는 최대 500자까지 입력 가능합니다."),
+ addressDetail: z.string()
+ .min(1, "상세주소는 필수입니다.")
+ .max(500, "상세주소는 최대 500자까지 입력 가능합니다."),
+ postalCode: z.string()
+ .min(1, "우편번호는 필수입니다.")
+ .max(20, "우편번호는 최대 20자까지 입력 가능합니다."),
country: z.string()
.min(1, "국가 선택은 필수입니다.")
.max(100, "Max length 100"),
@@ -399,7 +409,9 @@ export type GetRfqHistorySchema = Awaited<ReturnType<typeof searchParamsRfqHisto
export const updateVendorInfoSchema = z.object({
vendorName: z.string().min(1, "업체명은 필수 입력사항입니다."),
taxId: z.string(),
- address: z.string().optional(),
+ address: z.string().min(1, "주소는 필수 입력사항입니다."),
+ addressDetail: z.string().optional(),
+ postalCode: z.string().optional(),
country: z.string().min(1, "국가를 선택해 주세요."),
phone: z.string().optional(),
email: z.string().email("유효한 이메일을 입력해 주세요."),