resolve mergre
This commit is contained in:
parent
fda95d3fc4
commit
9b169d43c8
|
|
@ -1,6 +1,6 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Prisma, PrismaClient } from "@prisma/client";
|
||||
import { weekStartMondayUTC } from "src/modules/shifts/helpers/shifts-date-time-helpers";
|
||||
import { weekStartSundayUTC } from "src/modules/shifts/helpers/shifts-date-time-helpers";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ export class EmployeeTimesheetResolver {
|
|||
readonly ensureForDate = async (employee_id: number, date: Date, client?: Tx,
|
||||
): Promise<{id: number; start_date: Date }> => {
|
||||
const db = client ?? this.prisma;
|
||||
const startOfWeek = weekStartMondayUTC(date);
|
||||
const startOfWeek = weekStartSundayUTC(date);
|
||||
const existing = await db.timesheets.findFirst({
|
||||
where: {
|
||||
employee_id: employee_id,
|
||||
|
|
|
|||
|
|
@ -5,11 +5,24 @@ import { ShiftsCommandService } from './services/shifts-command.service';
|
|||
import { NotificationsModule } from '../notifications/notifications.module';
|
||||
import { ShiftsQueryService } from './services/shifts-query.service';
|
||||
import { ShiftsArchivalService } from './services/shifts-archival.service';
|
||||
import { BankCodesResolver } from '../shared/utils/resolve-bank-type-id.utils';
|
||||
import { EmployeeIdEmailResolver } from '../shared/utils/resolve-email-id.utils';
|
||||
|
||||
@Module({
|
||||
imports: [BusinessLogicsModule, NotificationsModule],
|
||||
controllers: [ShiftsController],
|
||||
providers: [ShiftsQueryService, ShiftsCommandService, ShiftsArchivalService],
|
||||
exports: [ShiftsQueryService, ShiftsCommandService, ShiftsArchivalService],
|
||||
providers: [
|
||||
ShiftsQueryService,
|
||||
ShiftsCommandService,
|
||||
ShiftsArchivalService,
|
||||
BankCodesResolver,
|
||||
EmployeeIdEmailResolver],
|
||||
exports: [
|
||||
ShiftsQueryService,
|
||||
ShiftsCommandService,
|
||||
ShiftsArchivalService,
|
||||
BankCodesResolver,
|
||||
EmployeeIdEmailResolver
|
||||
],
|
||||
})
|
||||
export class ShiftsModule {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user