import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
import { AdditionalServiceCategory, ExtensionRequestParams, FilterProps, ListItemProps } from '../types';

export enum SmsCl {
  ALL = "ALL",
  VACCOUNT_REQ = "VACCOUNT_REQ",
  VACCOUNT_REQ_DEPOSIT = "VACCOUNT_REQ_DEPOSIT"
}

export enum SmsPaymentSearchCl {
  BUYER_NAME = "BUYER_NAME",
  RECEIVE_PHONE_NUMBER = "RECEIVE_PHONE_NUMBER"
}

export interface SmsPaymentListItem {
  mid?: string;
  tid?: string;
  buyerName?: string;
  buyerPhoneLast4?: string;
  sendDate?: string;
  amount?: number;
  smsTypeName?: string;
  smsCl?: string;
  resendEnabled?: boolean;
}

export interface SmsPaymentListProps {
  listItems: Array<ListItemProps>;
  additionalServiceCategory: AdditionalServiceCategory;
  mid: string;
  onResendClick?: (mid: string, tid: string) => void;
}

export interface SmsPaymentFilterProps extends FilterProps {
  mid: string;
  searchCl: SmsPaymentSearchCl;
  searchValue: string;
  fromDate: string;
  toDate: string;
  smsCl: SmsCl;
  setMid: (mid: string) => void;
  setSearchCl: (searchCl: SmsPaymentSearchCl) => void;
  setSearchValue: (searchValue: string) => void;
  setFromDate: (fromDate: string) => void;
  setToDate: (toDate: string) => void;
  setSmsCl: (smsCl: SmsCl) => void;
}

export interface ExtensionSmsPaymentListParams extends ExtensionRequestParams {
  searchCl: SmsPaymentSearchCl;
  searchValue: string;
  fromDate: string;
  toDate: string;
  smsCl: SmsCl;
  page?: DefaultRequestPagination;
}

export interface ExtensionSmsPaymentListResponse extends DefaulResponsePagination {
  content: Array<ListItemProps>
}

export interface ExtensionSmsDownloadExcelResponse {
  status: boolean;
}

export interface ExtensionSmsDetailResponse {
  senderNumber: string;
  senderName: string;
  receiverNumber: string;
  receiverName: string;
  sendMessage: string;
}

export interface ExtensionSmsResendParams extends ExtensionRequestParams {
  tid: string;
  sendMessage: string;
}


export interface SmsPaymentDetailResendProps {
  bottomSmsPaymentDetailResendOn: boolean;
  setBottomSmsPaymentDetailResendOn: (bottomSmsPaymentDetailResendOn: boolean) => void;
  smsDetailData: ExtensionSmsDetailResponse | null;
  mid: string;
  tid: string;
}

// SMS 결제알림 확장 서비스
// ========================================
export interface ExtensionSmsResendParams extends ExtensionRequestParams {
  tid: string;
}

export interface ExtensionSmsResendResponse {
  status: boolean;
  error?: {
    root?: string;
    errKey?: string;
    code?: string;
    message?: string;
    timestamp?: string;
    details?: {
      path?: string;
    };
  };
}

export interface ExtensionSmsListParams extends ExtensionRequestParams {
  searchCl: string;
  searchValue: string;
  fromDate: string;
  toDate: string;
  smsCl: string;
  page?: DefaultRequestPagination;
}

export interface ExtensionSmsListItemProps {
  mid: string;
  tid: string;
  paymentDate: string;
  paymentStatus: string;
  smsCl: string;
}

export interface ExtensionSmsListResponse extends DefaulResponsePagination {
  content: Array<ExtensionSmsListItemProps>
}

export interface ExtensionSmsDownloadExcelParams extends ExtensionRequestParams {
  searchCl: string;
  searchValue: string;
  fromDate: string;
  toDate: string;
  smsCl: string;

}

export interface ExtensionSmsDownloadExcelResponse {

}

export interface ExtensionSmsDetailParams extends ExtensionRequestParams {
  tid: string;
}