"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AvailabilitySignsModel = exports.AvailabilitySignSchema = exports.REQUIRED_SIGNS = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.REQUIRED_SIGNS = 2;
exports.AvailabilitySignSchema = new mongoose_1.default.Schema({
    bbcDateId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.BBCDates,
        required: true,
    },
    requiredSigns: {
        type: Number,
        required: true,
        default: exports.REQUIRED_SIGNS,
    },
    signs: [
        {
            userSignedId: {
                type: String,
                required: true,
            },
            signedAt: {
                type: Date,
                required: true,
            },
            userRevokedId: {
                type: String,
                required: false,
            },
            revokedAt: {
                type: Date,
                required: false,
            },
        },
    ],
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.AvailabilitySignsModel = mongoose_1.default.model(_models_1.MODEL_NAMES.availabilitySign, exports.AvailabilitySignSchema);
