export interface DateRange {
  from?: string;
  to?: string;
}

export interface DiscountUsageFilters {
  date_range?: DateRange;
  discount_code?: string;
  discount_id?: number;
  user_id?: number;
  status?: "active" | "inactive" | "expired";
  type?: "percentage" | "fixed" | "fee_percentage";
  application_level?: "invoice" | "category" | "product" | "shipping" | "product_fee";
  min_usage_count?: number;
  include_unused?: boolean;
  sort_by?: "usage_count" | "amount" | "date" | "code" | "created_at";
  sort_order?: "asc" | "desc";
  group_by_code?: boolean;
  limit: number;
  offset: number;
}

export interface DiscountUsage {
  discount_id: number;
  discount_code: string;
  discount_name: string;
  usage_count: number;
  total_amount: number;
  unique_users: number;
  first_used_at: string;
  last_used_at: string;
}

export interface DiscountUsageSummary {
  total_usages: number;
  total_discount_given: number;
  unique_users: number;
  unique_codes: number;
  most_used_code: string;
  most_used_code_count: number;
}

export interface DiscountUsageResponse {
  usages: DiscountUsage[] | null;
  summary: DiscountUsageSummary;
  total: number;
  has_more: boolean;
  limit: number;
  offset: number;
}

export interface CustomerDiscountUsageFilters {
  user_id?: number;
  phone_number?: string;
  date_range?: DateRange;
  discount_code?: string;
  discount_id?: number;
  status?: "active" | "inactive" | "expired";
  sort_by?: "date" | "amount" | "code";
  sort_order?: "asc" | "desc";
  limit: number;
  offset: number;
}

export interface CustomerDiscountUsage {
  discount_usage_id: number;
  user_id: number;
  customer_name: string;
  discount_id: number;
  discount_code: string;
  discount_name: string;
  order_id: number;
  order_number: string;
  amount: number;
  used_at: string;
}

export interface CustomerDiscountUsageSummary {
  total_usages: number;
  total_discount_amount: number;
  unique_codes: number;
  average_discount_per_order: number;
}

export interface CustomerDiscountUsageResponse {
  usages: CustomerDiscountUsage[] | null;
  summary: CustomerDiscountUsageSummary;
  total: number;
  has_more: boolean;
  limit: number;
  offset: number;
}

