// Shape returned by /api/flags — matches the Flag schema on platform-api.

export type FlagState = 'off' | 'targeted' | 'rollout' | 'on'

export interface FlagHistoryEntry {
  at: string
  byEmail?: string
  action: string
  note?: string
}

export interface FlagScope {
  plans: string[]
  tenantSlugs: string[]
  partnerSlugs: string[]
  environments: ('prod' | 'staging' | 'dev')[]
}

export interface Flag {
  _id: string
  key: string
  description: string
  state: FlagState
  pct: number
  scope: FlagScope
  history: FlagHistoryEntry[]
  createdAt: string
  updatedAt: string
}
