Update user schema and forms to include address and consent fields

- Replaced 'house_name' with 'address' in user schema and related files.
- Added new fields for terms and privacy policy acceptance in the signup form schema.
- Updated package.json and package-lock.json to include @radix-ui/react-checkbox for checkbox functionality.
- Modified seed script to reflect changes in the user model.
This commit is contained in:
2024-11-30 23:37:35 +05:00
parent 0322bee567
commit 4e78ff2de9
5 changed files with 59 additions and 3 deletions

View File

@ -9,11 +9,21 @@ export const signUpFormSchema = z.object({
island_id: z
.string({ required_error: "Island is required." })
.min(2, { message: "Island is required." }),
house_name: z.string().min(2, { message: "House name 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"),
});