clean(modules): modules file cleaning
This commit is contained in:
parent
6d3ff46c35
commit
d81186ba2b
|
|
@ -1,20 +1,6 @@
|
||||||
{
|
{
|
||||||
"openapi": "3.0.0",
|
"openapi": "3.0.0",
|
||||||
"paths": {
|
"paths": {
|
||||||
"/health": {
|
|
||||||
"get": {
|
|
||||||
"operationId": "HealthController_check",
|
|
||||||
"parameters": [],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"Health"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/auth/v1/login": {
|
"/auth/v1/login": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "AuthController_login",
|
"operationId": "AuthController_login",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { BadRequestException, Module, ValidationPipe } from '@nestjs/common';
|
import { BadRequestException, Module, ValidationPipe } from '@nestjs/common';
|
||||||
import { AppController } from './app.controller';
|
import { AppController } from './app.controller';
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { HealthController } from './health/health.controller';
|
import { NotificationsModule } from './shared/notifications/notifications.module';
|
||||||
import { NotificationsModule } from './modules/notifications/notifications.module';
|
|
||||||
import { PrismaModule } from './prisma/prisma.module';
|
import { PrismaModule } from './prisma/prisma.module';
|
||||||
import { ScheduleModule } from '@nestjs/schedule';
|
import { ScheduleModule } from '@nestjs/schedule';
|
||||||
import { ConfigModule } from '@nestjs/config';
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
|
@ -25,7 +24,7 @@ import { PrismaLegacyModule } from 'src/prisma-legacy/prisma.module';
|
||||||
TimeAndAttendanceModule,
|
TimeAndAttendanceModule,
|
||||||
IdentityAndAccountModule,
|
IdentityAndAccountModule,
|
||||||
],
|
],
|
||||||
controllers: [AppController, HealthController],
|
controllers: [AppController],
|
||||||
providers: [
|
providers: [
|
||||||
AppService,
|
AppService,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
import { Test, TestingModule } from '@nestjs/testing';
|
|
||||||
import { HealthController } from './health.controller';
|
|
||||||
|
|
||||||
describe('HealthController', () => {
|
|
||||||
let controller: HealthController;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
const module: TestingModule = await Test.createTestingModule({
|
|
||||||
controllers: [HealthController],
|
|
||||||
}).compile();
|
|
||||||
|
|
||||||
controller = module.get<HealthController>(HealthController);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be defined', () => {
|
|
||||||
expect(controller).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import { Controller, Get } from '@nestjs/common';
|
|
||||||
import { PrismaService } from '../prisma/prisma.service';
|
|
||||||
|
|
||||||
@Controller('health')
|
|
||||||
export class HealthController {
|
|
||||||
constructor(private readonly prisma: PrismaService) {}
|
|
||||||
|
|
||||||
@Get()
|
|
||||||
async check(): Promise<{ status: string }> {
|
|
||||||
await this.prisma.$queryRaw`SELECT 1`;
|
|
||||||
return { status: 'ok' };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import { Module } from '@nestjs/common';
|
|
||||||
import { HealthController } from './health.controller';
|
|
||||||
import { PrismaModule } from '../prisma/prisma.module';
|
|
||||||
|
|
||||||
@Module({
|
|
||||||
imports: [PrismaModule],
|
|
||||||
controllers: [HealthController],
|
|
||||||
})
|
|
||||||
export class HealthModule {}
|
|
||||||
|
|
@ -181,7 +181,7 @@ export class EmployeesGetService {
|
||||||
employee_full_name: `${employee.user.first_name} ${employee.user.last_name}`,
|
employee_full_name: `${employee.user.first_name} ${employee.user.last_name}`,
|
||||||
first_work_day: toStringFromDate(employee.first_work_day),
|
first_work_day: toStringFromDate(employee.first_work_day),
|
||||||
last_work_day: employee.last_work_day ? toStringFromDate(employee.last_work_day) : undefined,
|
last_work_day: employee.last_work_day ? toStringFromDate(employee.last_work_day) : undefined,
|
||||||
supervisor_full_name: employee.supervisor ? `${employee.supervisor?.user.first_name}, ${employee.supervisor?.user.last_name}` : '',
|
supervisor_full_name: employee.supervisor ? `${employee.supervisor?.user.first_name} ${employee.supervisor?.user.last_name}` : '',
|
||||||
user_module_access: module_access_array
|
user_module_access: module_access_array
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ import * as nodeCrypto from 'crypto';
|
||||||
if (!(globalThis as any).crypto) {
|
if (!(globalThis as any).crypto) {
|
||||||
(globalThis as any).crypto = nodeCrypto;
|
(globalThis as any).crypto = nodeCrypto;
|
||||||
}
|
}
|
||||||
import { ensureAttachmentsTmpDir } from './config/attachment.fs';
|
import { ensureAttachmentsTmpDir } from './time-and-attendance/attachments/config/attachment.fs';
|
||||||
import { resolveAttachmentsRoot } from './config/attachment.config';// log to be removed post dev
|
import { resolveAttachmentsRoot } from './time-and-attendance/attachments/config/attachment.config';// log to be removed post dev
|
||||||
import { ATT_TMP_DIR } from './config/attachment.config'; // log to be removed post dev
|
import { ATT_TMP_DIR } from './time-and-attendance/attachments/config/attachment.config'; // log to be removed post dev
|
||||||
import { NestFactory, Reflector } from '@nestjs/core';
|
import { NestFactory, Reflector } from '@nestjs/core';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
// import { JwtAuthGuard } from './modules/authentication/guards/jwt-auth.guard';
|
// import { JwtAuthGuard } from './modules/authentication/guards/jwt-auth.guard';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Module } from "@nestjs/common";
|
import { Module } from "@nestjs/common";
|
||||||
import { NotificationsController } from "./controllers/notifications.controller";
|
import { NotificationsController } from "./controllers/notifications.controller";
|
||||||
import { NotificationsService } from "./services/notifications.service";
|
import { NotificationsService } from "./notifications.service";
|
||||||
@Module({
|
@Module({
|
||||||
providers: [NotificationsService],
|
providers: [NotificationsService],
|
||||||
controllers: [NotificationsController],
|
controllers: [NotificationsController],
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Injectable, Logger } from "@nestjs/common";
|
import { Injectable, Logger } from "@nestjs/common";
|
||||||
import { Subject } from "rxjs";
|
import { Subject } from "rxjs";
|
||||||
import { NotificationCard } from "../dtos/notification.types";
|
import { NotificationCard } from "./notification.types";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class NotificationsService {
|
export class NotificationsService {
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
import { Controller, UseInterceptors, Post, Get, Param, Res, UploadedFile, Body, Delete, Query } from "@nestjs/common";
|
import { Controller, UseInterceptors, Post, Get, Param, Res, UploadedFile, Body, Delete, Query } from "@nestjs/common";
|
||||||
import { FileInterceptor } from "@nestjs/platform-express";
|
import { FileInterceptor } from "@nestjs/platform-express";
|
||||||
import { AttachmentDeleteService } from "src/modules/attachments/services/attachment-delete.service";
|
|
||||||
import { AttachmentUploadService } from "src/modules/attachments/services/attachment-upload.service";
|
|
||||||
import { AttachmentGetService } from "src/modules/attachments/services/attachment-get.service";
|
|
||||||
import { UploadMetaAttachmentsDto } from "../dtos/upload-meta-attachments.dto";
|
|
||||||
import { AdminSearchDto } from "../dtos/search-filters.dto";
|
|
||||||
import { maxUploadBytes } from "../config/upload.config";
|
|
||||||
import { memoryStorage } from 'multer';
|
import { memoryStorage } from 'multer';
|
||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
|
import { AdminSearchDto } from "src/time-and-attendance/attachments/dtos/search-filters.dto";
|
||||||
|
import { UploadMetaAttachmentsDto } from "src/time-and-attendance/attachments/dtos/upload-meta-attachments.dto";
|
||||||
|
import { maxUploadBytes } from "src/time-and-attendance/attachments/upload.config";
|
||||||
|
import { AttachmentDeleteService } from "src/time-and-attendance/attachments/services/attachment-delete.service";
|
||||||
|
import { AttachmentGetService } from "src/time-and-attendance/attachments/services/attachment-get.service";
|
||||||
|
import { AttachmentUploadService } from "src/time-and-attendance/attachments/services/attachment-upload.service";
|
||||||
|
|
||||||
@Controller('attachments')
|
@Controller('attachments')
|
||||||
export class AttachmentsController {
|
export class AttachmentsController {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Injectable } from "@nestjs/common";
|
import { Injectable } from "@nestjs/common";
|
||||||
import { Cron } from "@nestjs/schedule";
|
import { Cron } from "@nestjs/schedule";
|
||||||
import { startOfYear } from "src/modules/attachments/utils/cas.util";
|
import { startOfYear } from "src/time-and-attendance/attachments/cas.util";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
import { PrismaService } from "src/prisma/prisma.service";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { Injectable } from "@nestjs/common";
|
import { Injectable } from "@nestjs/common";
|
||||||
import { Response } from "express";
|
import { Response } from "express";
|
||||||
import { AdminSearchDto } from "src/modules/attachments/dtos/search-filters.dto";
|
import { AdminSearchDto } from "src/time-and-attendance/attachments/dtos/search-filters.dto";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
import { PrismaService } from "src/prisma/prisma.service";
|
||||||
import { resolveAttachmentsRoot } from "src/config/attachment.config";
|
import { resolveAttachmentsRoot } from "src/time-and-attendance/attachments/config/attachment.config";
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import { promises as fsp } from 'node:fs';
|
import { promises as fsp } from 'node:fs';
|
||||||
import { createReadStream } from "node:fs";
|
import { createReadStream } from "node:fs";
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { Injectable } from "@nestjs/common";
|
import { Injectable } from "@nestjs/common";
|
||||||
import { allowedMimes } from "src/modules/attachments/config/upload.config";
|
import { allowedMimes } from "src/time-and-attendance/attachments/upload.config";
|
||||||
import { UploadMetaAttachmentsDto } from "src/modules/attachments/dtos/upload-meta-attachments.dto";
|
import { UploadMetaAttachmentsDto } from "src/time-and-attendance/attachments/dtos/upload-meta-attachments.dto";
|
||||||
import { Readable } from "node:stream";
|
import { Readable } from "node:stream";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
import { PrismaService } from "src/prisma/prisma.service";
|
||||||
import { fileTypeFromBuffer } from "file-type";
|
import { fileTypeFromBuffer } from "file-type";
|
||||||
import { DiskStorageService } from "src/modules/attachments/services/disk-storage.service";
|
|
||||||
import { VariantsQueue } from "src/modules/attachments/services/variants.queue";
|
|
||||||
import { Result } from "src/common/errors/result-error.factory";
|
import { Result } from "src/common/errors/result-error.factory";
|
||||||
|
import { DiskStorageService } from "src/time-and-attendance/attachments/services/disk-storage.service";
|
||||||
|
import { VariantsQueue } from "src/time-and-attendance/attachments/services/variants.queue";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AttachmentUploadService {
|
export class AttachmentUploadService {
|
||||||
|
|
@ -4,8 +4,8 @@ import { promises as fsp } from 'node:fs';
|
||||||
import { createWriteStream, statSync, existsSync } from 'node:fs';
|
import { createWriteStream, statSync, existsSync } from 'node:fs';
|
||||||
import { join, dirname } from 'node:path';
|
import { join, dirname } from 'node:path';
|
||||||
import { pipeline } from 'node:stream/promises';
|
import { pipeline } from 'node:stream/promises';
|
||||||
import { ATT_TMP_DIR } from 'src/config/attachment.config';
|
import { ATT_TMP_DIR } from 'src/time-and-attendance/attachments/config/attachment.config';
|
||||||
import { casPathFor, getAbsolutePath } from 'src/modules/attachments/utils/cas.util';
|
import { casPathFor, getAbsolutePath } from 'src/time-and-attendance/attachments/cas.util';
|
||||||
|
|
||||||
export type SaveResult = { sha256: string, storage_path: string, size: number };
|
export type SaveResult = { sha256: string, storage_path: string, size: number };
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Cron } from "@nestjs/schedule";
|
||||||
import { PrismaService } from 'src/prisma/prisma.service';
|
import { PrismaService } from 'src/prisma/prisma.service';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import { promises as fsp } from 'node:fs';
|
import { promises as fsp } from 'node:fs';
|
||||||
import { resolveAttachmentsRoot } from "src/config/attachment.config";
|
import { resolveAttachmentsRoot } from "src/time-and-attendance/attachments/config/attachment.config";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GarbargeCollectorService {
|
export class GarbargeCollectorService {
|
||||||
|
|
@ -4,7 +4,7 @@ import sharp from 'sharp';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import { promises as fsp } from 'node:fs';
|
import { promises as fsp } from 'node:fs';
|
||||||
import { resolveAttachmentsRoot } from 'src/config/attachment.config';
|
import { resolveAttachmentsRoot } from 'src/time-and-attendance/attachments/config/attachment.config';
|
||||||
|
|
||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
const q_name = `${process.env.BULL_PREFIX || 'attachments'}:variants`;
|
const q_name = `${process.env.BULL_PREFIX || 'attachments'}:variants`;
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post } from "@nestjs/common";
|
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post } from "@nestjs/common";
|
||||||
import { BankCodesService } from "../services/bank-codes.service";
|
import { BankCodesService } from "../services/bank-codes.service";
|
||||||
import { BankCodeDto } from "../dtos/bank-code.dto";
|
import { BankCodeDto } from "../bank-code.dto";
|
||||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||||
import { Modules as ModulesEnum } from ".prisma/client";
|
import { Modules as ModulesEnum } from ".prisma/client";
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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 { BankCodeDto } from "../dtos/bank-code.dto";
|
|
||||||
import { BankCodes } from "@prisma/client";
|
import { BankCodes } from "@prisma/client";
|
||||||
|
import { BankCodeDto } from "src/time-and-attendance/bank-codes/bank-code.dto";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BankCodesService {
|
export class BankCodesService {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Controller, Get, Header, Query} from "@nestjs/common";
|
import { Controller, Get, Header, Query} from "@nestjs/common";
|
||||||
import { CsvExportService } from "../services/csv-exports.service";
|
import { CsvExportService } from "./csv-exports.service";
|
||||||
import { ExportCsvOptionsDto } from "../dtos/export-csv-options.dto";
|
import { ExportCsvOptionsDto } from "./export-csv-options.dto";
|
||||||
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
import { ModuleAccessAllowed } from "src/common/decorators/modules-guard.decorators";
|
||||||
import { Modules as ModulesEnum } from ".prisma/client";
|
import { Modules as ModulesEnum } from ".prisma/client";
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Module } from "@nestjs/common";
|
import { Module } from "@nestjs/common";
|
||||||
import { CsvExportController } from "./controllers/csv-exports.controller";
|
import { CsvExportController } from "./csv-exports.controller";
|
||||||
import { CsvExportService } from "./services/csv-exports.service";
|
import { CsvExportService } from "./csv-exports.service";
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
providers:[CsvExportService],
|
providers:[CsvExportService],
|
||||||
|
|
@ -20,9 +20,9 @@ import { PayPeriodsController } from "src/time-and-attendance/pay-period/pay-per
|
||||||
import { PayPeriodsQueryService } from "src/time-and-attendance/pay-period/services/pay-periods-query.service";
|
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";
|
import { PayPeriodsCommandService } from "src/time-and-attendance/pay-period/services/pay-periods-command.service";
|
||||||
|
|
||||||
import { CsvExportModule } from "src/modules/exports/csv-exports.module";
|
import { CsvExportModule } from "src/time-and-attendance/exports/csv-exports.module";
|
||||||
import { CsvExportService } from "src/modules/exports/services/csv-exports.service";
|
import { CsvExportService } from "src/time-and-attendance/exports/csv-exports.service";
|
||||||
import { CsvExportController } from "src/modules/exports/controllers/csv-exports.controller";
|
import { CsvExportController } from "src/time-and-attendance/exports/csv-exports.controller";
|
||||||
|
|
||||||
import { ShiftController } from "src/time-and-attendance/shifts/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 { ShiftsCreateService } from "src/time-and-attendance/shifts/services/shifts-create.service";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user