/**
 * Coupon Types
 * Central type definitions for coupon-related data structures
 */

export interface Coupon {
  id: number;
  couponCode: string;
  isUserBased: boolean;
  discountPercent: string | null;
  flatDiscount: string | null;
  minOrder: string | null;
  productIds: number[] | null;
  maxValue: string | null;
  isApplyForAll: boolean;
  validTill: Date | null;
  maxLimitForUser: number | null;
  exclusiveApply: boolean;
  isInvalidated: boolean;
  createdAt: Date;
  createdBy: number;
}

export interface ReservedCoupon extends Coupon {
  secretCode: string;
  redeemedUserId: number | null;
  redeemedAt: Date | null;
}

export interface CouponValidationResult {
  valid: boolean;
  message?: string;
  discountAmount?: number;
  coupon?: Partial<Coupon>;
}

export interface UserMiniInfo {
  id: number;
  name: string;
  mobile: string | null;
}
