import { z } from 'zod';
import {
  AddresseeWithReferenceSchema,
  BuyerTypeSchema,
} from '@isa/common/data-access';
import { BuyerStatusSchema } from './buyer-status.schema';

export const BuyerSchema = z
  .object({
    buyerNumber: z.string().describe('Unique buyer identifier number').optional(),
    buyerStatus: BuyerStatusSchema.describe('Current status of the buyer account').optional(),
    buyerType: BuyerTypeSchema.describe('Buyer type').optional(),
    dateOfBirth: z.string().describe('Date of birth').optional(),
    isTemporaryAccount: z.boolean().describe('Whether temporaryAccount').optional(),
  })
  .extend(AddresseeWithReferenceSchema.shape);

export type Buyer = z.infer<typeof BuyerSchema>;
