/**
 * 文件职责：员工排班页面类型定义。
 * 1. 声明筛选、抽屉、周排班编辑等页面状态类型。
 * 2. 约束组件之间的数据结构与事件载荷。
 */
import type {
  ShiftType,
  StaffDayShiftDto,
  StaffRoleType,
  StaffStatus,
  StoreShiftTemplatesDto,
} from '#/api/store-staff';

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

export interface StaffFilterState {
  keyword: string;
  page: number;
  pageSize: number;
  roleType: '' | StaffRoleType;
  status: '' | StaffStatus;
}

export interface StaffEditorFormState {
  email: string;
  id: string;
  name: string;
  permissions: string[];
  phone: string;
  roleType: StaffRoleType;
  status: StaffStatus;
}

export interface StaffPersonalScheduleFormState {
  roleType: StaffRoleType;
  shifts: StaffDayShiftDto[];
  staffId: string;
  staffName: string;
}

export interface WeekEditorRow {
  roleType: StaffRoleType;
  shifts: StaffDayShiftDto[];
  staffId: string;
  staffName: string;
  status: StaffStatus;
}

export interface ShiftOption {
  className: string;
  label: string;
  value: ShiftType;
}

export interface DayOption {
  dayOfWeek: number;
  label: string;
  shortLabel: string;
}

export interface StaffRoleOption {
  label: string;
  tagClassName: string;
  value: StaffRoleType;
}

export interface StaffStatusOption {
  dotClassName: string;
  label: string;
  value: StaffStatus;
}

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

export interface ShiftLegendItem {
  className: string;
  label: string;
  timeText: string;
  type: Exclude<ShiftType, 'off'>;
}

export interface StaffScheduleSnapshot {
  scheduleMap: Record<string, StaffDayShiftDto[]>;
  templates: StoreShiftTemplatesDto;
}
