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

import { StackNavigationProp } from '@react-navigation/stack';
import { MedicalCase } from '../../../shared/types';

// ============================================================================
// NAVIGATION PARAMETER LISTS
// ============================================================================

/**
 * PatientCareStackParamList - Defines the parameter list for PatientCare stack navigator
 * 
 * This interface defines all the screens available in the PatientCare module
 * and their associated navigation parameters.
 */
export type PatientCareStackParamList = {
  // Patients Screen - Main patient list with search and filtering
  PatientsScreen: PatientsScreenParams;
  
  // Patient Details Screen - Comprehensive patient information and DICOM images
  PatientDetails: PatientDetailsScreenParams;
  
  // Series Detail Screen - Detailed series information with predictions and feedback
  SeriesDetail: SeriesDetailScreenParams;
};

// ============================================================================
// SCREEN PARAMETER INTERFACES
// ============================================================================

/**
 * PatientsScreenParams
 * 
 * Purpose: Parameters for the patients list screen
 * 
 * Parameters:
 * - None required - this is the main entry point
 */
export interface PatientsScreenParams {
  // No parameters required for main patients screen
}

/**
 * PatientDetailsScreenParams
 * 
 * Purpose: Parameters for the patient details screen
 * 
 * Parameters:
 * - patientId: Required patient ID to display details
 * - patientName: Optional patient name for display (will be fetched from API if not provided)
 */
export interface PatientDetailsScreenParams {
  patientId: string;
  patientName?: string;
}

/**
 * SeriesDetailScreenParams
 * 
 * Purpose: Parameters for the series detail screen
 * 
 * Parameters:
 * - patientId: Required patient ID for the series
 * - patientName: Required patient name for display
 * - seriesNumber: Required series number to display
 * - seriesData: Required series data object
 * - patientData: Required patient data object for context
 * - onFeedbackSubmitted: Optional callback to refresh parent screen data
 */
export interface SeriesDetailScreenParams {
  patientId: string;
  patientName: string;
  seriesNumber: string;
  seriesData: any;
  patientData: any;
  // Callback function to refresh parent screen data when feedback is submitted
  // This ensures PatientDetailsScreen shows updated information when user navigates back
  onFeedbackSubmitted?: () => void;
}

// ============================================================================
// NAVIGATION PROP TYPES
// ============================================================================

/**
 * PatientCareNavigationProp - Navigation prop type for PatientCare screens
 * 
 * Purpose: Provides type-safe navigation methods for PatientCare module screens
 */
export type PatientCareNavigationProp = StackNavigationProp<PatientCareStackParamList>;

// ============================================================================
// SCREEN PROP TYPES
// ============================================================================

/**
 * PatientsScreenProps - Props for PatientsScreen component
 */
export interface PatientsScreenProps {
  navigation: PatientCareNavigationProp;
  route: {
    params: PatientsScreenParams;
  };
}

/**
 * PatientDetailsScreenProps - Props for PatientDetailsScreen component
 */
export interface PatientDetailsScreenProps {
  navigation: PatientCareNavigationProp;
  route: {
    params: PatientDetailsScreenParams;
  };
}

/**
 * SeriesDetailScreenProps - Props for SeriesDetailScreen component
 */
export interface SeriesDetailScreenProps {
  navigation: PatientCareNavigationProp;
  route: {
    params: SeriesDetailScreenParams;
  };
}

// ============================================================================
// NAVIGATION UTILITY TYPES
// ============================================================================

/**
 * NavigationHelper - Helper type for navigation functions
 * 
 * Purpose: Provides type-safe navigation helper functions
 */
export type NavigationHelper = {
  navigateToPatientDetails: (
    patientId: string,
    patientName: string,
    medicalCase: MedicalCase
  ) => void;
  navigateBack: () => void;
};

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