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 EmailAddress {
  address: string;
  name: string;
}

export interface ContentType {
  value: string;
  params: {
    boundary: string;
  };
}

export interface InboxMessage 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: unknown[];
  contentType: ContentType;
}

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

export interface InboxResponse {
  statusCode: number;
  success: boolean;
  data: {
    pager: Pager;
    sentMails: InboxMessage[];
  };
}

export interface MessageDetail extends InboxMessage {
  body: string;
}

export interface MessageDetailResponse {
  statusCode: number;
  success: boolean;
  data: {
    message: MessageDetail;
  };
}
