// Main DTO
export interface ProcessedApprovalRecordsResponseDto {
  count: number;
  items: ProcessedApprovalRecords[];
}

// Individual Document Item
export interface ProcessedApprovalRecords {
  createdAt: string; // ISO date string
  updatedAt: string; // ISO date string
  id: string; // UUID]
  referenceNumber: string | null;
  letterNumber: string | null;
  preferredLanguage: "am" | "en";
  submittedDate: string; // ISO date string
  amharicSubmittedDate: string;
  approvedDate: string; // ISO date string
  amharicApprovedDate: string;
  dispatchedDate: string; // ISO date string
  amharicDispatchedDate: string;
  amharicCreatedAt: string;
  isSecured: boolean;
  isUrgent: boolean;
  isDelegation: boolean;
  isMigrated: boolean;
  statusKey: "Dispatched" | "Approved" | string; // Add other statuses as needed
  initiationType: "self" | string;
  initiatorId: string; // UUID
  inReplyToId: string | null;
  inReplyToIncomingInstanceId: string | null;
  recordTypeKey: "internal_memo" | "internal" | "external" | string;
  letterName: string;
  content: ContentItemDto[];
  receivingUnits: ReceivingUnitDto[];
  initiator: InitiatorDto;
  outgoingHistories: OutgoingHistoryDto[];
}

// Content Item
export interface ContentItemDto {
  id: string; // UUID
  subject: string;
  receiverPositions: ReceiverPositionDto[];
  receiverEmployees: ReceiverEmployeeDto[];
  nonSmartReceivers: NonSmartReceiverDto[];
}

// Receiver Position
export interface ReceiverPositionDto {
  id: string; // UUID
  position: PositionDto;
}

// Position
export interface PositionDto {
  id: string; // UUID
  name: LocalizedNameDto;
}

// Localized Name
export interface LocalizedNameDto {
  am: string;
  en: string;
}

// Receiver Employee
export interface ReceiverEmployeeDto {
  id: string; // UUID
  employeePosition: EmployeePositionDto;
}

// Employee Position
export interface EmployeePositionDto {
  id: string; // UUID
  employee: EmployeeDto;
  position: PositionDto;
}

// Employee
export interface EmployeeDto {
  id: string; // UUID
  name: LocalizedNameDto;
}

// Non-Smart Receiver
export interface NonSmartReceiverDto {
  id: string; // UUID
  isCc: boolean;
  name: string;
}

// Receiving Unit
export interface ReceivingUnitDto {
  id: string; // UUID
  unit: UnitDto;
}

// Unit
export interface UnitDto {
  id: string; // UUID
  name: LocalizedNameDto;
  key: string;
}

// Initiator
export interface InitiatorDto {
  id: string; // UUID
  employee: EmployeeDto;
  position: PositionDto;
}

// Outgoing History
export interface OutgoingHistoryDto {
  createdAt: string; // ISO date string
  updatedAt: string; // ISO date string
  id: string; // UUID
  amharicCreatedAt: string;
  action: "send_to_ro" | "send_back" | "approve" | string;
  version: number;
  comment: string;
  employeePosition: EmployeePositionDetailDto;
  delegatedEmployeePosition: EmployeePositionDetailDto | null;
}

// Employee Position Detail (used in history)
export interface EmployeePositionDetailDto {
  id: string; // UUID
  employee: EmployeeDto;
  position: PositionDto;
}
