{"size": 1315, "ext": "js", "max_stars_repo_path": "build/models/reservation.js", "max_stars_repo_name": "arthur-mts/mega-hack-3", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/models/reservation.js", "max_issues_repo_name": "arthur-mts/mega-hack-3", "max_issues_repo_issues_event_min_datetime": "2021-09-02T13:32:06.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T13:32:06.000Z", "max_forks_repo_path": "build/models/reservation.js", "max_forks_repo_name": "arthur-mts/mega-hack-3", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 35.5405405405, "max_line_length": 86, "alphanum_fraction": 0.6790874525}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Reservation = exports.ReservationStatus = void 0;
var mongoose_1 = require("mongoose");
var FeedbackSchema = new mongoose_1.Schema({
    description: String,
    attendance: Number,
    hygiene: Number,
    price: Number,
    drinksQuality: Number,
});
var ReservationStatus;
(function (ReservationStatus) {
    ReservationStatus["PENDING"] = "PENDING";
    ReservationStatus["REFUSED"] = "REFUSED";
    ReservationStatus["APPROVED"] = "APPROVED";
    ReservationStatus["CLOSED"] = "CLOSED";
    ReservationStatus["OPEN"] = "OPEN";
    //TODO: Rever a regra de negocio de quando o user da checkin
})(ReservationStatus = exports.ReservationStatus || (exports.ReservationStatus = {}));
// pending, refused, approved, closed
var ReservationSchema = new mongoose_1.Schema({
    userId: { type: mongoose_1.Types.ObjectId, ref: 'User' },
    establishmentId: { type: mongoose_1.Types.ObjectId, ref: 'Establishment' },
    schedule: Date,
    status: {
        type: String,
        enum: ['PENDING', 'REFUSED', 'APPROVED', 'CLOSED', 'OPEN'],
        default: 'PENDING',
    },
    feedback: {
        type: FeedbackSchema,
        default: undefined,
    },
});
exports.Reservation = mongoose_1.model('Reservation', ReservationSchema);
