fix(imports): fix constants imports
This commit is contained in:
parent
1385777122
commit
2debd40871
|
|
@ -454,24 +454,16 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/schedule-presets/{email}": {
|
||||
"put": {
|
||||
"operationId": "SchedulePresetsController_upsert",
|
||||
"/schedule-presets/create/{employee_id}": {
|
||||
"post": {
|
||||
"operationId": "SchedulePresetsController_createPreset",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
"name": "employee_id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "action",
|
||||
"required": true,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -485,6 +477,39 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"SchedulePresets"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/schedule-presets/update/{preset_id}": {
|
||||
"patch": {
|
||||
"operationId": "SchedulePresetsController_updatePreset",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "preset_id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SchedulePresetsUpdateDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
|
|
@ -493,16 +518,18 @@
|
|||
"tags": [
|
||||
"SchedulePresets"
|
||||
]
|
||||
},
|
||||
"get": {
|
||||
"operationId": "SchedulePresetsController_findListByEmail",
|
||||
}
|
||||
},
|
||||
"/schedule-presets/delete/{preset_id}": {
|
||||
"delete": {
|
||||
"operationId": "SchedulePresetsController_deletePreset",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
"name": "preset_id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -516,16 +543,39 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/schedule-presets/apply-presets/{email}": {
|
||||
"/schedule-presets/find/{employee_id}": {
|
||||
"get": {
|
||||
"operationId": "SchedulePresetsController_findListById",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "employee_id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"SchedulePresets"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/schedule-presets/apply-presets/{employee_id}": {
|
||||
"post": {
|
||||
"operationId": "SchedulePresetsController_applyPresets",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
"name": "employee_id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -853,6 +903,10 @@
|
|||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"SchedulePresetsUpdateDto": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"ExpenseDto": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,11 @@
|
|||
import { BadRequestException, Injectable } from "@nestjs/common";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { LeaveTypes } from "@prisma/client";
|
||||
// import { toDateOnly, toStringFromDate } from "src/time-and-attendance/modules/shared/helpers/date-time.helpers";
|
||||
import { UpsertAction } from "src/time-and-attendance/modules/shared/types/upsert-actions.types";
|
||||
import { toDateFromString, toStringFromDate } from "src/time-and-attendance/utils/date-time.utils";
|
||||
// import { ShiftsUpsertService } from "src/time-and-attendance/modules/time-tracker/shifts/services/shifts-upsert.service";
|
||||
|
||||
@Injectable()
|
||||
export class LeaveRequestsUtils {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
// private readonly shiftsService: ShiftsUpsertService,
|
||||
){}
|
||||
|
||||
async syncShift(
|
||||
|
|
@ -47,7 +42,6 @@ export class LeaveRequestsUtils {
|
|||
include: { bank_code: true },
|
||||
});
|
||||
|
||||
const action: UpsertAction = existing ? 'update' : 'create';
|
||||
|
||||
// await this.shiftsService.upsertShifts(email, action, {
|
||||
// old_shift: existing
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { NUMBER_OF_TIMESHEETS_TO_RETURN } from "src/time-and-attendance/utils/constants.utils";
|
||||
import { sevenDaysFrom, toStringFromDate, toHHmmFromDate, toDateFromString } from "src/time-and-attendance/utils/date-time.utils";
|
||||
import { TotalExpenses, TotalHours } from "src/time-and-attendance/utils/type.utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { ANCHOR_ISO, MS_PER_DAY, PERIODS_PER_YEAR, PERIOD_DAYS } from "src/time-and-attendance/utils/constants.utils";
|
||||
|
||||
//ensures the week starts from sunday
|
||||
export function weekStartSunday(date_local: Date): Date {
|
||||
const start = new Date(Date.UTC(date_local.getFullYear(), date_local.getMonth(), date_local.getDate()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user