/*
 * File: navigationTypes.ts
 * Description: TypeScript types for Dashboard module navigation
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import { StackNavigationProp } from '@react-navigation/stack';
import { Patient, Alert as AlertType, ERDashboard } from '../../../shared/types';

/**
 * DashboardStackParamList - Defines the parameter list for Dashboard stack navigator
 * 
 * This interface defines all the screens available in the Dashboard module
 * and their associated navigation parameters.
 */
export type DashboardStackParamList = {
  // ER Dashboard screen - Main dashboard with patient overview
  ERDashboard: DashboardScreenParams;
  
  // Patient Details screen - Detailed patient information
  PatientDetails: PatientDetailsScreenParams;
  
  // Alert Details screen - Detailed alert information
  AlertDetails: AlertDetailsScreenParams;
  
  // Department Stats screen - Department-specific statistics
  DepartmentStats: DepartmentStatsScreenParams;
  
  // Quick Actions screen - Quick action menu
  QuickActions: QuickActionsScreenParams;
};

/**
 * DashboardNavigationProp - Type for navigation prop in Dashboard screens
 * 
 * This type provides type-safe navigation methods for screens
 * within the Dashboard module.
 */
export type DashboardNavigationProp = StackNavigationProp<DashboardStackParamList>;

/**
 * DashboardScreenProps - Base props interface for Dashboard screens
 * 
 * This interface provides the common props that all Dashboard screens
 * will receive, including navigation and route.
 */
export interface DashboardScreenProps<T extends keyof DashboardStackParamList> {
  navigation: DashboardNavigationProp;
  route: {
    key: string;
    name: T;
    params: DashboardStackParamList[T];
  };
}

// ============================================================================
// SCREEN PARAMETER TYPES
// ============================================================================

/**
 * DashboardScreenParams
 * 
 * Purpose: Parameters passed to the ER dashboard screen
 * 
 * Parameters:
 * - filter: Optional filter to apply to dashboard data
 * - refresh: Optional flag to force refresh
 */
export interface DashboardScreenParams {
  filter?: 'all' | 'critical' | 'active' | 'pending';
  refresh?: boolean;
}

/**
 * PatientDetailsScreenParams
 * 
 * Purpose: Parameters for the patient details screen
 * 
 * Parameters:
 * - patientId: Required patient ID to display details
 * - patient: Optional patient data to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface PatientDetailsScreenParams {
  patientId: string;
  patient?: Patient;
  fromScreen?: keyof DashboardStackParamList;
}

/**
 * AlertDetailsScreenParams
 * 
 * Purpose: Parameters for the alert details screen
 * 
 * Parameters:
 * - alertId: Required alert ID to display details
 * - alert: Optional alert data to pre-populate
 * - fromScreen: Optional source screen for back navigation
 */
export interface AlertDetailsScreenParams {
  alertId: string;
  alert?: AlertType;
  fromScreen?: keyof DashboardStackParamList;
}

/**
 * DepartmentStatsScreenParams
 * 
 * Purpose: Parameters for the department stats screen
 * 
 * Parameters:
 * - department: Required department name
 * - dateRange: Optional date range for statistics
 */
export interface DepartmentStatsScreenParams {
  department: string;
  dateRange?: {
    start: Date;
    end: Date;
  };
}

/**
 * QuickActionsScreenParams
 * 
 * Purpose: Parameters for the quick actions screen
 * 
 * Parameters:
 * - actionType: Optional action type to pre-select
 * - patientId: Optional patient ID for patient-specific actions
 */
export interface QuickActionsScreenParams {
  actionType?: 'emergency' | 'scan' | 'report' | 'consultation';
  patientId?: string;
}

// ============================================================================
// SCREEN-SPECIFIC PROPS TYPES
// ============================================================================

/**
 * DashboardScreenProps - Props for DashboardScreen component
 */
export type DashboardScreenProps = DashboardScreenProps<'ERDashboard'>;

/**
 * PatientDetailsScreenProps - Props for PatientDetailsScreen component
 */
export type PatientDetailsScreenProps = DashboardScreenProps<'PatientDetails'>;

/**
 * AlertDetailsScreenProps - Props for AlertDetailsScreen component
 */
export type AlertDetailsScreenProps = DashboardScreenProps<'AlertDetails'>;

/**
 * DepartmentStatsScreenProps - Props for DepartmentStatsScreen component
 */
export type DepartmentStatsScreenProps = DashboardScreenProps<'DepartmentStats'>;

/**
 * QuickActionsScreenProps - Props for QuickActionsScreen component
 */
export type QuickActionsScreenProps = DashboardScreenProps<'QuickActions'>;

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