import type { QTableColumn } from "quasar";

/* eslint-disable */
export enum NavigatorConstants {
  NEXT_PERIOD = 1,
  PREVIOUS_PERIOD = -1,
}

export interface TimesheetOverview {
    email: string;
    employee_name: string;
    regular_hours: number;
    other_hours: {
        evening_hours: number;
        emergency_hours: number;
        overtime_hours: number;
        sick_hours: number;
        holiday_hours: number;
        vacation_hours: number;
    };
    total_hours: number;
    expenses: number;
    mileage: number;
    is_approved: boolean;
}

export interface PayPeriodOverviewResponse {
  pay_period_no: number;
  pay_year: number;
  period_start: string;
  period_end: string;
  payday: string;
  label: string;
  employees_overview: TimesheetOverview[];
}

export const default_pay_period_overview: TimesheetOverview = {
    email: '',
    employee_name: '',
    regular_hours: -1,
    other_hours: {
        evening_hours: -1,
        emergency_hours: -1,
        overtime_hours: -1,
        sick_hours: -1,
        holiday_hours: -1,
        vacation_hours: -1,
    },
    total_hours: -1,
    expenses: -1,
    mileage: -1,
    is_approved: false
}

export const overview_column_names = {
    EMPLOYEE_NAME: 'employee_name',
    EMAIL: 'email',
    REGULAR: 'REGULAR',
    EVENING: 'EVENING',
    EMERGENCY: 'EMERGENCY',
    SICK: 'SICK',
    HOLIDAY: 'HOLIDAY',
    VACATION: 'VACATION',
    OVERTIME: 'OVERTIME',
    EXPENSES: 'expenses',
    MILEAGE: 'mileage',
    IS_APPROVED: 'is_approved', 
}

export const pay_period_overview_columns: QTableColumn[] = [
    { 
        name: overview_column_names.EMPLOYEE_NAME, 
        label: 'timesheet_approvals.table.full_name', 
        align: 'left', 
        field: 'employee_name',
        sortable: true,
        required: true, 
    },
    { 
        name: overview_column_names.EMAIL, 
        label: 'timesheet_approvals.table.email',
        align: 'left', 
        field: 'email', 
        sortable: true,
    },
    { 
        name: overview_column_names.REGULAR, 
        label: 'shared.shift_type.regular',
        align: 'left', 
        field: 'regular_hours', 
        sortable: true, 
    },
    { 
        name: overview_column_names.EVENING, 
        label: 'shared.shift_type.evening',
        align: 'left',
        field: row => row.other_hours.evening_hours,
        sortable: true, 
    },
    { 
        name: overview_column_names.EMERGENCY, 
        label: 'shared.shift_type.emergency', 
        align: 'left',
        field: row => row.other_hours.emergency_hours,
        sortable: true, 
    },
     { 
        name: overview_column_names.SICK, 
        label: 'shared.shift_type.sick', 
        align: 'left',
        field: row => row.other_hours.sick_hours, 
        sortable: true, 
    },
    { 
        name: overview_column_names.HOLIDAY, 
        label: 'shared.shift_type.holiday', 
        align: 'left',
        field: row => row.other_hours.holiday_hours,
        sortable: true, 
    },
    { 
        name: overview_column_names.VACATION, 
        label: 'shared.shift_type.vacation', 
        align: 'left',
        field: row => row.other_hours.vacation_hours,
        sortable: true, 
    },
    { 
        name: overview_column_names.OVERTIME, 
        label: 'shared.shift_type.overtime', 
        align: 'left',
        field: row => row.other_hours.overtime_hours,
        sortable: true,
    },
    { 
        name: overview_column_names.EXPENSES, 
        label: 'timesheet_approvals.table.expenses', 
        align: 'left',
        field: 'expenses', 
        sortable: true, 
    },
    { 
        name: overview_column_names.MILEAGE, 
        label: 'timesheet_approvals.table.mileage', 
        align: 'left',
        field: 'mileage', 
        sortable: true,
    },
    {
        name: overview_column_names.IS_APPROVED,
        label: 'timesheet_approvals.table.is_approved',
        field: 'is_approved',
        sortable: true,
    }
]