export const AttendanceStatuses = ['present', 'absent'] as const;

export type AttendanceStatus = (typeof AttendanceStatuses)[number];

export const AttendanceStatusLabels: Record<AttendanceStatus, string> = {
    present: 'Hadir',
    absent: 'Tidak Hadir',
};

export type AttendanceCourseClass = {
    id: number;
    course: { id: number; code: string; name: string } | null;
    academic_term?: {
        id: number;
        academic_year: string;
        semester: string;
    } | null;
};

export type AttendanceCourseClassOverview = AttendanceCourseClass & {
    enrollments_count: number;
    meetings_count: number;
};

export type AttendanceSession = {
    meeting_number: number;
    date: string;
    total_count: number;
    present_count: number;
};

export type AttendanceRosterStudent = {
    id: number;
    student_number: string;
    user: { profile: { full_name: string } | null } | null;
};

export type AttendanceRosterEntry = {
    student_id: number;
    student: AttendanceRosterStudent | null;
    status: AttendanceStatus;
};

export type AttendanceRecord = {
    course_class_id: number;
    meeting_number: number | null;
    date: string;
    status: AttendanceStatus;
};

export type AttendanceClassSummary = {
    course_class: AttendanceCourseClass;
    records: AttendanceRecord[];
    present_count: number;
    total_count: number;
};
