forked from Yara724/api
85 lines
3.0 KiB
TypeScript
85 lines
3.0 KiB
TypeScript
import { join } from "node:path";
|
|
import { APP_INTERCEPTOR } from "@nestjs/core";
|
|
import { Module } from "@nestjs/common";
|
|
import { ConfigModule } from "@nestjs/config";
|
|
import { UnicodeDigitsNormalizeInterceptor } from "./common/interceptors/unicode-digits-normalize.interceptor";
|
|
import { MongooseModule } from "@nestjs/mongoose";
|
|
import { ServeStaticModule } from "@nestjs/serve-static";
|
|
import { AiModule } from "./ai/ai.module";
|
|
import { AuthModule } from "./auth/auth.module";
|
|
import { ClaimRequestManagementModule } from "./claim-request-management/claim-request-management.module";
|
|
import { ClientModule } from "./client/client.module";
|
|
import { ExpertBlameModule } from "./expert-blame/expert-blame.module";
|
|
import { ExpertClaimModule } from "./expert-claim/expert-claim.module";
|
|
import { ExpertInsurerModule } from "./expert-insurer/expert-insurer.module";
|
|
import { LookupsModule } from "./lookups/lookups.module";
|
|
import { PlatesModule } from "./plates/plates.module";
|
|
import { ProfileModule } from "./profile/profile.module";
|
|
import { SandHubModule } from "./sand-hub/sand-hub.module";
|
|
import { SystemSettingsModule } from "./system-settings/system-settings.module";
|
|
import { ReportsModule } from "./reports/reports.module";
|
|
import { RequestManagementModule } from "./request-management/request-management.module";
|
|
import { UsersModule } from "./users/users.module";
|
|
import { applyIranFaTimestampPlugin } from "./helpers/mongoose-fa-timestamps.plugin";
|
|
import { CronModule } from "./utils/cron/cron.module";
|
|
import { WorkflowStepManagementModule } from "./workflow-step-management/workflow-step-management.module";
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true }),
|
|
CronModule,
|
|
ServeStaticModule.forRoot({
|
|
rootPath: join(__dirname, "..", "files"),
|
|
serveRoot: "/files",
|
|
}),
|
|
MongooseModule.forRoot(
|
|
`mongodb://${process.env.MONGO_URL}:${process.env.MONGO_PORT}/`,
|
|
{
|
|
dbName: "yara724",
|
|
autoIndex: true,
|
|
user: process.env.MONGO_USER,
|
|
pass: process.env.MONGO_PASS,
|
|
authMechanism: "SCRAM-SHA-256",
|
|
tls: true,
|
|
tlsAllowInvalidCertificates: true,
|
|
connectionFactory: (connection) => {
|
|
applyIranFaTimestampPlugin(connection);
|
|
return connection;
|
|
},
|
|
},
|
|
),
|
|
UsersModule,
|
|
AuthModule,
|
|
ClientModule,
|
|
ProfileModule,
|
|
PlatesModule,
|
|
RequestManagementModule,
|
|
SandHubModule,
|
|
SystemSettingsModule,
|
|
ExpertBlameModule,
|
|
ClaimRequestManagementModule,
|
|
ExpertClaimModule,
|
|
AiModule,
|
|
ReportsModule,
|
|
ExpertInsurerModule,
|
|
LookupsModule,
|
|
WorkflowStepManagementModule,
|
|
],
|
|
controllers: [],
|
|
providers: [
|
|
{
|
|
provide: APP_INTERCEPTOR,
|
|
useClass: UnicodeDigitsNormalizeInterceptor,
|
|
},
|
|
// {
|
|
// provide: APP_PIPE,
|
|
// useValue: new ValidationPipe({
|
|
// transform: true,
|
|
// whitelist: true,
|
|
// forbidNonWhitelisted: false,
|
|
// }),
|
|
// },
|
|
],
|
|
})
|
|
export class AppModule {}
|