import { ZodType, z } from "zod";
import { AddAddressRequest } from "../model/user-model";

export class UserValidation {
    static readonly REGISTER : ZodType = z.object({
        firstName: z.string().min(1).max(100),
        lastName: z.string().min(1).max(100),
        email: z.string().email(),
        phone: z.string().min(1).max(20), // Adjust max length as needed
        password: z.string().min(1).max(100),
    })

    static readonly LOGIN : ZodType = z.object({
        email: z.string().email(),
        password: z.string().min(1).max(100),
    })
    
    static readonly ADD_ADDRESS: ZodType<AddAddressRequest> = z.object({
        userId: z.string().min(1), // Assuming userId is a non-empty string
        receiptName: z.string().min(1).max(255), // Adjust max length as needed
        address: z.string().min(1).max(255), // Adjust max length as needed
        city: z.string().min(1).max(100), // Adjust max length as needed
        postalCode: z.string().min(1).max(20), // Adjust max length as needed
        province: z.string().min(1).max(100), // Adjust max length as needed
    });
}