export interface OrgRole {
  id: string
  tenant_id: string
  project_id: string | null
  role_key: string
  role_label: string
  person_name: string | null
  person_email: string | null
  department: string | null
  is_active: boolean
  created_at: string
  updated_at: string
}

export interface DefaultRole {
  role_key: string
  role_label: string
}

export interface DocumentReview {
  id: string
  tenant_id: string
  project_id: string | null
  document_type: string
  document_title: string
  document_content_hash: string | null
  reviewer_role_key: string
  reviewer_name: string | null
  reviewer_email: string | null
  status: 'pending' | 'in_review' | 'approved' | 'rejected'
  submitted_at: string | null
  submitted_by: string | null
  reviewed_at: string | null
  review_comment: string | null
  review_link: string | null
  email_sent: boolean
  email_sent_at: string | null
  created_at: string
  updated_at: string
}

export interface RoleMapping {
  id: string
  tenant_id: string
  document_type: string
  role_key: string
  is_primary: boolean
  created_at: string
}

export interface ReviewStats {
  pending?: number
  in_review?: number
  approved?: number
  rejected?: number
}

export type RollenkonzeptTab = 'rollen' | 'zuordnung' | 'reviews'

export const ROLE_ICONS: Record<string, string> = {
  dsb: '\u{1F6E1}\uFE0F',
  gf: '\u{1F4BC}',
  it_leiter: '\u{1F4BB}',
  hr_leitung: '\u{1F465}',
  marketing_leitung: '\u{1F4E3}',
  compliance_beauftragter: '\u2696\uFE0F',
  einkauf: '\u{1F6D2}',
}

export const STATUS_CONFIG: Record<string, { label: string; color: string }> = {
  pending: { label: 'Ausstehend', color: 'bg-gray-100 text-gray-700' },
  in_review: { label: 'In Pruefung', color: 'bg-blue-100 text-blue-700' },
  approved: { label: 'Freigegeben', color: 'bg-green-100 text-green-700' },
  rejected: { label: 'Abgelehnt', color: 'bg-red-100 text-red-700' },
}
