import { object, string, minLength, optional, number, picklist } from "valibot";

export const PersonalInfoSchema = object({
  fullName: string([minLength(1)]),
  email: optional(string()),
  phone: optional(string()),
  address: optional(string()),
  city: optional(string()),
  state: optional(string()),
  zip: optional(string()),
  dob: optional(string()),
});

export const CreateRemovalRequestSchema = object({
  brokerId: string([minLength(1)]),
  personalInfo: PersonalInfoSchema,
});

export const RequestStatusSchema = object({
  requestId: string([minLength(1)]),
});

export const ScanListingsSchema = object({
  brokerId: optional(string()),
});

export const BrokerListingsFilterSchema = object({
  brokerId: optional(string()),
  page: optional(number(), 1),
  limit: optional(number(), 20),
});

export const RemovalRequestsFilterSchema = object({
  status: optional(picklist(["PENDING", "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED", "REJECTED", "CANCELLED"])),
  page: optional(number(), 1),
  limit: optional(number(), 20),
});
