export type CommMessagePriority =
  | 'CRITICAL_DIRECTIVE'
  | 'BALLOT_PROTECTION_ORDER'
  | 'SOS_ALERT'
  | 'FIELD_STATUS'
  | 'LOGISTICS_UPDATE';

export type CommTargetTier =
  | 'ALL_TIERS'
  | 'STATE_SUPERVISORS'
  | 'LGA_COORDINATORS'
  | 'WARD_SUPERVISORS'
  | 'PU_AGENTS';

export interface MultiTierCommMessage {
  id: string;
  senderName: string;
  senderRole: string;
  senderBadgeId: string;
  senderState: string;
  senderPhone: string;
  targetTier: CommTargetTier;
  targetState?: string;
  targetLga?: string;
  targetWard?: string;
  targetPuCode?: string;
  priority: CommMessagePriority;
  subject: string;
  messageText: string;
  timestamp: string;
  status: 'DELIVERED' | 'ACKNOWLEDGED' | 'RESOLVED_ACTION';
  readCount: number;
}

export const INITIAL_MULTI_TIER_COMM_FEED: MultiTierCommMessage[] = [
  // Situation Room -> All States
  {
    id: 'MSG-DIR-001',
    senderName: 'Dr. Kabir Sani (National Situation Director)',
    senderRole: 'National Situation Room (Abuja)',
    senderBadgeId: 'ADC-NAT-SIT-001',
    senderState: 'FCT (National HQ)',
    senderPhone: '+234 802 333 4455',
    targetTier: 'STATE_SUPERVISORS',
    priority: 'BALLOT_PROTECTION_ORDER',
    subject: 'EMERGENCY ZERO-REJECT DIRECTIVE (Section 63 Enforcement)',
    messageText: 'ALL 37 STATE SUPERVISORS: Ensure every single Polling Unit Agent enforces Section 63(2) of Electoral Act 2022 during sorting. Under paragraph 38 of INEC Manual, any ballot where the voter\'s intent is clear must NOT be rejected even if the thumbprint touches the outer box boundary line. Do not allow opponent agents to discard our votes!',
    timestamp: '16:15:30',
    status: 'ACKNOWLEDGED',
    readCount: 37
  },

  // State Supervisor (Kebbi) -> Argungu LGA & Wards
  {
    id: 'MSG-KB-002',
    senderName: 'Alhaji Usman Argungu (State Operations Lead)',
    senderRole: 'Kebbi State Supervisor',
    senderBadgeId: 'ADC-STATE-KB-01',
    senderState: 'Kebbi',
    senderPhone: '+234 803 777 4411',
    targetTier: 'LGA_COORDINATORS',
    targetState: 'Kebbi',
    targetLga: 'Argungu',
    priority: 'CRITICAL_DIRECTIVE',
    subject: 'Collation Escort Mobilized for Argungu Central',
    messageText: 'To Argungu LGA Director and all 11 Ward Supervisors: Collation vehicles have arrived. Ensure all PU agents take timestamped high-resolution photos of signed Form EC8A BEFORE leaving their polling booths. Do not hand over physical duplicates until uploaded to the central portal.',
    timestamp: '16:08:12',
    status: 'ACKNOWLEDGED',
    readCount: 142
  },

  // PU Agent -> Ward & State
  {
    id: 'MSG-PU-003',
    senderName: 'Malam Garba Shehu (PU Agent)',
    senderRole: 'Polling Unit Agent',
    senderBadgeId: 'ADC-PUA-2027-KB-0041',
    senderState: 'Kebbi',
    senderPhone: '+234 813 456 7890',
    targetTier: 'WARD_SUPERVISORS',
    targetState: 'Kebbi',
    targetLga: 'Argungu',
    targetWard: 'Argungu Central I',
    targetPuCode: 'PU-21-02-004',
    priority: 'FIELD_STATUS',
    subject: 'PU-21-02-004 Count Completed: ADC 224, APC 118',
    messageText: 'Ward Supervisor Mustapha: Counting successfully concluded at Kanta Museum Square. We won comfortably (ADC 224 vs APC 118). Opponent agent attempted to challenge 24 ballots; I quoted Section 63 and presiding officer validated every single one! EC8A signed and uploaded.',
    timestamp: '15:58:45',
    status: 'RESOLVED_ACTION',
    readCount: 12
  },

  // Rivers State Supervisor -> National Situation Room
  {
    id: 'MSG-RV-004',
    senderName: 'Chief Tonye Briggs (State Operations Lead)',
    senderRole: 'Rivers State Supervisor',
    senderBadgeId: 'ADC-STATE-RV-01',
    senderState: 'Rivers',
    senderPhone: '+234 803 552 1144',
    targetTier: 'ALL_TIERS',
    targetState: 'Rivers',
    priority: 'SOS_ALERT',
    subject: 'Discrepancy Intercepted at Obio/Akpor Collation Center',
    messageText: 'SITUATION ROOM HQ ABUJA: We detected an attempt to alter EC8B in Rumueme Ward 7 (deducting 50 votes from ADC). Our legal team under Barrister Briggs has presented the certified PU agent duplicate. Security forces on site.',
    timestamp: '15:42:10',
    status: 'ACKNOWLEDGED',
    readCount: 88
  },

  // Katsina State Supervisor -> Funtua LGA
  {
    id: 'MSG-KT-005',
    senderName: 'Hon. Kabir Funtua (State Operations Lead)',
    senderRole: 'Katsina State Supervisor',
    senderBadgeId: 'ADC-STATE-KT-01',
    senderState: 'Katsina',
    senderPhone: '+234 806 332 9011',
    targetTier: 'PU_AGENTS',
    targetState: 'Katsina',
    priority: 'LOGISTICS_UPDATE',
    subject: 'Power Banks & Flashlights Dispatched for Rural Sorting',
    messageText: 'To all PU Agents in Funtua, Malumfashi, and Daura: Backup solar flashlights and power banks delivered to all rural polling stations. Keep your phones charged to snap the result sheets during evening sorting.',
    timestamp: '15:20:00',
    status: 'DELIVERED',
    readCount: 512
  }
];
