/**
 * 文件职责：配送设置页面类型定义。
 * 1. 声明页面表单态类型。
 * 2. 声明页面快照与抽屉模式类型。
 */
import type {
  DeliveryGeneralSettingsDto,
  DeliveryMode,
  PolygonZoneDto,
  RadiusTierDto,
} from '#/api/store-delivery';

export type DeliveryDrawerMode = 'create' | 'edit';

export interface RadiusTierFormState {
  color: string;
  deliveryFee: number;
  etaMinutes: number;
  id: string;
  maxDistance: number;
  minDistance: number;
  minOrderAmount: number;
}

export interface PolygonZoneFormState {
  color: string;
  deliveryFee: number;
  etaMinutes: number;
  id: string;
  minOrderAmount: number;
  name: string;
  polygonGeoJson: string;
  priority: number;
}

export interface DeliverySettingsSnapshot {
  generalSettings: DeliveryGeneralSettingsDto;
  mode: DeliveryMode;
  radiusCenterLatitude: null | number;
  radiusCenterLongitude: null | number;
  polygonZones: PolygonZoneDto[];
  radiusTiers: RadiusTierDto[];
}
