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