import { z } from 'zod'

export const agentAppStatusSchema = z.enum(['active', 'inactive'])

export const cardTypeSchema = z.object({
  id: z.number().optional(),
  card_type_id: z.number(),
  name: z.string().optional(),
  billing_type: z.string().optional(),
  can_generate: z.boolean(),
  price: z.number().optional(),
  origin_price: z.number().optional(),
})

export const agentAppSchema = z.object({
  id: z.number(),
  agent_id: z.number(),
  agent_name: z.string(),
  agent_email: z.string().optional(),
  application_id: z.number(),
  app_name: z.string(),
  status: agentAppStatusSchema,
  discount: z.number(),
  balance: z.number(),
  card_types: z.array(cardTypeSchema).optional(),
  created_at: z.string(),
})

export type CardTypeAuth = z.infer<typeof cardTypeSchema>
export type AgentApp = z.infer<typeof agentAppSchema>
