import { EntitySchema } from '@isa/common/data-access';
import { z } from 'zod';
import { SupplierTypeSchema } from './supplier-type.schema';

export const SupplierSchema = z
  .object({
    key: z.string().describe('Key').optional(),
    name: z.string().describe('Name').optional(),
    supplierNumber: z.string().describe('Supplier number').optional(),
    supplierType: SupplierTypeSchema.describe('Supplier type').optional(),
  })
  .extend(EntitySchema.shape);

export type Supplier = z.infer<typeof SupplierSchema>;
