"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MicroserviceTaskModel = exports.MicroserviceTaskSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
const mongooseLeanId = require('../plugins/id.plugin');
exports.MicroserviceTaskSchema = new mongoose_1.default.Schema({
    cmd: {
        type: String,
        required: true,
    },
    params: {
        type: mongoose_1.default.Schema.Types.Mixed,
        required: true,
    },
    userId: {
        type: String,
    },
    status: {
        type: String,
    },
    executeAt: {
        type: Date,
    },
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.MicroserviceTaskSchema.plugin(mongooseLeanId);
exports.MicroserviceTaskModel = mongoose_1.default.model(_models_1.MODEL_NAMES.microserviceTasks, exports.MicroserviceTaskSchema);
