declare namespace API {
  interface DefaultObjectResponse<T = any> {
    data: T;
    status: boolean | number;
    code: number;
  }
  interface DefaultListResponse<T = any> {
    data: T[];
    status: boolean;
    code: number;
  }
  interface Staff {
    id: string;
    token: string;
  }
  interface SignInData {
    account: string;
    password: string;
  }
  interface RefundData {
    reserverId: string;
    amount: number;
    reason: string;
    referenceReservationId: string;
    executor: string;
  }
  interface BindIcData {
    id: string;
    icCardId: string;
  }
  interface CustomerTransaction {
    createdAt: string;
    updatedAt: string;
    id: string;
    snapshot: TransactionSnapshot;
    amount: number;
    goods_name: string;
    status_fk: number;
  }
  interface TransactionSnapshot {
    with_coupon: boolean;
    type: string;
    stationID: string;
    connector: string;
    user: string;
    book_time: string;
    end_time: string;
    total_power: number;
    total_fee: number;
    promotion_code: string[];
    car: string;
    is_ic_call: boolean;
  }
  interface TopUpTransaction {
    id: string;
    createdAt: string;
    updatedAt: string;
    user_id: string;
    out_trade_no: string;
    amount: number;
    snapshot: {
      cash_fee_type: string;
      exchange_rate: string;
      cancel: string;
      pay_type: string;
      txdtm: string;
      out_trade_no: string;
      syssn: string;
      status: string;
      sysdtm: string;
      paydtm: string;
      goods_name: string;
      txcurrcd: string;
      mchid: string;
      customer_source: string;
      cash_fee: string;
      chnlsn2: string;
      cardcd: string;
      txamt: string;
      outcardnm: string;
      respcd: string;
      goods_info: string;
      notify_type: string;
      chnlsn: string;
    };
    user: {
      id: string;
      nickname: string;
      email: string;
      phone: string;
      wallet: number;
    };
  }

  export type EnumCouponCondition = {
    LimitByOrderAmount: boolean;
    MinOrderAmount: boolean;
    CanCombine: boolean;
    OneCouponPerOrder: boolean;
    isRefundableRemain: boolean;
  };

  interface SendCouponData {
    coupon_id: string;
    receiver_id: string;
    distributor_type: 'customer';
    reservation_id: string;
  }
  interface UpdateCouponPermissionData {
    id: string;
    permission: boolean;
  }
  interface CreateCouponData {
    id?: string;
    name: string;
    amount: number;
    unit: string;
    min_purchase_amount: string;
    max_discount_amount?: string | null;
    redeem_code?: string;
    description: string;
    valid_date: number;
    permission: boolean;
    condition: EnumCouponCondition;
  }

  interface CouponData extends CreateCouponData {
    id: string;
    createdAt: string;
    updatedAt: string;
  }

  // 可选：添加优惠券类型枚举
  enum CouponType {
    Regular = 'Regular',
    Special = 'Special',
  }

  interface CouponResponse {
    status: number;
    data: CouponData[];
  }
  interface TimePrice {
    from: string;
    to: string;
    price: number;
  }

  interface PriceEvent {
    id: string;
    event_name: string;
    mon: TimePrice;
    tue: TimePrice;
    wed: TimePrice;
    thu: TimePrice;
    fri: TimePrice;
    sat: TimePrice;
    sun: TimePrice;
    special: TimePrice;
    is_active: boolean;
    expire_date: number;
    createdAt: string;
    updatedAt: string;
  }
  interface Advertise {
    id: string;
    createdAt: string;
    updatedAt: string;
    title: string;
    text: string;
    image_url: string;
    is_show: boolean;
    is_main: boolean;
  }

  // 如果需要创建广告的接口
  interface CreateAdvertisement {
    title: string;
    text: string;
    image_url: File;
    is_show: boolean;
    is_main: boolean;
  }

  // 如果需要更新广告的接口
  interface UpdateAdvertisement {
    id: string;
    title?: string;
    text?: string;
    image_url?: string;
    is_show?: boolean;
    is_main?: boolean;
  }
}
