import {
  AddressSchema,
  CommunicationDetailsSchema,
  EntitySchema,
  GenderSchema,
  OrganisationSchema,
} from '@isa/common/data-access';
import z from 'zod';

export const ShippingAddressSchema = z
  .object({
    address: AddressSchema.describe('Address').optional(),
    agentomment: z.string().describe('Agentomment').optional(),
    communicationDetails: CommunicationDetailsSchema.describe('Communication details').optional(),
    firstName: z.string().describe('First name').optional(),
    gender: GenderSchema.describe('Gender').optional(),
    lastName: z.string().describe('Last name').optional(),
    organisation: OrganisationSchema.describe('Organisation information').optional(),
    title: z.string().describe('Title').optional(),
    type: z.number().describe('Type').optional(),
    validated: z.string().describe('Validated').optional(),
    validationResult: z.number().describe('Validation result').optional(),
  })
  .extend(EntitySchema.shape);

export type ShippingAddress = z.infer<typeof ShippingAddressSchema>;
