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

export interface Coupon {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  code: string;
  name: string;
  description: string;
  type: "PERCENTAGE" | "FIXED";
  value: number;
  maxDiscount: number | null;
  minOrderAmount: number;
  maxUses: number;
  usedCount: number;
  maxUsesPerUser: number | null;
  startDate: string | null;
  endDate: string | null;
  isActive: boolean;
  foodCategories: unknown | null;
  foods: unknown | null;
  userPhone: string | null;
}

export type CouponsResponse = BaseResponse<Coupon[]>;

export interface Wallet {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  user: string;
  wallet: number;
  points: number;
}

export type WalletResponse = BaseResponse<Wallet>;

export interface WalletBalance {
  balance: number;
}

export type WalletBalanceResponse = BaseResponse<WalletBalance>;

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

export interface TransactionOrder {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  user: string;
  restaurant: string;
  deliveryMethod: string;
  address: string | null;
  paymentMethod: PaymentMethod;
  orderNumber: number;
  couponDiscount: number;
  couponDetail: unknown | null;
  itemsDiscount: number;
  totalDiscount: number;
  subTotal: number;
  tax: number;
  deliveryFee: number;
  total: number;
  totalItems: number;
  description: string | null;
  tableNumber: string;
  status: string;
  paymentStatus: string;
}

export interface Transaction {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  order: TransactionOrder;
  amount: number;
  authority: string | null;
  gateway: string | null;
  refId: string | null;
  status: string;
  cardPan: string | null;
  verifyResponse: unknown | null;
  paidAt: string | null;
  failedAt: string | null;
}

export type TransactionsResponse = BaseResponse<Transaction[]>;
