import type { QTableColumn } from "quasar"; export class TimesheetApprovalOverview { email: string; employee_first_name: string; employee_last_name: string; supervisor: { first_name: string; last_name: string; email: string; } | null; is_active: boolean; 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; constructor() { this.email = ''; this.employee_first_name = 'Unknown'; this.employee_last_name = 'Unknown'; this.supervisor = null; this.is_active = true; this.regular_hours = 0; this.other_hours = { evening_hours: 0, emergency_hours: 0, overtime_hours: 0, sick_hours: 0, holiday_hours: 0, vacation_hours: 0, } this.total_hours = 0; this.expenses = 0; this.mileage = 0; this.is_approved = false; }; } export interface PayPeriodOverviewResponse { pay_period_no: number; pay_year: number; period_start: string; period_end: string; payday: string; label: string; employees_overview: TimesheetApprovalOverview[]; } export interface PayPeriodOverviewFilters { is_showing_inactive: boolean; is_showing_team_only: boolean; supervisors: string[]; name_search_string: string; } 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', IS_ACTIVE: 'is_active', } 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, }, { name: overview_column_names.IS_ACTIVE, label: 'timesheet_approvals.table.is_active', field: 'is_active', sortable: true, } ]