"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportBuilderDashboardBuilders = 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
    },
    name: {
        type: String
    },
    date_created: {
        type: Date
    },
    id_user_created: {
        type: String
    },
    user_created: {
        type: String
    },
    num_rows: {
        type: Number
    },
    num_columns: {
        type: Number
    },
    report_rows: {
        type: Array
    },
    'report_rows.$': {
        type: Object
    },
    'report_rows.$.report_columns': {
        type: Array
    },
    'report_rows.$.report_columns.$': {
        type: Object
    },
    'report_rows.$.report_columns.$.id_report': {
        type: String
    },
    'report_rows.$.report_columns.$.report_name': {
        type: String
    },
    'report_rows.$.report_columns.$.report_type': {
        type: String
    },
    'report_rows.$.report_columns.$.display_type': {
        type: String
    },
    'report_rows.$.report_columns.$.display_values': {
        type: Array
    },
    'report_rows.$.report_columns.$.display_values.$': {
        type: String
    },
    'report_rows.$.report_columns.$.display_text': {
        type: String
    },
    'report_rows.$.report_columns.$.display_value': {
        type: String
    },
    other: {
        type: Object,
        blackbox: true,
        optional: true
    }
};
exports.ReportBuilderDashboardBuilders = 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: 'report-builder-dashboard-builders',
            schema: schema,
            useVersionCollection: false,
            useReportBuilder: false,
            reportBuilderLookupTables: [],
            timestamps: true,
            createLogs: true,
            checkSchema: true,
            collectionOptions: null
        });
        exports.ReportBuilderDashboardBuilders = model.collection_main;
        exports.ReportBuilderDashboardBuilders.createIndex({ name: 1 });
        exports.ReportBuilderDashboardBuilders.createIndex({ date_created: 1 });
    }
    else {
        setImmediate(function () {
            initializeCollection();
        });
    }
}

//# sourceMappingURL=report-builder-dashboard-builder.collection.js.map
