"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppSettings = void 0;
var mongo_manager_1 = require("../managers/mongo.manager");
var resolveio_server_app_1 = require("../resolveio-server-app");
var schema = {
    _id: {
        type: String,
        optional: true
    },
    __v: {
        type: Number,
        optional: true
    },
    updatedAt: {
        type: Date,
        optional: true
    },
    createdAt: {
        type: Date,
        optional: true
    },
    company_name: {
        type: String,
        optional: true
    },
    timezone: {
        type: String,
        optional: true
    },
    currency: {
        type: String,
        optional: true
    },
    invoice_prefix: {
        type: String,
        optional: true
    },
    support_email: {
        type: String,
        optional: true
    },
    support_phone: {
        type: String,
        optional: true
    },
    support_address: {
        type: String,
        optional: true
    },
    notes: {
        type: String,
        optional: true
    },
    enable_ai: {
        type: Boolean,
        optional: true
    },
    enable_auto_fix: {
        type: Boolean,
        optional: true
    },
    enable_slow_query_optimizer: {
        type: Boolean,
        optional: true
    },
    custom_settings: {
        type: Object,
        optional: true,
        blackbox: true
    },
    is_active: {
        type: Boolean,
        optional: true
    }
};
exports.AppSettings = null;
initializeCollection();
function initializeCollection() {
    if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
        var model = mongo_manager_1.MongoManagerModel.create({
            collectionName: 'app-settings',
            schema: schema,
            useVersionCollection: true,
            useReportBuilder: false,
            reportBuilderLookupTables: [],
            timestamps: true,
            createLogs: true,
            checkSchema: true,
            collectionOptions: null
        });
        exports.AppSettings = model.collection_main;
        exports.AppSettings.createIndex({ company_name: 1 });
        exports.AppSettings.createIndex({ is_active: 1 });
    }
    else {
        setImmediate(function () {
            initializeCollection();
        });
    }
}

//# sourceMappingURL=app-setting.collection.js.map
