import { TouchBaseSchema } from '@isa/common/data-access';
import { z } from 'zod';

export const ProductSchema = z
  .object({
    name: z.string().describe('Name').optional(),
    additionalName: z.string().describe('Additional name').optional(),
    ean: z.string().describe('European Article Number barcode').optional(),
    supplierProductNumber: z.string().describe('SupplierProduct number').optional(),
    catalogProductNumber: z.string().describe('CatalogProduct number').optional(),
    contributors: z.string().describe('Contributors').optional(),
    manufacturer: z.string().describe('Manufacturer information').optional(),
    publicationDate: z.string().describe('Publication date').optional(),
    productGroup: z.string().describe('Product group').optional(),
    productGroupDetails: z.string().describe('Product group details').optional(),
    edition: z.string().describe('Edition').optional(),
    format: z.string().describe('Format').optional(),
    formatDetail: z.string().describe('Format detail').optional(),
    locale: z.string().describe('Locale').optional(),
    serial: z.string().describe('Serial').optional(),
    size: z.any().describe('Size').optional(), // TODO: Create SizeOfString schema
    volume: z.string().describe('Volume').optional(),
    weight: z.any().describe('Weight').optional(), // TODO: Create WeightOfAvoirdupois schema
  })
  .extend(TouchBaseSchema.shape);

export type Product = z.infer<typeof ProductSchema>;
