import type { ProductId } from "@/lib/product-map";

export type VerifyOtpPayload = {
  phone: string;
  otp: string;
};

export type VerifyOtpResponse = {
  status: string;
  message: string;
  verified: boolean;
};

export type RegisterPayload = {
  email: string;
  phone: string;
  full_name: string;
  company_name: string;
  society_type?: string;
  has_referral?: "yes" | "no";
  referral_code?: string;
  company_address: string;
  city: string;
  state: string;
  product_id: ProductId;
};

export type LoginPayload = {
  phone: string;
  password: string;
  product_id?: ProductId | number;
};

export type AuthUser = {
  id: number;
  email: string;
  phone: string;
  full_name: string | null;
  company_name: string | null;
  gst_no?: string | null;
  company_address?: string | null;
  city?: string | null;
  state?: string | null;
  product_id: ProductId;
  product_name: string;
  selected_package?: string | null;
  is_payment_done?: boolean;
  has_active_package?: boolean;
  active_package?: unknown;
};

export type AuthResponse = {
  status: string;
  message: string;
  token?: string;
  user: AuthUser;
  redirect?: {
    url: string;
    message?: string;
  };
};
