2025-09-04 20:17:04 -04:00
|
|
|
import { Module } from '@nestjs/common';
|
2025-09-09 21:19:17 -04:00
|
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
2025-09-04 20:17:04 -04:00
|
|
|
import { AppController } from './app.controller';
|
|
|
|
|
import { AppService } from './app.service';
|
2025-09-04 21:04:15 -04:00
|
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
2025-09-12 13:18:11 -04:00
|
|
|
import { StudentModule } from './alumno/student.module';
|
2025-09-09 21:19:17 -04:00
|
|
|
import { UserModule } from './user/user.module';
|
2025-09-17 16:33:57 -06:00
|
|
|
import { Perfil, User } from './user/entities/user.entity';
|
2025-09-10 17:32:00 -06:00
|
|
|
import { DetalleServicioModule } from './detalle_servicio/detalle_servicio.module';
|
|
|
|
|
import { PeriodoModule } from './periodo/periodo.module';
|
|
|
|
|
import { ServicioModule } from './servicio/servicio.module';
|
2025-09-12 13:18:11 -04:00
|
|
|
import { Student } from './alumno/entities/student.entity';
|
|
|
|
|
import { DetalleServicio } from './detalle_servicio/entities/detalle_servicio.entity';
|
|
|
|
|
import { Periodo } from './periodo/entities/periodo.entity';
|
|
|
|
|
import { Servicio } from './servicio/entities/servicio.entity';
|
2025-09-17 16:35:52 -06:00
|
|
|
import { SancionModule } from './sancion/sancion.module';
|
|
|
|
|
import { AlumnoSancionModule } from './alumno_sancion/alumno_sancion.module';
|
|
|
|
|
import { AlumnoSancion } from './alumno_sancion/entities/alumno_sancion.entity';
|
2025-09-04 20:17:04 -04:00
|
|
|
|
|
|
|
|
@Module({
|
2025-09-04 21:04:15 -04:00
|
|
|
imports: [
|
2025-09-09 21:19:17 -04:00
|
|
|
ConfigModule.forRoot({
|
2025-09-14 17:51:17 -06:00
|
|
|
isGlobal: true,
|
2025-09-09 21:19:17 -04:00
|
|
|
envFilePath: '.env',
|
|
|
|
|
}),
|
|
|
|
|
TypeOrmModule.forRootAsync({
|
|
|
|
|
inject: [ConfigService],
|
|
|
|
|
useFactory: async (configService: ConfigService) => ({
|
|
|
|
|
type: 'mariadb',
|
|
|
|
|
host: configService.get<string>('DB_HOST'),
|
|
|
|
|
port: configService.get<number>('DB_PORT'),
|
|
|
|
|
username: configService.get<string>('DB_USER'),
|
|
|
|
|
password: configService.get<string>('DB_PASSWORD'),
|
|
|
|
|
database: configService.get<string>('DB_NAME'),
|
2025-09-17 16:35:52 -06:00
|
|
|
entities: [
|
|
|
|
|
User,
|
|
|
|
|
Student,
|
|
|
|
|
DetalleServicio,
|
|
|
|
|
Periodo,
|
|
|
|
|
Servicio,
|
|
|
|
|
Perfil,
|
|
|
|
|
AlumnoSancion,
|
|
|
|
|
],
|
|
|
|
|
synchronize: false, //Never change to true in production!
|
2025-09-09 21:19:17 -04:00
|
|
|
}),
|
2025-09-04 21:04:15 -04:00
|
|
|
}),
|
2025-09-09 21:19:17 -04:00
|
|
|
UserModule,
|
2025-09-12 13:18:11 -04:00
|
|
|
StudentModule,
|
2025-09-10 17:32:00 -06:00
|
|
|
DetalleServicioModule,
|
|
|
|
|
PeriodoModule,
|
|
|
|
|
ServicioModule,
|
2025-09-14 17:51:17 -06:00
|
|
|
StudentModule,
|
2025-09-17 16:35:52 -06:00
|
|
|
SancionModule,
|
|
|
|
|
AlumnoSancionModule,
|
2025-09-09 21:19:17 -04:00
|
|
|
],
|
2025-09-04 20:17:04 -04:00
|
|
|
controllers: [AppController],
|
|
|
|
|
providers: [AppService],
|
|
|
|
|
})
|
2025-09-09 21:19:17 -04:00
|
|
|
export class AppModule {}
|