diff options
Diffstat (limited to 'lib/vendors')
| -rw-r--r-- | lib/vendors/validations.ts | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/vendors/validations.ts b/lib/vendors/validations.ts index 54b5a29b..d1902866 100644 --- a/lib/vendors/validations.ts +++ b/lib/vendors/validations.ts @@ -8,8 +8,9 @@ import { import * as z from "zod" import { getFiltersStateParser, getSortingStateParser } from "@/lib/parsers" -import { Vendor, VendorContact, VendorItemsView, VendorMaterialsView, vendors, VendorWithType } from "@/db/schema/vendors"; +import { VendorContact, VendorItemsView, VendorMaterialsView, vendors, VendorWithType } from "@/db/schema/vendors"; import { rfqs } from "@/db/schema/rfq" +import { countryDialCodes } from '@/components/common/country-dial-codes'; export const searchParamsCache = createSearchParamsCache({ @@ -117,7 +118,6 @@ export const searchParamsItemCache = createSearchParamsCache({ const creditAgencyEnum = z.enum(["NICE", "KIS", "KED", "SCI"]); export type CreditAgencyType = z.infer<typeof creditAgencyEnum>; - export const updateVendorSchema = z.object({ vendorName: z.string().min(1, "업체명은 필수 입력사항입니다"), vendorCode: z.string().optional(), @@ -314,13 +314,7 @@ export const createVendorSchema = z message: "올바른 한국 전화번호 형식이 아닙니다. +82로 시작하거나 010으로 시작하는 번호를 입력해주세요.", }); } - if (!data.corporateRegistrationNumber) { - ctx.addIssue({ - code: "custom", - path: ["corporateRegistrationNumber"], - message: "법인등록번호는 한국(KR) 업체일 경우 필수입니다.", - }); - } + // 법인등록번호는 선택사항으로 변경됨 } // Validate contact phone numbers @@ -486,14 +480,8 @@ export const updateVendorSchemaWithConditions = updateVendorInfoSchema.superRefi path: ["representativePhone"], }) } - - if (!data.corporateRegistrationNumber) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: "법인등록번호는 필수 입력사항입니다.", - path: ["corporateRegistrationNumber"], - }) - } + + // 법인등록번호는 선택사항으로 변경됨 // 신용평가사가 선택된 경우, 등급 정보 필수 if (data.creditAgency) { |
