fix(imports): ajusted imports for new ISOstring dates methods
This commit is contained in:
parent
af8ea95cc4
commit
78a335a47c
|
|
@ -2,7 +2,6 @@ import { BaseApprovalService } from "src/common/shared/base-approval.service";
|
|||
import { Expenses, Prisma } from "@prisma/client";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { UpsertExpenseDto } from "../dtos/upsert-expense.dto";
|
||||
import { toDateOnlyUTC } from "src/modules/shifts/helpers/shifts-date-time-helpers";
|
||||
import { BankCodesResolver } from "src/modules/shared/utils/resolve-bank-type-id.utils";
|
||||
import { ExpenseResponse, UpsertAction } from "../types and interfaces/expenses.types.interfaces";
|
||||
import { EmployeeIdEmailResolver } from "src/modules/shared/utils/resolve-email-id.utils";
|
||||
|
|
@ -20,6 +19,7 @@ import {
|
|||
normalizeType,
|
||||
parseAttachmentId
|
||||
} from "../utils/expenses.utils";
|
||||
import { toDateOnly } from "src/modules/shifts/helpers/shifts-date-time-helpers";
|
||||
|
||||
@Injectable()
|
||||
export class ExpensesCommandService extends BaseApprovalService<Expenses> {
|
||||
|
|
@ -59,7 +59,7 @@ export class ExpensesCommandService extends BaseApprovalService<Expenses> {
|
|||
if(!old_expense && !new_expense) throw new BadRequestException('At least one expense must be provided');
|
||||
|
||||
//validate date format
|
||||
const date_only = toDateOnlyUTC(date);
|
||||
const date_only = toDateOnly(date);
|
||||
if(Number.isNaN(date_only.getTime())) throw new BadRequestException('Invalid date format (expected: YYYY-MM-DD)');
|
||||
|
||||
//resolve employee_id by email
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Prisma, PrismaClient } from "@prisma/client";
|
||||
import { weekStartSundayUTC } from "src/modules/shifts/helpers/shifts-date-time-helpers";
|
||||
import { weekStartSunday } 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 = weekStartSundayUTC(date);
|
||||
const startOfWeek = weekStartSunday(date);
|
||||
const existing = await db.timesheets.findFirst({
|
||||
where: {
|
||||
employee_id: employee_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user