"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");
exports.reportResultsOverviewSchema = new mongoose_1.Schema({
    Index: { required: false, type: Number },
    date: { required: true, type: String },
    duration: { required: true, type: Number },
    durationHHMMSS: { required: true, type: String },
    icons: { required: false, type: String },
    metadata: [{ required: false, type: CommonSchemas.metadataSchema }],
    metadataTitle: { required: false, type: String },
    reportTitle: { required: false, type: String },
    result: { required: false, type: [CommonSchemas.resultSchema] },
    resultStatusesJoined: { required: false, type: String },
    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({
    metadata: [{ required: true, type: CommonSchemas.metadataSchema }],
    metadataTitle: { required: true, type: String },
    reportTitle: { required: true, type: String },
    results: { required: true, type: exports.reportResultsSchema },
}, {
    id: false,
    toJSON: {
        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