import { z } from 'zod'

export const updateStrategySchema = z.enum(['optional', 'forced'])
export const updateMethodSchema = z.enum(['manual', 'auto'])

export const versionSchema = z.object({
  id: z.number(),
  application_id: z.number(),
  application_name: z.string(),
  version: z.string(),
  description: z.string(),
  file_path: z.string(),
  file_size: z.number(),
  force_update: z.boolean(),
  update_strategy: updateStrategySchema,
  update_method: updateMethodSchema,
  changelog: z.string(),
  created_at: z.string(),
  updated_at: z.string(),
})

export type Version = z.infer<typeof versionSchema>
