clean(shifts): cleaning
This commit is contained in:
parent
c2203f77cb
commit
457757a066
|
|
@ -136,7 +136,7 @@ export class ShiftsUpsertService {
|
||||||
const day_date = new Date(day);
|
const day_date = new Date(day);
|
||||||
const rows = await tx.shifts.findMany({
|
const rows = await tx.shifts.findMany({
|
||||||
where: { timesheet_id, date: day_date },
|
where: { timesheet_id, date: day_date },
|
||||||
select: { start_time: true, end_time: true },
|
select: { start_time: true, end_time: true, id: true },
|
||||||
});
|
});
|
||||||
existing_map.set(
|
existing_map.set(
|
||||||
key,
|
key,
|
||||||
|
|
@ -189,8 +189,7 @@ export class ShiftsUpsertService {
|
||||||
|
|
||||||
const normalizeHHmm = (value: Date) => toHHmmFromString(toStringFromHHmm(value));
|
const normalizeHHmm = (value: Date) => toHHmmFromString(toStringFromHHmm(value));
|
||||||
|
|
||||||
for (const { timesheet_id, day, key } of timesheet_keys) {
|
for (const { key } of timesheet_keys) {
|
||||||
const day_date = new Date(day);
|
|
||||||
existing.push({
|
existing.push({
|
||||||
start_time: normalizeHHmm(row.start_time),
|
start_time: normalizeHHmm(row.start_time),
|
||||||
end_time: normalizeHHmm(row.end_time)
|
end_time: normalizeHHmm(row.end_time)
|
||||||
|
|
@ -204,7 +203,6 @@ export class ShiftsUpsertService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const { type: bank_type } = await this.typeResolver.findTypeByBankCodeId(row.bank_code_id);
|
const { type: bank_type } = await this.typeResolver.findTypeByBankCodeId(row.bank_code_id);
|
||||||
const summary = await this.overtime.getWeekOvertimeSummary(timesheet_id, normed.date, tx);
|
const summary = await this.overtime.getWeekOvertimeSummary(timesheet_id, normed.date, tx);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user