export type SeafarerRecordStatus = 'SUBMITTED' | 'VERIFIED' | 'REJECTED';

/** Verification-queue filter: a record status, or ALL for no filter. */
export type RecordQueueFilter = SeafarerRecordStatus | 'ALL';
export type MedicalFitness = 'FIT' | 'FIT_WITH_RESTRICTIONS' | 'UNFIT';
export type SeafarerDepartment = 'DECK' | 'ENGINE' | 'CATERING';
export type SeafarerStatus = 'ACTIVE' | 'INACTIVE' | 'PENDING' | 'SUSPENDED';

/** One engagement aboard one vessel (US-SSM-001). */
/** Denormalised owner summary, present on the verification queues. */
export interface SeafarerProfileSummary {
  id: string;
  firstName: string | null;
  middleName: string | null;
  lastName: string | null;
  seafarerNumber?: string | null;
}

export interface SeaServiceRecord {
  id: string;
  profileId: string;
  profile?: SeafarerProfileSummary;
  vesselName: string;
  imoNumber: string | null;
  vesselType: string | null;
  flagState: string | null;
  grossTonnage: string | number | null;
  rank: string;
  engagementDate: string;
  dischargeDate: string;
  dutiesDescription: string | null;
  status: SeafarerRecordStatus;
  verifiedById: string | null;
  verifiedAt: string | null;
  verificationRemark: string | null;
  createdAt: string;
}

export interface CreateSeaServiceRecord {
  vesselName: string;
  imoNumber?: string;
  vesselType?: string;
  flagState?: string;
  grossTonnage?: number;
  rank: string;
  engagementDate: string;
  dischargeDate: string;
  dutiesDescription?: string;
}

/** An STCW medical fitness certificate (US-SSM-006). */
export interface MedicalCertificate {
  id: string;
  profileId: string;
  profile?: SeafarerProfileSummary;
  issuerName: string;
  certificateNumber: string | null;
  issueDate: string;
  expiryDate: string;
  fitnessStatus: MedicalFitness;
  restrictions: string | null;
  status: SeafarerRecordStatus;
  verifiedById: string | null;
  verifiedAt: string | null;
  verificationRemark: string | null;
  createdAt: string;
}

export interface CreateMedicalCertificate {
  issuerName: string;
  certificateNumber?: string;
  issueDate: string;
  expiryDate: string;
  fitnessStatus?: MedicalFitness;
  restrictions?: string;
}

export interface SeaTimeSummary {
  totalDays: number;
  verifiedRecords: number;
}
