/*
 * File: alerts.ts
 * Description: Alert and notification type definitions
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

export interface Alert {
  id: string;
  type: AlertType;
  priority: AlertPriority;
  title: string;
  message: string;
  patientId?: string;
  patientName?: string;
  bedNumber?: string;
  timestamp: Date;
  isRead: boolean;
  isAcknowledged: boolean;
  actionRequired: boolean;
  expiresAt?: Date;
  metadata?: AlertMetadata;
}

export type AlertType = 
  | 'CRITICAL_FINDING'
  | 'VITAL_SIGNS_ALERT'
  | 'SCAN_COMPLETED'
  | 'MEDICATION_ALERT'
  | 'BED_ASSIGNMENT'
  | 'SHIFT_CHANGE'
  | 'SYSTEM_ALERT'
  | 'EMERGENCY_CODE';

export interface AlertMetadata {
  scanId?: string;
  vitalSigns?: {
    type: string;
    value: number;
    normalRange: string;
  };
  medication?: {
    name: string;
    dosage: string;
    reason: string;
  };
  location?: {
    floor: string;
    room: string;
    bed: string;
  };
  aiFindings?: {
    confidence: number;
    summary: string;
    recommendations: string[];
  };
}

export interface CriticalFinding {
  id: string;
  patientId: string;
  patientName: string;
  bedNumber: string;
  findingType: CriticalFindingType;
  severity: 'LIFE_THREATENING' | 'URGENT' | 'SERIOUS';
  description: string;
  aiSummary: string;
  recommendations: string[];
  timestamp: Date;
  acknowledgedBy?: string;
  acknowledgedAt?: Date;
  actionTaken?: string;
  followUpRequired: boolean;
}

export type CriticalFindingType = 
  | 'BRAIN_BLEED'
  | 'PULMONARY_EMBOLISM'
  | 'AORTIC_DISSECTION'
  | 'APPENDICITIS'
  | 'FRACTURE'
  | 'INTERNAL_BLEEDING'
  | 'CARDIAC_ARREST'
  | 'STROKE'
  | 'SEPSIS'
  | 'OTHER';

export interface AlertSettings {
  pushNotifications: boolean;
  soundAlerts: boolean;
  vibrationAlerts: boolean;
  criticalAlertsOnly: boolean;
  quietHours: {
    enabled: boolean;
    startTime: string;
    endTime: string;
  };
  alertTypes: {
    [key in AlertType]: boolean;
  };
}

export interface AlertResponse {
  alertId: string;
  response: 'ACKNOWLEDGED' | 'DISMISSED' | 'ESCALATED';
  notes?: string;
  timestamp: Date;
  userId: string;
}

/*
 * End of File: alerts.ts
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 