fix(imports): fix constants imports
This commit is contained in:
parent
1385777122
commit
2debd40871
|
|
@ -454,24 +454,16 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/schedule-presets/{email}": {
|
"/schedule-presets/create/{employee_id}": {
|
||||||
"put": {
|
"post": {
|
||||||
"operationId": "SchedulePresetsController_upsert",
|
"operationId": "SchedulePresetsController_createPreset",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "email",
|
"name": "employee_id",
|
||||||
"required": true,
|
"required": true,
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"type": "number"
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "action",
|
|
||||||
"required": true,
|
|
||||||
"in": "query",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -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": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": ""
|
"description": ""
|
||||||
|
|
@ -493,16 +518,18 @@
|
||||||
"tags": [
|
"tags": [
|
||||||
"SchedulePresets"
|
"SchedulePresets"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"get": {
|
},
|
||||||
"operationId": "SchedulePresetsController_findListByEmail",
|
"/schedule-presets/delete/{preset_id}": {
|
||||||
|
"delete": {
|
||||||
|
"operationId": "SchedulePresetsController_deletePreset",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "email",
|
"name": "preset_id",
|
||||||
"required": true,
|
"required": true,
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"schema": {
|
"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": {
|
"post": {
|
||||||
"operationId": "SchedulePresetsController_applyPresets",
|
"operationId": "SchedulePresetsController_applyPresets",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "email",
|
"name": "employee_id",
|
||||||
"required": true,
|
"required": true,
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -853,6 +903,10 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {}
|
"properties": {}
|
||||||
},
|
},
|
||||||
|
"SchedulePresetsUpdateDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {}
|
||||||
|
},
|
||||||
"ExpenseDto": {
|
"ExpenseDto": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {}
|
"properties": {}
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,11 @@
|
||||||
import { BadRequestException, Injectable } from "@nestjs/common";
|
import { BadRequestException, Injectable } from "@nestjs/common";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
import { PrismaService } from "src/prisma/prisma.service";
|
||||||
import { LeaveTypes } from "@prisma/client";
|
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 { 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()
|
@Injectable()
|
||||||
export class LeaveRequestsUtils {
|
export class LeaveRequestsUtils {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly prisma: PrismaService,
|
private readonly prisma: PrismaService,
|
||||||
// private readonly shiftsService: ShiftsUpsertService,
|
|
||||||
){}
|
){}
|
||||||
|
|
||||||
async syncShift(
|
async syncShift(
|
||||||
|
|
@ -47,7 +42,6 @@ export class LeaveRequestsUtils {
|
||||||
include: { bank_code: true },
|
include: { bank_code: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
const action: UpsertAction = existing ? 'update' : 'create';
|
|
||||||
|
|
||||||
// await this.shiftsService.upsertShifts(email, action, {
|
// await this.shiftsService.upsertShifts(email, action, {
|
||||||
// old_shift: existing
|
// old_shift: existing
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { Injectable, NotFoundException } from "@nestjs/common";
|
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
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 { sevenDaysFrom, toStringFromDate, toHHmmFromDate, toDateFromString } from "src/time-and-attendance/utils/date-time.utils";
|
||||||
import { TotalExpenses, TotalHours } from "src/time-and-attendance/utils/type.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
|
//ensures the week starts from sunday
|
||||||
export function weekStartSunday(date_local: Date): Date {
|
export function weekStartSunday(date_local: Date): Date {
|
||||||
const start = new Date(Date.UTC(date_local.getFullYear(), date_local.getMonth(), date_local.getDate()));
|
const start = new Date(Date.UTC(date_local.getFullYear(), date_local.getMonth(), date_local.getDate()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user