import { z } from 'zod';
import { AvailabilitySchema } from './availability.schema';
import { UrlSchema } from './url.schema';
import { ImageSchema } from './image.schema';
import { EntityContainerSchema } from '@isa/common/data-access';

export const ShopItemSchema = z.object({
  availability: AvailabilitySchema.describe('Availability').optional(),
  deepUrl: UrlSchema.describe('Deep url').optional(),
  description: z.string().describe('Description text').optional(),
  ean: z.string().describe('European Article Number barcode').optional(),
  firstDayOfSale: z.string().describe('First day of sale').optional(),
  format: z.string().describe('Format').optional(),
  image: ImageSchema.describe('Image').optional(),
  item: EntityContainerSchema(z.any()).describe('Item').optional(),
});

export type ShopItem = z.infer<typeof ShopItemSchema>;
