import type {
  ProductKind,
  ProductStatus,
  ProductSwitchStatus,
} from '#/api/product';

export interface ProductDetailSectionItem {
  id: string;
  title: string;
}

export interface ProductDetailCategoryOption {
  label: string;
  value: string;
}

export interface ProductDetailPillOption {
  count?: number;
  id: string;
  name: string;
  status?: ProductSwitchStatus;
}

export interface ProductDetailSkuAttrState {
  optionId: string;
  templateId: string;
}

export interface ProductDetailSkuRowState {
  attributes: ProductDetailSkuAttrState[];
  id: string;
  isEnabled: boolean;
  originalPrice: null | number;
  price: number;
  skuCode: string;
  sortOrder: number;
  stock: number;
}

export interface ProductDetailComboGroupItemState {
  productId: string;
  productName: string;
  quantity: number;
  sortOrder: number;
}

export interface ProductDetailComboGroupState {
  items: ProductDetailComboGroupItemState[];
  maxSelect: number;
  minSelect: number;
  name: string;
  sortOrder: number;
}

export interface ProductDetailFormState {
  addonGroupIds: string[];
  categoryId: string;
  comboGroups: ProductDetailComboGroupState[];
  description: string;
  id: string;
  imageUrls: string[];
  kind: ProductKind;
  labelIds: string[];
  name: string;
  originalPrice: null | number;
  packingFee: null | number;
  price: number;
  shelfMode: 'draft' | 'now' | 'scheduled';
  skus: ProductDetailSkuRowState[];
  sortWeight: number;
  specTemplateIds: string[];
  status: ProductStatus;
  stock: number;
  subtitle: string;
  timedOnShelfAt: string;
  warningStock: null | number;
}

export interface ProductDetailSkuBatchState {
  price: null | number;
  stock: null | number;
}
