fix(timesheet): add some quality of life to get required info, employee name, change pay period response from week 1 and 2 to array of weeks
This commit is contained in:
parent
1c797c348a
commit
fa845cf6e6
|
|
@ -59,7 +59,6 @@ export class WeekDto {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TimesheetPeriodDto {
|
export class TimesheetPeriodDto {
|
||||||
week1: WeekDto;
|
weeks: WeekDto[];
|
||||||
week2: WeekDto;
|
|
||||||
employee_full_name: string;
|
employee_full_name: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ export function makeEmptyWeek(week_start: Date): WeekDto {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makeEmptyPeriod(): TimesheetPeriodDto {
|
export function makeEmptyPeriod(): TimesheetPeriodDto {
|
||||||
return { week1: makeEmptyWeek(new Date()), week2: makeEmptyWeek(new Date()), employee_full_name: " " };
|
return { weeks: [ makeEmptyWeek(new Date()), makeEmptyWeek(new Date())], employee_full_name: " " };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildWeek(
|
export function buildWeek(
|
||||||
|
|
@ -310,8 +310,10 @@ export function buildPeriod(
|
||||||
const week2_end = endOfDayUTC(period_end);
|
const week2_end = endOfDayUTC(period_end);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
week1: buildWeek(week1_start, week1_end, shifts, expenses),
|
weeks: [
|
||||||
week2: buildWeek(week2_start, week2_end, shifts, expenses),
|
buildWeek(week1_start, week1_end, shifts, expenses),
|
||||||
|
buildWeek(week2_start, week2_end, shifts, expenses),
|
||||||
|
],
|
||||||
employee_full_name,
|
employee_full_name,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user