import { z } from 'zod'

export const riskRuleTypeSchema = z.enum(['ip', 'device', 'user', 'region'])

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

export const riskRuleSchema = z.object({
  id: z.union([z.string(), z.number()]),
  type: riskRuleTypeSchema,
  value: z.string(),
  reason: z.string().optional().nullable(),
  status: riskRuleStatusSchema,
  expires_at: z.string().optional().nullable(),
  created_at: z.string(),
})

export type RiskRule = z.infer<typeof riskRuleSchema>
