clean(modules): modules file cleaning
This commit is contained in:
parent
0c81f21f1b
commit
13962a8496
|
|
@ -1,12 +0,0 @@
|
|||
import { Type } from "class-transformer";
|
||||
import { IsEmail, IsInt, IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class EmployeeDto {
|
||||
@IsString() first_name!: string;
|
||||
@IsString() last_name!: string;
|
||||
@IsString() @IsEmail() email!: string;
|
||||
@IsString() @IsOptional() supervisor_full_name: string | '';
|
||||
@IsString() company_name: string;
|
||||
@IsString() @IsOptional() job_title: string;
|
||||
@IsInt() @Type(()=> Number) external_payroll_id: number;
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@ import { Modules as ModulesEnum } from ".prisma/client";
|
|||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/dtos/employee-detailed.dto";
|
||||
import { EmployeeDto } from "src/identity-and-account/employees/dtos/employee.dto";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/employee-detailed.dto";
|
||||
import { EmployeesGetService } from "src/identity-and-account/employees/services/employees-get.service";
|
||||
import { EmployeesCreateService } from "src/identity-and-account/employees/services/employees-create.service";
|
||||
import { EmployeesUpdateService } from "src/identity-and-account/employees/services/employees-update.service";
|
||||
|
|
@ -32,7 +31,7 @@ export class EmployeesController {
|
|||
|
||||
@Get('employee-list')
|
||||
@ModuleAccessAllowed(ModulesEnum.employee_list)
|
||||
async findListEmployees(): Promise<Result<EmployeeDto[], string>> {
|
||||
async findListEmployees(): Promise<Result<Partial<EmployeeDetailedDto>[], string>> {
|
||||
return this.getService.findListEmployees();
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { EmployeesController } from './controllers/employees.controller';
|
||||
import { EmployeesController } from './employees.controller';
|
||||
import { EmployeesGetService } from './services/employees-get.service';
|
||||
import { AccessGetService } from 'src/identity-and-account/user-module-access/services/module-access-get.service';
|
||||
import { EmailToIdResolver } from 'src/common/mappers/email-id.mapper';
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { Injectable } from "@nestjs/common";
|
|||
import { Users } from "@prisma/client";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { toBooleanFromString } from "src/common/mappers/module-access.mapper";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/dtos/employee-detailed.dto";
|
||||
import { toCompanyCodeFromString } from "src/identity-and-account/employees/utils/employee.utils";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/employee-detailed.dto";
|
||||
import { toCompanyCodeFromString } from "src/identity-and-account/employees/employee.utils";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
|
||||
@Injectable()
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
|||
import { toStringFromDate } from "src/common/utils/date-utils";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
||||
import { toCompanyCodeFromString, toStringFromCompanyCode } from "src/identity-and-account/employees/utils/employee.utils";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/dtos/employee-detailed.dto";
|
||||
import { EmployeeDto } from "src/identity-and-account/employees/dtos/employee.dto";
|
||||
import { toStringFromCompanyCode } from "src/identity-and-account/employees/employee.utils";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/employee-detailed.dto";
|
||||
|
||||
@Injectable()
|
||||
export class EmployeesGetService {
|
||||
|
|
@ -17,7 +16,7 @@ export class EmployeesGetService {
|
|||
private readonly emailResolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
async findListEmployees(): Promise<Result<EmployeeDto[], string>> {
|
||||
async findListEmployees(): Promise<Result<Partial<EmployeeDetailedDto>[], string>> {
|
||||
const employee_list = await this.prisma.employees.findMany({
|
||||
select: {
|
||||
user: {
|
||||
|
|
@ -53,9 +52,9 @@ export class EmployeesGetService {
|
|||
employee_full_name: `${r.user.first_name} ${r.user.last_name}`,
|
||||
is_supervisor: r.is_supervisor,
|
||||
supervisor_full_name: `${r.supervisor?.user.first_name} ${r.supervisor?.user.last_name}`,
|
||||
})),)
|
||||
return { success: true, data: employee_list }
|
||||
}
|
||||
})));
|
||||
return { success: true, data: employee_list };
|
||||
};
|
||||
|
||||
async findOwnProfile(email: string): Promise<Result<Partial<EmployeeDetailedDto>, string>> {
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(email);
|
||||
|
|
@ -93,6 +92,7 @@ export class EmployeesGetService {
|
|||
if (!existing_profile) return { success: false, error: 'EMPLOYEE_NOT_FOUND' };
|
||||
|
||||
const company_name = toStringFromCompanyCode(existing_profile.company_code);
|
||||
|
||||
return {
|
||||
success: true, data: {
|
||||
first_name: existing_profile.user.first_name,
|
||||
|
|
@ -106,9 +106,9 @@ export class EmployeesGetService {
|
|||
phone_number: existing_profile.user.phone_number,
|
||||
residence: existing_profile.user.phone_number,
|
||||
first_work_day: toStringFromDate(existing_profile.first_work_day),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
async findOneDetailedProfile(email: string, employee_email?: string): Promise<Result<EmployeeDetailedDto, string>> {
|
||||
const account_email = employee_email ?? email;
|
||||
|
|
@ -185,5 +185,5 @@ export class EmployeesGetService {
|
|||
user_module_access: module_access_array
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -6,8 +6,8 @@ import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
|||
import { toDateFromString } from "src/common/utils/date-utils";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
||||
import { toCompanyCodeFromString } from "src/identity-and-account/employees/utils/employee.utils";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/dtos/employee-detailed.dto";
|
||||
import { toCompanyCodeFromString } from "src/identity-and-account/employees/employee.utils";
|
||||
import { EmployeeDetailedDto } from "src/identity-and-account/employees/employee-detailed.dto";
|
||||
|
||||
@Injectable()
|
||||
export class EmployeesUpdateService {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { EmployeesController } from "src/identity-and-account/employees/controllers/employees.controller";
|
||||
import { EmployeesController } from "src/identity-and-account/employees/employees.controller";
|
||||
import { EmployeesModule } from "src/identity-and-account/employees/employees.module";
|
||||
import { EmployeesGetService } from "src/identity-and-account/employees/services/employees-get.service";
|
||||
import { PreferencesController } from "src/identity-and-account/preferences/controllers/preferences.controller";
|
||||
import { PreferencesController } from "src/identity-and-account/preferences/preferences.controller";
|
||||
import { PreferencesModule } from "src/identity-and-account/preferences/preferences.module";
|
||||
import { PreferencesService } from "src/identity-and-account/preferences/services/preferences.service";
|
||||
import { PreferencesService } from "src/identity-and-account/preferences/preferences.service";
|
||||
import { ModuleAccessModule } from "src/identity-and-account/user-module-access/module-access.module";
|
||||
import { ModuleAccessController } from "src/identity-and-account/user-module-access/controllers/module-access.controller";
|
||||
import { ModuleAccessController } from "src/identity-and-account/user-module-access/module-access.controller";
|
||||
import { AccessGetService } from "src/identity-and-account/user-module-access/services/module-access-get.service";
|
||||
import { AccessUpdateService } from "src/identity-and-account/user-module-access/services/module-access-update.service";
|
||||
import { UsersService } from "src/identity-and-account/users-management/services/users.service";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Body, Controller, Get, Patch, Query } from "@nestjs/common";
|
||||
import { PreferencesService } from "../services/preferences.service";
|
||||
import { PreferencesDto } from "../dtos/preferences.dto";
|
||||
import { PreferencesService } from "./preferences.service";
|
||||
import { PreferencesDto } from "./preferences.dto";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { PreferencesController } from "./controllers/preferences.controller";
|
||||
import { PreferencesService } from "./services/preferences.service";
|
||||
import { PreferencesController } from "./preferences.controller";
|
||||
import { PreferencesService } from "./preferences.service";
|
||||
import { Module } from "@nestjs/common";
|
||||
|
||||
@Module({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DisplayLanguage, PreferencesDto } from "../dtos/preferences.dto";
|
||||
import { DisplayLanguage, PreferencesDto } from "./preferences.dto";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { Body, Controller, Get, Patch, Query, Req } from "@nestjs/common";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/dtos/module-acces.dto";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/module-acces.dto";
|
||||
import { AccessGetService } from "src/identity-and-account/user-module-access/services/module-access-get.service";
|
||||
import { AccessUpdateService } from "src/identity-and-account/user-module-access/services/module-access-update.service";
|
||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { AccessUpdateService } from "src/identity-and-account/user-module-access/services/module-access-update.service";
|
||||
import { ModuleAccessController } from "src/identity-and-account/user-module-access/controllers/module-access.controller";
|
||||
import { ModuleAccessController } from "src/identity-and-account/user-module-access/module-access.controller";
|
||||
import { AccessGetService } from "src/identity-and-account/user-module-access/services/module-access-get.service";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/dtos/module-acces.dto";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/module-acces.dto";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/dtos/module-acces.dto";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/module-acces.dto";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
|
||||
@Injectable()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Controller, Post, Param, Body, Patch, Delete, Req, UnauthorizedException } from "@nestjs/common";
|
||||
import { ExpenseUpsertService } from "src/time-and-attendance/expenses/services/expense-upsert.service";
|
||||
import { ExpenseDto } from "src/time-and-attendance/expenses/dtos/expense-create.dto";
|
||||
import { ExpenseDto } from "src/time-and-attendance/expenses/expense-create.dto";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||
import { Modules as ModulesEnum } from ".prisma/client";
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { ExpenseUpsertService } from "src/time-and-attendance/expenses/services/expense-upsert.service";
|
||||
import { ExpenseController } from "src/time-and-attendance/expenses/controllers/expense.controller";
|
||||
import { ExpenseController } from "src/time-and-attendance/expenses/expense.controller";
|
||||
import { Module } from "@nestjs/common";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { BankCodesResolver } from "src/common/mappers/bank-type-id.mapper";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Injectable } from "@nestjs/common";
|
|||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { NormalizedExpense } from "src/time-and-attendance/utils/type.utils";
|
||||
import { BankCodesResolver } from "src/common/mappers/bank-type-id.mapper";
|
||||
import { ExpenseDto } from "src/time-and-attendance/expenses/dtos/expense-create.dto";
|
||||
import { ExpenseDto } from "src/time-and-attendance/expenses/expense-create.dto";
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
import { LeaveApprovalStatus, LeaveTypes } from "@prisma/client";
|
||||
|
||||
export class LeaveRequestViewDto {
|
||||
id: number;
|
||||
leave_type!: LeaveTypes;
|
||||
date!: string;
|
||||
comment!: string;
|
||||
approval_status: LeaveApprovalStatus;
|
||||
email!: string;
|
||||
employee_full_name!: string;
|
||||
payable_hours?: number;
|
||||
requested_hours?: number;
|
||||
action?: 'create' | 'update' | 'delete';
|
||||
}
|
||||
|
|
@ -27,4 +27,17 @@ export class LeaveRequestDto {
|
|||
|
||||
@IsEnum(LeaveApprovalStatus)
|
||||
approval_status?: LeaveApprovalStatus
|
||||
}
|
||||
|
||||
export class LeaveRequestViewDto {
|
||||
id: number;
|
||||
leave_type!: LeaveTypes;
|
||||
date!: string;
|
||||
comment!: string;
|
||||
approval_status: LeaveApprovalStatus;
|
||||
email!: string;
|
||||
employee_full_name!: string;
|
||||
payable_hours?: number;
|
||||
requested_hours?: number;
|
||||
action?: 'create' | 'update' | 'delete';
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { LeaveRequestArchiveRow } from "../utils/leave-requests-archive.select";
|
||||
import { LeaveRequestViewDto } from "../dtos/leave-request-view.dto";
|
||||
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { LeaveRequestViewDto } from "src/time-and-attendance/leave-requests/leave-request.dto";
|
||||
import { LeaveRequestArchiveRow } from "src/time-and-attendance/leave-requests/utils/leave-requests-archive.select";
|
||||
|
||||
const toNum = (value?: Prisma.Decimal | null) => value ? Number(value) : undefined;
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Body, Controller, Delete, Patch, Post, Req } from "@nestjs/common";
|
||||
import { LeaveRequestDto } from "../dtos/leave-request.dto";
|
||||
// import { LeaveRequestDto } from "../dtos/leave-request.dto";
|
||||
import { LeaveRequestsService } from "src/time-and-attendance/leave-requests/services/leave-request.service";
|
||||
|
||||
@Controller('leave-requests')
|
||||
|
|
@ -5,7 +5,7 @@ import { LeaveApprovalStatus, LeaveRequests, LeaveTypes, Prisma, Shifts } from "
|
|||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { LeaveRequestDto } from "src/time-and-attendance/leave-requests/dtos/leave-request.dto";
|
||||
import { LeaveRequestDto } from "src/time-and-attendance/leave-requests/leave-request.dto";
|
||||
import { leave_requests_select } from "src/time-and-attendance/utils/selects.utils";
|
||||
import { toDateFromString, toStringFromDate } from "src/common/utils/date-utils";
|
||||
import { NormalizedLeaveRequest } from "src/time-and-attendance/utils/type.utils";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Prisma } from "@prisma/client";
|
||||
import { LeaveRequestViewDto } from "src/time-and-attendance/leave-requests/dtos/leave-request-view.dto";
|
||||
import { mapArchiveRowToView } from "src/time-and-attendance/leave-requests/mappers/leave-requests-archive.mapper";
|
||||
// import { Prisma } from "@prisma/client";
|
||||
// import { LeaveRequestViewDto } from "src/time-and-attendance/leave-requests/dtos/leave-request-view.dto";
|
||||
// import { mapArchiveRowToView } from "src/time-and-attendance/leave-requests/mappers/leave-requests-archive.mapper";
|
||||
// import { mapRowToView } from "src/time-and-attendance/leave-requests/mappers/leave-requests.mapper";
|
||||
import { LeaveRequestArchiveRow } from "src/time-and-attendance/leave-requests/utils/leave-requests-archive.select";
|
||||
// import { LeaveRequestArchiveRow } from "src/time-and-attendance/leave-requests/utils/leave-requests-archive.select";
|
||||
// import { leaveRequestsSelect } from "src/time-and-attendance/utils/selects.utils";
|
||||
|
||||
// export type LeaveRequestRow = Prisma.LeaveRequestsGetPayload<{ select: typeof leaveRequestsSelect}>;
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
import { PayPeriodDto } from "./pay-period.dto";
|
||||
|
||||
export class PayPeriodBundleDto {
|
||||
current: PayPeriodDto;
|
||||
periods: PayPeriodDto[];
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
export class EmployeePeriodOverviewDto {
|
||||
email: string;
|
||||
employee_name: string;
|
||||
regular_hours: number;
|
||||
other_hours: {
|
||||
evening_hours: number;
|
||||
|
||||
emergency_hours: number;
|
||||
|
||||
overtime_hours: number;
|
||||
|
||||
sick_hours: number;
|
||||
|
||||
holiday_hours: number;
|
||||
|
||||
vacation_hours: number;
|
||||
};
|
||||
total_hours: number;
|
||||
expenses: number;
|
||||
mileage: number;
|
||||
is_approved: boolean;
|
||||
is_remote: boolean;
|
||||
}
|
||||
|
|
@ -1,11 +1,42 @@
|
|||
import { EmployeePeriodOverviewDto } from './overview-employee-period.dto';
|
||||
|
||||
export class PayPeriodOverviewDto {
|
||||
pay_period_no: number;
|
||||
pay_year: number;
|
||||
period_start: string;
|
||||
period_end: string;
|
||||
payday: string;
|
||||
label: string;
|
||||
employees_overview: EmployeePeriodOverviewDto[];
|
||||
pay_period_no: number;
|
||||
pay_year: number;
|
||||
period_start: string;
|
||||
period_end: string;
|
||||
payday: string;
|
||||
label: string;
|
||||
employees_overview: EmployeePeriodOverviewDto[];
|
||||
}
|
||||
|
||||
export class EmployeePeriodOverviewDto {
|
||||
email: string;
|
||||
employee_name: string;
|
||||
regular_hours: number;
|
||||
other_hours: {
|
||||
evening_hours: number;
|
||||
emergency_hours: number;
|
||||
overtime_hours: number;
|
||||
sick_hours: number;
|
||||
holiday_hours: number;
|
||||
vacation_hours: number;
|
||||
};
|
||||
total_hours: number;
|
||||
expenses: number;
|
||||
mileage: number;
|
||||
is_approved: boolean;
|
||||
is_remote: boolean;
|
||||
}
|
||||
|
||||
export class PayPeriodBundleDto {
|
||||
current: PayPeriodDto;
|
||||
periods: PayPeriodDto[];
|
||||
}
|
||||
|
||||
export class PayPeriodDto {
|
||||
pay_period_no: number;
|
||||
period_start: string;
|
||||
period_end: string;
|
||||
payday: string;
|
||||
pay_year: number;
|
||||
label: string;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
export class PayPeriodDto {
|
||||
pay_period_no: number;
|
||||
period_start: string;
|
||||
period_end: string;
|
||||
payday: string;
|
||||
pay_year: number;
|
||||
label: string;
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
import { Body, Controller, Get, Param, ParseBoolPipe, ParseIntPipe, Patch, Query, UnauthorizedException } from "@nestjs/common";
|
||||
import { PayPeriodOverviewDto } from "../dtos/overview-pay-period.dto";
|
||||
import { PayPeriodsQueryService } from "../services/pay-periods-query.service";
|
||||
import { PayPeriodsCommandService } from "../services/pay-periods-command.service";
|
||||
import { PayPeriodBundleDto } from "../dtos/bundle-pay-period.dto";
|
||||
import { BulkCrewApprovalDto } from "../dtos/bulk-crew-approval.dto";
|
||||
import { PayPeriodBundleDto, PayPeriodOverviewDto } from "./dtos/overview-pay-period.dto";
|
||||
import { PayPeriodsQueryService } from "./services/pay-periods-query.service";
|
||||
import { PayPeriodsCommandService } from "./services/pay-periods-command.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||
import { Modules as ModulesEnum } from ".prisma/client";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { BulkCrewApprovalDto } from "src/time-and-attendance/pay-period/dtos/bulk-crew-approval.dto";
|
||||
|
||||
@Controller('pay-periods')
|
||||
export class PayPeriodsController {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { PayPeriods } from "@prisma/client";
|
||||
import { PayPeriodDto } from "../dtos/pay-period.dto";
|
||||
import { PayPeriodDto } from "src/time-and-attendance/pay-period/dtos/overview-pay-period.dto";
|
||||
|
||||
const toDateString = (date: Date) => date.toISOString().slice(0, 10); // "YYYY-MM-DD"
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { PayPeriodsQueryService } from "./services/pay-periods-query.service";
|
||||
import { PayPeriodsController } from "./controllers/pay-periods.controller";
|
||||
import { PayPeriodsController } from "./pay-periods.controller";
|
||||
import { Module } from "@nestjs/common";
|
||||
import { PayPeriodsCommandService } from "src/time-and-attendance/pay-period/services/pay-periods-command.service";
|
||||
import { TimesheetsModule } from "src/time-and-attendance/timesheets/timesheets.module";
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { computeHours, computePeriod, listPayYear, payYearOfDate } from "src/common/utils/date-utils";
|
||||
import { PayPeriodOverviewDto } from "../dtos/overview-pay-period.dto";
|
||||
import { EmployeePeriodOverviewDto } from "../dtos/overview-employee-period.dto";
|
||||
import { PayPeriodDto } from "../dtos/pay-period.dto";
|
||||
import { mapPayPeriodToDto } from "../mappers/pay-periods.mapper";
|
||||
import { EmployeePeriodOverviewDto, PayPeriodDto, PayPeriodOverviewDto } from "../dtos/overview-pay-period.dto";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { mapPayPeriodToDto } from "src/time-and-attendance/pay-period/pay-periods.mapper";
|
||||
|
||||
@Injectable()
|
||||
export class PayPeriodsQueryService {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Module } from "@nestjs/common";
|
|||
|
||||
import { BankCodesResolver } from "src/common/mappers/bank-type-id.mapper";
|
||||
|
||||
import { SchedulePresetsController } from "src/time-and-attendance/schedule-presets/controller/schedule-presets.controller";
|
||||
import { SchedulePresetsController } from "src/time-and-attendance/schedule-presets/schedule-presets.controller";
|
||||
import { SchedulePresetsGetService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-get.service";
|
||||
import { SchedulePresetsCreateService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-create.service";
|
||||
import { SchedulePresetUpdateService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-update.service";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
|||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { toStringFromHHmm, toStringFromDate, toDateFromString, overlaps, toDateFromHHmm } from "src/common/utils/date-utils";
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/dtos/shift-create.dto";
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/shift-create.dto";
|
||||
|
||||
@Injectable()
|
||||
export class ShiftsCreateService {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Result } from "src/common/errors/result-error.factory";
|
|||
|
||||
import { shift_select } from "src/time-and-attendance/utils/selects.utils";
|
||||
import { Normalized } from "src/time-and-attendance/utils/type.utils";
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/dtos/shift-create.dto";
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/shift-create.dto";
|
||||
|
||||
@Injectable()
|
||||
export class ShiftsUpdateService {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Body, Controller, Delete, Param, Patch, Post } from "@nestjs/common";
|
||||
import { Modules as ModulesEnum } from ".prisma/client";
|
||||
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/dtos/shift-create.dto";
|
||||
import { ShiftDto } from "src/time-and-attendance/shifts/shift-create.dto";
|
||||
import { ShiftsCreateService } from "src/time-and-attendance/shifts/services/shifts-create.service";
|
||||
import { ShiftsUpdateService } from "src/time-and-attendance/shifts/services/shifts-update-delete.service";
|
||||
import { ShiftsDeleteService } from "src/time-and-attendance/shifts/services/shifts-delete.service";
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { ShiftController } from 'src/time-and-attendance/shifts/controllers/shift.controller';
|
||||
import { ShiftController } from 'src/time-and-attendance/shifts/shift.controller';
|
||||
import { ShiftsCreateService } from 'src/time-and-attendance/shifts/services/shifts-create.service';
|
||||
import { ShiftsDeleteService } from 'src/time-and-attendance/shifts/services/shifts-delete.service';
|
||||
import { ShiftsUpdateService } from 'src/time-and-attendance/shifts/services/shifts-update-delete.service';
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { BusinessLogicsModule } from "src/time-and-attendance/domains/business-logics.module";
|
||||
|
||||
import { ExpenseController } from "src/time-and-attendance/expenses/controllers/expense.controller";
|
||||
import { ExpenseController } from "src/time-and-attendance/expenses/expense.controller";
|
||||
import { ExpenseUpsertService } from "src/time-and-attendance/expenses/services/expense-upsert.service";
|
||||
import { ExpensesModule } from "src/time-and-attendance/expenses/expenses.module";
|
||||
|
||||
import { TimesheetController } from "src/time-and-attendance/timesheets/controllers/timesheet.controller";
|
||||
import { TimesheetController } from "src/time-and-attendance/timesheets/timesheet.controller";
|
||||
import { TimesheetApprovalService } from "src/time-and-attendance/timesheets/services/timesheet-approval.service";
|
||||
import { GetTimesheetsOverviewService } from "src/time-and-attendance/timesheets/services/timesheet-get-overview.service";
|
||||
import { TimesheetsModule } from "src/time-and-attendance/timesheets/timesheets.module";
|
||||
|
|
@ -16,7 +16,7 @@ import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
|||
import { EmployeeTimesheetResolver } from "src/common/mappers/timesheet.mapper";
|
||||
|
||||
import { PayperiodsModule } from "src/time-and-attendance/pay-period/pay-periods.module";
|
||||
import { PayPeriodsController } from "src/time-and-attendance/pay-period/controllers/pay-periods.controller";
|
||||
import { PayPeriodsController } from "src/time-and-attendance/pay-period/pay-periods.controller";
|
||||
import { PayPeriodsQueryService } from "src/time-and-attendance/pay-period/services/pay-periods-query.service";
|
||||
import { PayPeriodsCommandService } from "src/time-and-attendance/pay-period/services/pay-periods-command.service";
|
||||
|
||||
|
|
@ -24,14 +24,14 @@ import { CsvExportModule } from "src/modules/exports/csv-exports.module";
|
|||
import { CsvExportService } from "src/modules/exports/services/csv-exports.service";
|
||||
import { CsvExportController } from "src/modules/exports/controllers/csv-exports.controller";
|
||||
|
||||
import { ShiftController } from "src/time-and-attendance/shifts/controllers/shift.controller";
|
||||
import { ShiftController } from "src/time-and-attendance/shifts/shift.controller";
|
||||
import { ShiftsCreateService } from "src/time-and-attendance/shifts/services/shifts-create.service";
|
||||
import { ShiftsGetService } from "src/time-and-attendance/shifts/services/shifts-get.service";
|
||||
import { ShiftsUpdateService } from "src/time-and-attendance/shifts/services/shifts-update-delete.service";
|
||||
import { ShiftsDeleteService } from "src/time-and-attendance/shifts/services/shifts-delete.service";
|
||||
|
||||
import { SchedulePresetsGetService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-get.service";
|
||||
import { SchedulePresetsController } from "src/time-and-attendance/schedule-presets/controller/schedule-presets.controller";
|
||||
import { SchedulePresetsController } from "src/time-and-attendance/schedule-presets/schedule-presets.controller";
|
||||
import { SchedulePresetsModule } from "src/time-and-attendance/schedule-presets/schedule-presets.module";
|
||||
import { SchedulePresetDeleteService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-delete.service";
|
||||
import { SchedulePresetUpdateService } from "src/time-and-attendance/schedule-presets/services/schedule-presets-update.service";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { NUMBER_OF_TIMESHEETS_TO_RETURN } from "src/common/utils/constants.utils
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
import { Timesheet, Timesheets } from "src/time-and-attendance/timesheets/dtos/timesheet.dto";
|
||||
import { Timesheet, Timesheets } from "src/time-and-attendance/timesheets/timesheet.dto";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { toDateFromString, sevenDaysFrom, toStringFromDate, toHHmmFromDate } from "src/common/utils/date-utils";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TimesheetController } from 'src/time-and-attendance/timesheets/controllers/timesheet.controller';
|
||||
import { TimesheetController } from 'src/time-and-attendance/timesheets/timesheet.controller';
|
||||
import { TimesheetApprovalService } from 'src/time-and-attendance/timesheets/services/timesheet-approval.service';
|
||||
import { GetTimesheetsOverviewService } from 'src/time-and-attendance/timesheets/services/timesheet-get-overview.service';
|
||||
import { EmailToIdResolver } from 'src/common/mappers/email-id.mapper';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user