diff --git a/src/app.module.ts b/src/app.module.ts index e3ab847..4022a3a 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -4,6 +4,7 @@ import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler'; import { AppController } from './app.controller'; import { DatabaseModule } from './infra/database/database.module'; import { AdminModule } from './modules/admin/admin.module'; +import { AttendanceModule } from './modules/attendance/attendance.module'; import { AuthModule } from './modules/auth/auth.module'; import { KnowledgeBaseModule } from './modules/knowledge-base/knowledge-base.module'; import { WhatsappModule } from './modules/whatsapp/whatsapp.module'; @@ -19,6 +20,7 @@ import { WhatsappModule } from './modules/whatsapp/whatsapp.module'; DatabaseModule, AuthModule, AdminModule, + AttendanceModule, KnowledgeBaseModule, WhatsappModule, ], diff --git a/src/modules/whatsapp/whatsapp-assignment.service.ts b/src/modules/attendance/attendance-assignment.service.ts similarity index 99% rename from src/modules/whatsapp/whatsapp-assignment.service.ts rename to src/modules/attendance/attendance-assignment.service.ts index b555380..d06e7cc 100644 --- a/src/modules/whatsapp/whatsapp-assignment.service.ts +++ b/src/modules/attendance/attendance-assignment.service.ts @@ -116,8 +116,8 @@ const SALES_KEYWORDS = [ ]; @Injectable() -export class WhatsappAssignmentService implements OnModuleInit { - private readonly logger = new Logger(WhatsappAssignmentService.name); +export class AttendanceAssignmentService implements OnModuleInit { + private readonly logger = new Logger(AttendanceAssignmentService.name); constructor( private readonly db: DatabaseService, diff --git a/src/modules/attendance/attendance.module.ts b/src/modules/attendance/attendance.module.ts new file mode 100644 index 0000000..1fb1087 --- /dev/null +++ b/src/modules/attendance/attendance.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { AdminModule } from '../admin/admin.module'; +import { AttendanceAssignmentService } from './attendance-assignment.service'; + +@Module({ + imports: [AdminModule], + providers: [AttendanceAssignmentService], + exports: [AttendanceAssignmentService], +}) +export class AttendanceModule {} diff --git a/src/modules/whatsapp/whatsapp.controller.ts b/src/modules/whatsapp/whatsapp.controller.ts index 83334e2..2160f01 100644 --- a/src/modules/whatsapp/whatsapp.controller.ts +++ b/src/modules/whatsapp/whatsapp.controller.ts @@ -1,14 +1,14 @@ import { Controller, Get, Post, Body, Delete, Param } from '@nestjs/common'; import { ApiBody, ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger'; import { WhatsappService } from './whatsapp.service'; -import { WhatsappAssignmentService } from './whatsapp-assignment.service'; +import { AttendanceAssignmentService } from '../attendance/attendance-assignment.service'; @ApiTags('WhatsApp') @Controller('whatsapp') export class WhatsappController { constructor( private readonly whatsappService: WhatsappService, - private readonly assignmentService: WhatsappAssignmentService + private readonly assignmentService: AttendanceAssignmentService ) {} @ApiOperation({ diff --git a/src/modules/whatsapp/whatsapp.module.ts b/src/modules/whatsapp/whatsapp.module.ts index c2cdffb..c2010de 100644 --- a/src/modules/whatsapp/whatsapp.module.ts +++ b/src/modules/whatsapp/whatsapp.module.ts @@ -2,14 +2,13 @@ import { Module } from '@nestjs/common'; import { WhatsappService } from './whatsapp.service'; import { WhatsappGateway } from './whatsapp.gateway'; import { WhatsappController } from './whatsapp.controller'; -import { WhatsappAssignmentService } from './whatsapp-assignment.service'; -import { AdminModule } from '../admin/admin.module'; +import { AttendanceModule } from '../attendance/attendance.module'; import { AuthModule } from '../auth/auth.module'; @Module({ - imports: [AdminModule, AuthModule], - providers: [WhatsappService, WhatsappGateway, WhatsappAssignmentService], + imports: [AttendanceModule, AuthModule], + providers: [WhatsappService, WhatsappGateway], controllers: [WhatsappController], - exports: [WhatsappService, WhatsappAssignmentService], + exports: [WhatsappService], }) export class WhatsappModule {} diff --git a/src/modules/whatsapp/whatsapp.service.ts b/src/modules/whatsapp/whatsapp.service.ts index 671fcd3..5d30e17 100644 --- a/src/modules/whatsapp/whatsapp.service.ts +++ b/src/modules/whatsapp/whatsapp.service.ts @@ -1,7 +1,7 @@ import { Injectable, Logger, OnModuleInit } from '@nestjs/common'; import { Client, LocalAuth, MessageMedia } from 'whatsapp-web.js'; import { WhatsappGateway } from './whatsapp.gateway'; -import { WhatsappAssignmentService } from './whatsapp-assignment.service'; +import { AttendanceAssignmentService } from '../attendance/attendance-assignment.service'; import { DatabaseService } from '../../infra/database/database.service'; import * as fs from 'fs'; import * as path from 'path'; @@ -18,7 +18,7 @@ export class WhatsappService implements OnModuleInit { constructor( private readonly gateway: WhatsappGateway, - private readonly assignmentService: WhatsappAssignmentService, + private readonly assignmentService: AttendanceAssignmentService, private readonly db: DatabaseService ) {}