"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dayjs_1 = __importDefault(require("dayjs"));
const RoomstaySession_1 = require("../RoomstaySession");
class RoomRateNight {
    constructor() {
        this.fees = [];
    }
    serialize() {
        const toSerialize = {
            date: this.date.format(RoomstaySession_1.SERIALIZED_DATE_FORMAT),
            cost: this.cost,
            tax: this.tax,
            discount: this.discount,
            fee: this.fee,
            total: this.total,
            available: this.available,
        };
        return toSerialize;
    }
    unSerialize(data) {
        const { date, cost, tax, discount, fee, total, available } = data;
        this.date = (0, dayjs_1.default)(date, RoomstaySession_1.SERIALIZED_DATE_FORMAT);
        this.cost = cost;
        this.tax = tax;
        this.discount = discount;
        this.fee = fee;
        this.total = total;
        this.available = available;
        return this;
    }
}
exports.default = RoomRateNight;
//# sourceMappingURL=RoomRateNight.js.map