"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScorecardAnswer = exports.ScorecardAnswerSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.ScorecardAnswerSchema = new mongoose_1.default.Schema({
    submissionId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.scorecardSubmission,
        required: true,
    },
    criterionKey: {
        type: String,
        required: true,
    },
    value: {
        type: mongoose_1.default.Schema.Types.Mixed,
        required: true,
    },
    calculatedScore: {
        type: Number,
        required: true,
    },
}, {
    timestamps: { createdAt: true, updatedAt: true },
    versionKey: false,
});
exports.ScorecardAnswer = mongoose_1.default.model(_models_1.MODEL_NAMES.scorecardAnswer, exports.ScorecardAnswerSchema);
exports.ScorecardAnswerSchema.index({ submissionId: 1, criterionKey: 1 }, { unique: true });
