import { BaseResponse } from "@/app/[name]/(Main)/types/Types";

export interface VerifyType {
  authority: string;
  orderId: string;
}

export interface VerifyOrderHistory {
  status: string;
  changedAt: string;
}

export interface VerifyPaymentMethod {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  method: string;
  gateway: string;
  description: string;
  enabled: boolean;
  order: number;
  merchantId: string;
}

export interface VerifyOrder {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  user: string;
  restaurant: string;
  deliveryMethod: string;
  userAddress: string | null;
  carAddress: string | null;
  paymentMethod: VerifyPaymentMethod;
  orderNumber: number;
  couponDiscount: number;
  couponDetail: unknown | null;
  itemsDiscount: number;
  totalDiscount: number;
  subTotal: number;
  tax: number;
  deliveryFee: number;
  total: number;
  totalItems: number;
  description: string;
  tableNumber: string;
  status: string;
  history: VerifyOrderHistory[];
}

export interface VerifyResponseData {
  data: {
    fee: number;
    code: number;
    wages: unknown | null;
    ref_id: number;
    message: string;
    card_pan: string;
    fee_type: string;
    order_id: string;
    card_hash: string;
    shaparak_fee: number;
  };
  errors: unknown[];
}

export interface VerifyData {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  order: VerifyOrder;
  amount: number;
  referenceId: string;
  method: string;
  gateway: string;
  transactionId: string;
  status: string;
  cardPan: string | null;
  verifyResponse: VerifyResponseData;
  paidAt: string;
  failedAt: string | null;
  description: string | null;
}

export type VerifyResponse = BaseResponse<VerifyData>;
