/**
 * 文件职责：规格做法页面共享类型定义。
 * 1. 统一页面状态与表单模型类型。
 * 2. 提供视图层筛选类型约束。
 */
import type {
  ProductSpecDto,
  ProductSpecSelectionType,
  ProductSpecType,
  ProductSwitchStatus,
} from '#/api/product';

export type SpecsTypeFilter = 'all' | ProductSpecType;

export interface SpecEditorValueForm {
  extraPrice: number;
  id: string;
  name: string;
  sort: number;
}

export interface SpecEditorForm {
  id: string;
  isRequired: boolean;
  name: string;
  productIds: string[];
  selectionType: ProductSpecSelectionType;
  sort: number;
  status: ProductSwitchStatus;
  type: ProductSpecType;
  values: SpecEditorValueForm[];
}

export type ProductSpecCardViewModel = ProductSpecDto;
