export type CampaignType = 'REWARD' | 'POINTS' | 'TOKENS' | 'MIXED'

export type RuleType = 'TIER' | 'SPEND' | 'PRODUCT' | 'CATEGORY' | 'DAY' | 'LOCATION'

export type RewardType = 'POINTS' | 'TOKENS' | 'REWARD'

export interface Campaign {
  id: string // UUID
  name: string
  description?: string
  type: CampaignType
  start_date: string // ISO string
  end_date: string // ISO string
  is_active: boolean
  show_on_app: boolean
  position: number
  metadata?: {
    banner_url?: string
  }
  created_at: string // ISO string
  updated_at: string // ISO string
}

export interface CampaignRule {
  id: string // UUID
  campaign_id: string // UUID
  rule_type: RuleType
  condition_value?: string
  reward_type: RewardType
  reward_value?: number
  reward_subtype?: string
  reward_ref_id?: string // UUID
  metadata?: Record<string, any>
  created_at: string // ISO string
  updated_at: string // ISO string
}

export interface CampaignRequest {
  name: string
  description?: string
  type: CampaignType
  start_date: string // ISO string
  end_date: string // ISO string
  is_active: boolean
  show_on_app: boolean
  position: number
  metadata?: {
    banner_url?: string
  }
}

export interface CampaignRuleRequest {
  campaign_id: string
  rule_type: 'TIER' | 'SPEND' | 'PRODUCT' | 'CATEGORY' | 'DAY' | 'LOCATION'
  condition_value?: string
  reward_type: 'POINTS' | 'TOKENS' | 'REWARD'
  reward_value?: number
  reward_subtype?: string
  reward_ref_id?: string
}

export interface Campaigns {
  campaigns: Campaign[]
  total: number
  page: number
  limit: number
}
