import type { Dayjs } from 'dayjs';

import type {
  MarketingCouponChannel,
  MarketingCouponDisplayStatus,
  MarketingCouponEditorStatus,
  MarketingCouponListItemDto,
  MarketingCouponStatsDto,
  MarketingCouponStoreScopeMode,
  MarketingCouponType,
  MarketingCouponValidityType,
} from '#/api/marketing';

/**
 * 文件职责：优惠券页面类型定义。
 */

/** 优惠券筛选表单。 */
export interface CouponFilterForm {
  couponType: '' | MarketingCouponType;
  status: '' | MarketingCouponDisplayStatus;
}

/** 优惠券编辑抽屉表单。 */
export interface CouponEditorForm {
  channels: MarketingCouponChannel[];
  couponType: MarketingCouponType;
  id: string;
  minimumSpend: null | number;
  name: string;
  perUserLimit: null | number;
  relativeValidDays: null | number;
  status: MarketingCouponEditorStatus;
  storeIds: string[];
  storeScopeMode: MarketingCouponStoreScopeMode;
  totalQuantity: number;
  validDateRange: [Dayjs, Dayjs] | null;
  validityType: MarketingCouponValidityType;
  value: null | number;
}

/** 优惠券卡片视图模型。 */
export type CouponCardViewModel = MarketingCouponListItemDto;

/** 优惠券统计视图模型。 */
export type CouponStatsViewModel = MarketingCouponStatsDto;
