@@ -217,13 +236,15 @@
onClickedDetails(email, props.row.employee_name)"
+ @update-approval="value => updateEmployeeApprovalStatus(props.key, value)"
/>
diff --git a/src/modules/timesheet-approval/types/timesheet-approval-pay-period-employee-details-interface.ts b/src/modules/timesheet-approval/types/timesheet-approval-pay-period-employee-details-interface.ts
index ab04ad0..bc8955e 100644
--- a/src/modules/timesheet-approval/types/timesheet-approval-pay-period-employee-details-interface.ts
+++ b/src/modules/timesheet-approval/types/timesheet-approval-pay-period-employee-details-interface.ts
@@ -1,7 +1,6 @@
import type { TimesheetDetailsWeek } from "src/modules/timesheets/types/timesheet-details-interface";
export interface PayPeriodEmployeeDetails {
- // is_approved: boolean;
week1: TimesheetDetailsWeek;
week2: TimesheetDetailsWeek;
};
\ No newline at end of file
diff --git a/src/modules/timesheets/types/timesheet-details-interface.ts b/src/modules/timesheets/types/timesheet-details-interface.ts
index ab4aee5..b9d940d 100644
--- a/src/modules/timesheets/types/timesheet-details-interface.ts
+++ b/src/modules/timesheets/types/timesheet-details-interface.ts
@@ -2,8 +2,8 @@ import type { Shift } from "./timesheet-shift-interface";
export interface TimesheetDetailsWeek {
is_approved: boolean;
- shifts: WeekDay
;
- expenses: WeekDay;
+ shifts: WeekDay;
+ expenses: WeekDay;
}
type WeekDay = {
@@ -16,9 +16,17 @@ type WeekDay = {
sat: T;
}
-type TimesheetDetailsWeekDayShifts = Shift[];
+interface TimesheetDetailsDailySchedule {
+ shifts: Shift[];
+ regular_hours: number;
+ evening_hours: number;
+ emergency_hours: number;
+ overtime_hours: number;
+ short_date: string; // ex. 08/24
+ break_duration?: number;
+}
-interface TimesheetDetailsWeekDayExpenses {
+interface TimesheetDetailsDailyExpenses {
costs: Expense[];
mileage: Expense[];
[otherType: string]: Expense[]; //for possible future types of expenses
diff --git a/src/stores/timesheet-store.ts b/src/stores/timesheet-store.ts
index 8468163..caeba8c 100644
--- a/src/stores/timesheet-store.ts
+++ b/src/stores/timesheet-store.ts
@@ -19,6 +19,7 @@ export const useTimesheetStore = defineStore('timesheet', () => {
const is_loading = ref(false);
const current_pay_period = ref(default_pay_period);
const pay_period_overview_employees = ref([]);
+ const pay_period_overview_employee_approval_statuses = ref<{key: string, value: boolean}[] | undefined>();
const pay_period_employee_details = ref();
const pay_period_report = ref();
@@ -74,6 +75,7 @@ export const useTimesheetStore = defineStore('timesheet', () => {
supervisor_email
);
pay_period_overview_employees.value = response.employees_overview;
+ pay_period_overview_employee_approval_statuses.value = response.employees_overview.map( employee => ({ key: employee.email, value: employee.is_approved }) );
} catch (error) {
console.error('There was an error retrieving Employee Pay Period overviews: ', error);
pay_period_overview_employees.value = [];
@@ -122,6 +124,7 @@ export const useTimesheetStore = defineStore('timesheet', () => {
return {
current_pay_period,
pay_period_overview_employees,
+ pay_period_overview_employee_approval_statuses,
pay_period_employee_details,
is_loading,
getPayPeriodByDate,