import { z } from 'zod'

export const operationItemSchema = z.object({
  operationCode: z.string().min(1),
  name: z.string().min(1),
  cadence: z.enum(['DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY', 'EVENT_DRIVEN']),
  automationMode: z.enum(['EVALUATION_ONLY', 'PROPOSAL_ONLY', 'DRILL_ONLY']),
  queue: z.string().min(1),
  primaryOwner: z.string().min(1),
  secondaryOwner: z.string().min(1),
  requiredEvidence: z.string().min(1),
  output: z.string().min(1),
  gate: z.string().min(1)
})

export const modelOperationsPlanSchema = z.object({
  algorithmStatus: z.literal('RESEARCH_CANDIDATE_NOT_PRODUCTION'),
  orderCapability: z.literal('AUTOMATIC_ORDER_AND_KIS_SUBMISSION_OFF'),
  modelMutationBoundary: z.literal('EVALUATION_AND_PROPOSAL_ONLY_HUMAN_APPROVAL_REQUIRED'),
  operations: z.array(operationItemSchema)
})

export type ModelOperationsPlan = z.infer<typeof modelOperationsPlanSchema>
export type ModelOperationItem = z.infer<typeof operationItemSchema>
