import { z } from 'zod'

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

export const emailConfigSchema = z.object({
  id: z.number(),
  name: z.string(),
  smtp_host: z.string(),
  smtp_port: z.number(),
  smtp_user: z.string(),
  smtp_password: z.string(),
  smtp_from: z.string(),
  encryption: z.enum(['none', 'ssl', 'tls']).optional(),
  status: emailConfigStatusSchema,
  remark: z.string().optional(),
  created_at: z.string(),
  updated_at: z.string(),
})

export type EmailConfig = z.infer<typeof emailConfigSchema>
