mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-21 18:22:00 +00:00
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m58s
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { z } from "zod";
|
|
export const signUpFormSchema = z.object({
|
|
name: z.string().min(2, { message: "Name is required." }),
|
|
id_card: z
|
|
.string()
|
|
.min(2, { message: "ID Card is required" })
|
|
.regex(/^[A][0-9]{6}$/, "Please enter a valid ID Card number."),
|
|
atoll_id: z.string().min(1, { message: "Atoll is required." }),
|
|
island_id: z
|
|
.string({ required_error: "Island is required." })
|
|
.min(1, { message: "Island is required." }),
|
|
address: z.string().min(2, { message: "address is required." }),
|
|
dob: z.coerce.date({ message: "Date of birth is required." }),
|
|
phone_number: z
|
|
.string()
|
|
.min(7, { message: "Phone number is required." })
|
|
.regex(/^[79][0-9]{2}[0-9]{4}$/, "Please enter a valid phone number")
|
|
.transform((val) => val.replace(/\D/g, "")),
|
|
terms: z
|
|
.string({
|
|
required_error: "You must accept the terms and conditions",
|
|
})
|
|
.transform((val) => val === "on"),
|
|
policy: z
|
|
.string({
|
|
required_error: "You must accept the privacy policy",
|
|
})
|
|
.transform((val) => val === "on"),
|
|
accNo: z
|
|
.string()
|
|
.min(2, { message: "Account number is required." })
|
|
.regex(/^(7\d{12}|9\d{16})$/, "Please enter a valid account number"),
|
|
});
|