"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppModule = void 0;
const common_1 = require("@nestjs/common");
const config_1 = require("@nestjs/config");
const throttler_1 = require("@nestjs/throttler");
const core_1 = require("@nestjs/core");
const app_config_1 = require("./config/app.config");
const database_config_1 = require("./config/database.config");
const jwt_config_1 = require("./config/jwt.config");
const google_config_1 = require("./config/google.config");
const mail_config_1 = require("./config/mail.config");
const database_module_1 = require("./database/database.module");
const auth_module_1 = require("./modules/auth/auth.module");
const users_module_1 = require("./modules/users/users.module");
const groups_module_1 = require("./modules/groups/groups.module");
const expenses_module_1 = require("./modules/expenses/expenses.module");
const settlements_module_1 = require("./modules/settlements/settlements.module");
const dashboard_module_1 = require("./modules/dashboard/dashboard.module");
const reports_module_1 = require("./modules/reports/reports.module");
const activity_module_1 = require("./modules/activity/activity.module");
const notifications_module_1 = require("./modules/notifications/notifications.module");
const search_module_1 = require("./modules/search/search.module");
const mail_module_1 = require("./modules/mail/mail.module");
const uploads_module_1 = require("./modules/uploads/uploads.module");
const health_module_1 = require("./modules/health/health.module");
const admin_module_1 = require("./modules/admin/admin.module");
const jwt_auth_guard_1 = require("./common/guards/jwt-auth.guard");
let AppModule = class AppModule {
};
exports.AppModule = AppModule;
exports.AppModule = AppModule = __decorate([
    (0, common_1.Module)({
        imports: [
            config_1.ConfigModule.forRoot({
                isGlobal: true,
                load: [app_config_1.default, database_config_1.default, jwt_config_1.default, google_config_1.default, mail_config_1.default],
                envFilePath: '.env',
            }),
            throttler_1.ThrottlerModule.forRootAsync({
                inject: [config_1.ConfigService],
                useFactory: (config) => [
                    {
                        ttl: config.get('app.throttleTtl', 60) * 1000,
                        limit: config.get('app.throttleLimit', 100),
                    },
                ],
            }),
            database_module_1.DatabaseModule,
            mail_module_1.MailModule,
            uploads_module_1.UploadsModule,
            auth_module_1.AuthModule,
            users_module_1.UsersModule,
            groups_module_1.GroupsModule,
            expenses_module_1.ExpensesModule,
            settlements_module_1.SettlementsModule,
            dashboard_module_1.DashboardModule,
            reports_module_1.ReportsModule,
            activity_module_1.ActivityModule,
            notifications_module_1.NotificationsModule,
            search_module_1.SearchModule,
            health_module_1.HealthModule,
            admin_module_1.AdminModule,
        ],
        providers: [
            { provide: core_1.APP_GUARD, useClass: jwt_auth_guard_1.JwtAuthGuard },
        ],
    })
], AppModule);
//# sourceMappingURL=app.module.js.map