export interface PaymobUserTokenResponse {
  token: string;
  profile: PaymobProfile;
}
export interface PaymobProfile {
  id: string;
  user: PaymobUser;
}
export interface PaymobUser {
  id: number;
  username: string;
  first_name: string;
  last_name: string;
  date_joined: string;
  email: string;
  is_active: boolean;
  is_staff: boolean;
  is_superuser: boolean;
  last_login: string | null;
  groups: number[];
  user_permissions: number[];
}

export enum PaymobPaymentType {
  card = "card",
  kiosk = "kiosk",
}

export interface PaymobResponseFinal {
  token: string;
}

export interface PaymobOrderResponse {
  id: number;
  created_at: string;
  delivery_needed: boolean;
  merchant: {
    id: number;
    created_at: string;
    phones: string[];
    company_emails: string[];
    company_name: string;
    state: string;
    country: string;
    city: string;
    postal_code: string;
    street: string;
  };
  collector: null | any; // You can replace 'any' with a specific type if needed
  amount_cents: number;
  shipping_data: null | any; // You can replace 'any' with a specific type if needed
  currency: string;
  is_payment_locked: boolean;
  is_return: boolean;
  is_cancel: boolean;
  is_returned: boolean;
  is_canceled: boolean;
  merchant_order_id: string;
  wallet_notification: null | any; // You can replace 'any' with a specific type if needed
  paid_amount_cents: number;
  notify_user_with_email: boolean;
  items: {
    name: string;
    description: string;
    amount_cents: number;
    quantity: number;
  }[];
  order_url: string;
  commission_fees: number;
  delivery_fees_cents: number;
  delivery_vat_cents: number;
  payment_method: string;
  merchant_staff_tag: null | any; // You can replace 'any' with a specific type if needed
  api_source: string;
  data: {};
  token: string;
  url: string;
}

export interface PaymobTransactionResponse {
  type: string;
  obj: Obj;
  issuer_bank: null;
  transaction_processed_callback_responses: string;
}

export interface Obj {
  id: number;
  pending: boolean;
  amount_cents: number;
  success: boolean;
  is_auth: boolean;
  is_capture: boolean;
  is_standalone_payment: boolean;
  is_voided: boolean;
  is_refunded: boolean;
  is_3d_secure: boolean;
  integration_id: number;
  profile_id: number;
  has_parent_transaction: boolean;
  order: Order;
  created_at: Date;
  transaction_processed_callback_responses: any[];
  currency: string;
  source_data: SourceData;
  api_source: string;
  terminal_id: null;
  merchant_commission: number;
  installment: null;
  discount_details: any[];
  is_void: boolean;
  is_refund: boolean;
  data: ObjData;
  is_hidden: boolean;
  payment_key_claims: PaymentKeyClaims;
  error_occured: boolean;
  is_live: boolean;
  other_endpoint_reference: null;
  refunded_amount_cents: number;
  source_id: number;
  is_captured: boolean;
  captured_amount: number;
  merchant_staff_tag: null;
  updated_at: Date;
  is_settled: boolean;
  bill_balanced: boolean;
  is_bill: boolean;
  owner: number;
  parent_transaction: null;
}

export interface ObjData {
  message: string;
  txn_response_code: string;
  acq_response_code: string;
}

export interface Order {
  id: number;
  created_at: Date;
  delivery_needed: boolean;
  merchant: Merchant;
  collector: null;
  amount_cents: number;
  shipping_data: IngData;
  currency: string;
  is_payment_locked: boolean;
  is_return: boolean;
  is_cancel: boolean;
  is_returned: boolean;
  is_canceled: boolean;
  merchant_order_id: string;
  wallet_notification: null;
  paid_amount_cents: number;
  notify_user_with_email: boolean;
  items: Item[];
  order_url: string;
  commission_fees: number;
  delivery_fees_cents: number;
  delivery_vat_cents: number;
  payment_method: string;
  merchant_staff_tag: null;
  api_source: string;
  data: ExtraClass;
}

export interface ExtraClass {}

export interface Item {
  name: string;
  description: string;
  amount_cents: number;
  quantity: number;
}

export interface Merchant {
  id: number;
  created_at: Date;
  phones: string[];
  company_emails: string[];
  company_name: string;
  state: string;
  country: string;
  city: string;
  postal_code: string;
  street: string;
}

export interface IngData {
  id?: number;
  first_name: string;
  last_name: string;
  street: string;
  building: string;
  floor: string;
  apartment: string;
  city: string;
  state: string;
  country: string;
  email: string;
  phone_number: string;
  postal_code: string;
  extra_description: string;
  shipping_method?: string;
  order_id?: number;
  order?: number;
}

export interface PaymentKeyClaims {
  user_id: number;
  amount_cents: number;
  currency: string;
  integration_id: number;
  order_id: number;
  billing_data: IngData;
  lock_order_when_paid: boolean;
  extra: ExtraClass;
  single_payment_attempt: boolean;
  exp: number;
  pmk_ip: string;
}

export interface SourceData {
  type: string;
  pan: string;
  sub_type: string;
  tenure: null;
}
