export interface EmailAddress {
  address: string;
  name: string;
}

export interface TrashMessage extends Record<string, unknown> {
  id: number;
  mailbox: string;
  thread: string;
  from: EmailAddress;
  to: EmailAddress[];
  cc: EmailAddress[];
  bcc: EmailAddress[];
  messageId: string;
  subject: string;
  date: string;
  idate: string;
  intro: string;
  attachments: boolean;
  attachmentsList: unknown[];
  size: number;
  seen: boolean;
  deleted: boolean;
  flagged: boolean;
  draft: boolean;
  answered: boolean;
  forwarded: boolean;
  references: string[];
  contentType: {
    value: string;
    params: {
      boundary: string;
    };
  };
}

export interface MessageListQueryDto {
  next?: string;
  previous?: string;
  limit?: number;
  search?: string;
  from?: string;
  subject?: string;
  datestart?: string;
  dateend?: string;
  attachments?: boolean;
  unseen?: boolean;
  flagged?: boolean;
  order?: "asc" | "desc";
}

export interface TrashResponse {
  statusCode: number;
  success: boolean;
  data: {
    trashMails: TrashMessage[];
    pager: {
      page: number;
      totalPages: number;
      totalItems: number;
      limit: number;
      previousCursor: string | boolean;
      nextCursor: string | boolean;
    };
  };
}

export interface Pager {
  page: number;
  limit: number;
  totalItems: number;
  totalPages: number;
  previousCursor: string | boolean;
  nextCursor: string | boolean;
}
