WIP: 회원 등록 폼 작업중

This commit is contained in:
2025-06-13 09:26:25 +09:00
parent 6f92d1c2fb
commit 7bab3ef97d
11 changed files with 1019 additions and 41 deletions
@@ -97,7 +97,10 @@ export const userUpdateSchema = z.object({
email: z.string().email().optional(),
password: z
.string()
.regex(/((?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20})|()/)
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
)
.optional(),
roleId: z.string().optional(),
userStateCode: z.string(),
@@ -114,6 +117,7 @@ export const userUpdateSchema = z.object({
autzrId: z.string().uuid().optional(),
expryYmd: z.string().max(8),
instSeCd: z.string().optional(),
dtlInstCd: z.string().optional(),
aprvYmd: z.string().max(8).optional(),
enoCd: z.string().optional(),
});
@@ -122,19 +126,25 @@ export const userUpdateSchema = z.object({
export const userPasswordUpdateSchema = z.object({
password: z
.string()
.regex(/((?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20})|()/)
.optional()
.describe("기존 패스워드"),
provider: z.string().optional().describe("공급자(기본값:password)"),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
)
.optional(),
provider: z.string().optional(),
token: z.string().optional(),
newPassword: z
.string()
.regex(/(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20}/)
.describe("신규 패스워드"),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
),
newPasswordConfirm: z
.string()
.regex(/(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20}/)
.describe("신규 패스워드 확인"),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
),
});
// 사용자 비밀번호 찾기 변경 스키마
@@ -142,24 +152,32 @@ export const userFindPasswordUpdateSchema = z.object({
tokenValue: z.string(),
password: z
.string()
.regex(/(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20}/),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
),
});
// 사용자 비밀번호 확인 스키마
export const userPasswordMatchSchema = z.object({
password: z
.string()
.regex(/(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20}/),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
),
});
// 사용자 회원정보 변경 스키마
export const userUpdateInfoSchema = z.object({
password: z
.string()
.regex(/((?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20})|()/)
.optional()
.describe("기존 패스워드"),
provider: z.string().optional().describe("공급자(기본값:password)"),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
)
.optional(),
provider: z.string().optional(),
token: z.string().optional(),
userName: z.string(),
email: z.string().email().optional(),
@@ -167,25 +185,28 @@ export const userUpdateInfoSchema = z.object({
// 사용자 저장 스키마
export const userSaveSchema = z.object({
userId: z.string().describe("사용자 ID"),
userName: z.string().describe("사용자명"),
email: z.string().email().optional().describe("이메일"),
userId: z.string(),
userName: z.string(),
email: z.string().email().optional(),
password: z
.string()
.regex(/(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20}/)
.describe("패스워드"),
pswdHnt: z.string().max(10).describe("비밀번호 힌트"),
pswdAns: z.string().max(100).optional().describe("비밀번호 답변"),
mphn: z.string().max(11).optional().describe("휴대폰 번호"),
telno: z.string().max(11).optional().describe("전화번호"),
zip: z.string().max(5).optional().describe("우편번호"),
addr: z.string().max(200).optional().describe("주소"),
daddr: z.string().max(200).optional().describe("상세 주소"),
laeSeCd: z.string().max(10).describe("법적 구분 코드"),
ogdpSeCd: z.string().max(10).describe("조직 구분 코드"),
expryYmd: z.string().max(8).describe("만료 일자(YYYYMMDD)"),
instSeCd: z.string().optional().describe("기관구분코드"),
enoCd: z.string().optional().describe("환경청코드"),
.regex(
/^[a-z0-9]{6,16}$/,
"비밀번호는 6~16자까지 입력 가능하며, 영문자(소문자)와 숫자만 사용 가능합니다.",
),
pswdHnt: z.string().max(10),
pswdAns: z.string().max(100).optional(),
mphn: z.string().max(11).optional(),
telno: z.string().max(11).optional(),
zip: z.string().max(5).optional(),
addr: z.string().max(200).optional(),
daddr: z.string().max(200).optional(),
laeSeCd: z.string().max(10),
ogdpSeCd: z.string().max(10),
expryYmd: z.string().max(8),
instSeCd: z.string().optional(),
dtlInstCd: z.string().optional(),
enoCd: z.string().optional(),
});
// 사용자 비밀번호 찾기 저장 스키마
@@ -201,9 +222,8 @@ export const userVerifySchema = z.object({
password: z
.string()
.regex(/((?=.*[0-9])(?=.*[a-zA-Z])(?=.*\W)(?=\S+$).{8,20})|()/)
.optional()
.describe("기존 패스워드"),
provider: z.string().optional().describe("공급자(기본값:password)"),
.optional(),
provider: z.string().optional(),
token: z.string().optional(),
});