"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.AdminModule = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const jwt_1 = require("@nestjs/jwt");
const auth_module_1 = require("../auth/auth.module");
const business_entity_1 = require("../database/entities/business.entity");
const user_entity_1 = require("../database/entities/user.entity");
const role_entity_1 = require("../database/entities/role.entity");
const permission_entity_1 = require("../database/entities/permission.entity");
const payment_entity_1 = require("../database/entities/payment.entity");
const subscription_entity_1 = require("../database/entities/subscription.entity");
const subscription_plan_entity_1 = require("../database/entities/subscription-plan.entity");
const router_entity_1 = require("../database/entities/router.entity");
const location_entity_1 = require("../database/entities/location.entity");
const commission_entity_1 = require("../database/entities/commission.entity");
const audit_log_entity_1 = require("../database/entities/audit-log.entity");
const api_log_entity_1 = require("../database/entities/api-log.entity");
const failed_job_entity_1 = require("../database/entities/failed-job.entity");
const system_settings_entity_1 = require("../database/entities/system-settings.entity");
const business_settings_entity_1 = require("../database/entities/business-settings.entity");
const customer_entity_1 = require("../database/entities/customer.entity");
const admin_service_1 = require("./admin.service");
const admin_controller_1 = require("./admin.controller");
const config_module_1 = require("../common/config/config.module");
const config_service_1 = require("../common/config/config.service");
let AdminModule = class AdminModule {
};
exports.AdminModule = AdminModule;
exports.AdminModule = AdminModule = __decorate([
    (0, common_1.Module)({
        imports: [
            auth_module_1.AuthModule,
            config_module_1.ConfigModule,
            jwt_1.JwtModule.registerAsync({
                imports: [config_module_1.ConfigModule],
                inject: [config_service_1.ConfigService],
                useFactory: (config) => ({
                    secret: config.get('JWT_SECRET', 'default-secret-change-me'),
                    signOptions: {
                        expiresIn: config.get('JWT_ACCESS_EXPIRY', '15m'),
                    },
                }),
            }),
            typeorm_1.TypeOrmModule.forFeature([
                business_entity_1.Business,
                user_entity_1.User,
                role_entity_1.Role,
                permission_entity_1.Permission,
                payment_entity_1.Payment,
                subscription_entity_1.Subscription,
                subscription_plan_entity_1.SubscriptionPlan,
                router_entity_1.Router,
                location_entity_1.Location,
                commission_entity_1.Commission,
                audit_log_entity_1.AuditLog,
                api_log_entity_1.ApiLog,
                failed_job_entity_1.FailedJob,
                system_settings_entity_1.SystemSettings,
                business_settings_entity_1.BusinessSettings,
                customer_entity_1.Customer,
            ]),
        ],
        controllers: [admin_controller_1.AdminController],
        providers: [admin_service_1.AdminService],
        exports: [admin_service_1.AdminService],
    })
], AdminModule);
