import type {Attendance} from '@/features/staff/types/staff';
import type {StatusDotVariant} from '@astryxdesign/core/StatusDot';

/**
 * Attendance is the one place in this app where semantic colour applies to
 * every value rather than to an exception.
 *
 * Elsewhere the rule is "most things gray, colour marks what needs action".
 * Here the whole vocabulary IS status: present/late/absent map cleanly onto
 * success/warning/error, and a merchant scanning a roster is reading exactly
 * that axis. Greying three of the four would make the set harder to scan, not
 * calmer. On leave stays neutral — it is planned, so it needs no attention.
 */
export const ATTENDANCE: Record<
  Attendance,
  {label: string; tone: StatusDotVariant; badge: 'success' | 'warning' | 'error' | 'neutral'}
> = {
  present: {label: 'Present', tone: 'success', badge: 'success'},
  late: {label: 'Late', tone: 'warning', badge: 'warning'},
  absent: {label: 'Absent', tone: 'error', badge: 'error'},
  leave: {label: 'On leave', tone: 'neutral', badge: 'neutral'},
};

export const ATTENDANCE_ORDER: Attendance[] = [
  'present',
  'late',
  'absent',
  'leave',
];
