"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerPortalPasswords = 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
    },
    id_user: {
        type: String
    },
    cipher_text: {
        type: String
    },
    iv: {
        type: String
    },
    auth_tag: {
        type: String
    },
    key_version: {
        type: Number
    },
    last_set_at: {
        type: Date
    },
    updated_by_user_id: {
        type: String,
        optional: true
    },
    updated_by_user: {
        type: String,
        optional: true
    }
};
exports.CustomerPortalPasswords = 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: 'customer-portal-passwords',
            schema: schema,
            useVersionCollection: false,
            useReportBuilder: false,
            reportBuilderLookupTables: [],
            timestamps: true,
            createLogs: false,
            checkSchema: true,
            collectionOptions: null
        });
        exports.CustomerPortalPasswords = model.collection_main;
        exports.CustomerPortalPasswords.createIndex({ id_user: 1 }, { unique: true });
    }
    else {
        setImmediate(function () {
            initializeCollection();
        });
    }
}

//# sourceMappingURL=customer-portal-password.collection.js.map
