import { z } from 'zod';

/**
 * Schema for EntityDTOReferenceContainer
 * Base container type for entity references with metadata
 *
 * Note: externalReference uses z.any() to avoid type conflicts between
 * our optional ExternalReferenceSchema and the generated DTOs which require externalStatus
 */
export const EntityReferenceContainerSchema = z.object({
  displayLabel: z.string().describe('Display label').optional(),
  enabled: z.boolean().describe('Whether this is enabled').optional(),
  externalReference: z.any().describe('External system reference').optional(),
  id: z.number().describe('Unique identifier').optional(),
  pId: z.string().describe('P identifier').optional(),
  selected: z.boolean().describe('Whether this option is currently selected').optional(),
  uId: z.string().describe('U identifier').optional(),
});

export type EntityReferenceContainer = z.infer<
  typeof EntityReferenceContainerSchema
>;
