"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.reportsSchema = exports.reportResultsSchema = exports.reportResultsOverviewSchema = void 0;
const CommonSchemas = __importStar(require("./mongoose-common-schemas"));
const mongoose_1 = require("mongoose");
const mongoose_common_schemas_1 = require("../Mongoose/mongoose-common-schemas");
exports.reportResultsOverviewSchema = new mongoose_1.Schema({
    Index: { required: false, type: Number },
    date: { required: true, type: Date },
    duration: { required: true, type: Number },
    durationHHMMSS: { required: true, type: String },
    executionDate: { required: true, type: String },
    executionTime: { required: true, type: String },
    metadata: [{ required: false, type: mongoose_common_schemas_1.metadataSchema }],
    name: { required: false, type: String },
    status: { required: true, type: mongoose_common_schemas_1.statusSchema },
    version: { required: false, type: String },
}, {
    _id: false,
    id: false,
});
exports.reportResultsSchema = new mongoose_1.Schema({
    features: { required: true, type: CommonSchemas.moduleResultsSchema },
    overview: { required: true, type: exports.reportResultsOverviewSchema },
    scenarios: { required: true, type: CommonSchemas.moduleResultsSchema },
    steps: { required: true, type: CommonSchemas.moduleResultsSchema },
}, {
    _id: false,
    id: false,
});
exports.reportsSchema = new mongoose_1.Schema({
    // _id: { required: true, type: String },
    // features: [{ required: false , type: featureSchema }],
    // id: { required: false, type: String },
    metadata: [{ required: true, type: CommonSchemas.metadataSchema }],
    results: { required: true, type: exports.reportResultsSchema }
}, {
    // _id: false,
    id: false,
    toJSON: {
        // transform: ( ret: ExtendedReport ) =>{
        //  delete ret._id;
        // },
        versionKey: false,
        virtuals: true
    },
    toObject: {
        versionKey: false,
        virtuals: true
    }
});
exports.reportsSchema.virtual('features', {
    foreignField: 'reportId',
    justOne: false,
    localField: '_id',
    ref: 'Feature',
});
//# sourceMappingURL=mongoose-extended-report-schema.js.map