export enum Semester {
    Odd = 'odd',
    Even = 'even',
}

export const SemesterLabels: Record<Semester, string> = {
    [Semester.Odd]: 'Ganjil',
    [Semester.Even]: 'Genap',
};

export type AcademicTerm = {
    id: number;
    name: string;
    semester: Semester;
    start_date: string;
    formatted_start_date: string;
    end_date: string;
    formatted_end_date: string;
    is_active: boolean;
    created_at: string;
    updated_at: string;
};

export function formatAcademicTermLabel(term: {
    name: string;
    semester: string;
}): string {
    const label = SemesterLabels[term.semester as Semester];

    return label ? `${term.name} (${label})` : term.name;
}
