/**
 * 文件职责：员工排班页面常量定义。
 * 1. 提供角色/状态/班次等选项源。
 * 2. 提供页面默认值与分页配置。
 */
import type { StoreShiftTemplatesDto } from '#/api/store-staff';
import type {
  DayOption,
  ShiftOption,
  StaffEditorFormState,
  StaffFilterState,
  StaffPermissionOption,
  StaffRoleOption,
  StaffStatusOption,
} from '#/views/store/staff/types';

export const DAY_OPTIONS: DayOption[] = [
  { dayOfWeek: 0, label: '周一', shortLabel: '一' },
  { dayOfWeek: 1, label: '周二', shortLabel: '二' },
  { dayOfWeek: 2, label: '周三', shortLabel: '三' },
  { dayOfWeek: 3, label: '周四', shortLabel: '四' },
  { dayOfWeek: 4, label: '周五', shortLabel: '五' },
  { dayOfWeek: 5, label: '周六', shortLabel: '六' },
  { dayOfWeek: 6, label: '周日', shortLabel: '日' },
];

export const SHIFT_OPTIONS: ShiftOption[] = [
  {
    value: 'morning',
    label: '早班',
    className: 'shift-morning',
  },
  {
    value: 'evening',
    label: '晚班',
    className: 'shift-evening',
  },
  {
    value: 'full',
    label: '全天',
    className: 'shift-full',
  },
  {
    value: 'off',
    label: '休息',
    className: 'shift-off',
  },
];

export const SHIFT_CYCLE = SHIFT_OPTIONS.map((item) => item.value);

export const STAFF_ROLE_OPTIONS: StaffRoleOption[] = [
  {
    value: 'manager',
    label: '店长',
    tagClassName: 'role-manager',
  },
  {
    value: 'cashier',
    label: '收银员',
    tagClassName: 'role-cashier',
  },
  {
    value: 'courier',
    label: '配送员',
    tagClassName: 'role-courier',
  },
  {
    value: 'chef',
    label: '厨师',
    tagClassName: 'role-chef',
  },
];

export const STAFF_STATUS_OPTIONS: StaffStatusOption[] = [
  {
    value: 'active',
    label: '在职',
    dotClassName: 'status-dot-active',
  },
  {
    value: 'leave',
    label: '休假',
    dotClassName: 'status-dot-leave',
  },
  {
    value: 'resigned',
    label: '离职',
    dotClassName: 'status-dot-resigned',
  },
];

export const STAFF_PERMISSION_OPTIONS: StaffPermissionOption[] = [
  { value: '收银', label: '收银' },
  { value: '退款', label: '退款' },
  { value: '配送管理', label: '配送管理' },
  { value: '订单查看', label: '订单查看' },
  { value: '库存管理', label: '库存管理' },
  { value: '数据统计', label: '数据统计' },
];

export const EMPTY_SHIFT_TEMPLATES: StoreShiftTemplatesDto = {
  morning: {
    startTime: '',
    endTime: '',
  },
  evening: {
    startTime: '',
    endTime: '',
  },
  full: {
    startTime: '',
    endTime: '',
  },
};

export const DEFAULT_FILTER_STATE: StaffFilterState = {
  keyword: '',
  roleType: '',
  status: '',
  page: 1,
  pageSize: 10,
};

export const DEFAULT_STAFF_FORM: StaffEditorFormState = {
  id: '',
  name: '',
  phone: '',
  email: '',
  roleType: 'cashier',
  status: 'active',
  permissions: [],
};

export const PAGE_SIZE_OPTIONS = [10, 20, 50];
