import { FilterEnum } from "@/shared/services/organizationsService";

// create-user.dto.ts
export interface MultilingualText {
  am: string;
  en: string;
}
export interface CreateUserDto {
  email: string;
  username: string;
  phoneNumber: string;
  userType: string;
  name: {
    am: string;
    en: string;
  };
}
export interface FayidaUserDto {
  code: string;
  redirectUri?: string;
}

// create-letter.interface.ts

export interface FileInfo {
  fileName: string;
  contentType: string;
  size: number;
  originalname: string;
}

export interface CreateLetterDto {
  fileInfo: FileInfo;
  subject: string;
  unitIds: string[];
  letterNumber: string;
  preferredLanguage: "am" | "en";
}

export interface FileInfoDto {
  size: number;
  bucket: string;
  fileName: string;
  contentType: string;
  originalname: string;
}

export interface LetterRecordDto {
  amharicCreatedAt: any;
  createdAt: any;
  id: string;
  fileInfo: FileInfoDto;
  referenceNumber: string | null;
  letterNumber: string; // ✅ newly added
  dispatchedDate: string; // ISO string
  amharicDispatchedDate: string;
  statusKey: "Dispatched" | "Submitted" | "Draft" | "Rejected" | string;
  initiationType: "self" | "external" | string;
  //
  receivingUnits: {
    id: string;
    unit: {
      id: string;
      name: {
        am: string;
        en: string;
      };
    };
  }[];

  content: {
    id: string;
    subject: string;
  }[];
}

export interface DocumentPayloadDto {
  fileInfo: FileInfo;
  documentId: string;
  type: FilterEnum;
}

export type DocumentStatus = "pending" | "approved" | "rejected";

export interface DocumentResponseDto {
  id: string;
  userId: string;
  documentId: string;
  createdAt: string; // ISO datetime string
  updatedAt: string; // ISO datetime string
  uploadedSuccessfully: boolean;
  isCurrent: boolean;
  status: "pending" | "approved" | "rejected";
  fileInfo: {
    size: number;
    bucket: string;
    fileName: string;
    bucketName?: string; // optional if not always present
    contentType: string;
    originalname: string;
  };
  presigned: string; // Pre-signed URL for download/view
}

export interface DocumentRequirementDto {
  title: {
    am: string;
    en: string;
  };
  description: {
    am: string;
    en: string;
  };
  isOptional: boolean;
  order: number;
  key: string;
  type: string;
}

export interface FilesInfoDto {
  size: number;
  bucket: string;
  fileName: string;
  bucketName: string;
  contentType: string;
  originalname: string;
}

export interface DocumentRequirementResponseDto {
  id: string;
  title: MultilingualText;
  description: MultilingualText;
  key: string;
  order: number;
  isActive: boolean;
  isOptional: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface DocumentRequirementsResponse {
  count: number;
  items: DocumentRequirementResponseDto[];
}

export interface ResponseActionDto {
  status: string;
  remark?: string;
}
