export interface Transaction {
  id: string;
  msisdn: string;
  operator: string;
  operatorId: string;
  country: string;
  amount: number;
  currency: string;
  status: TransactionStatus;
  productId: string;
  productName: string;
  productCategory: string;
  transactionDate: Date;
  createdAt: Date;
  updatedAt: Date;
  externalId?: string;
  merchantId?: string;
  merchantName?: string;
  errorCode?: string;
  errorMessage?: string;
  userAgent?: string;
  ipAddress?: string;
  customData?: { [key: string]: any };
}

export interface TransactionQuery {
  page?: number;
  limit?: number;
  search?: string;
  status?: TransactionStatus;
  operator?: string;
  country?: string;
  startDate?: Date;
  endDate?: Date;
  msisdn?: string;
  productId?: string;
  merchantId?: string;
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
}

export interface TransactionStats {
  total: number;
  totalAmount: number;
  successCount: number;
  failedCount: number;
  pendingCount: number;
  refundedCount: number;
  successRate: number;
  averageAmount: number;
}

export interface PaginatedTransactions {
  data: Transaction[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
  stats: TransactionStats;
}

export type TransactionStatus = 
  | 'PENDING'
  | 'SUCCESS' 
  | 'FAILED'
  | 'REFUNDED'
  | 'CANCELLED'
  | 'EXPIRED';

export interface RefundRequest {
  transactionId: string;
  reason?: string;
  amount?: number;
}

export interface TransactionExportRequest {
  format: 'csv' | 'excel' | 'pdf';
  query: TransactionQuery;
  columns?: string[];
}