"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TopUpOrderModelConverter = exports.TopUpOrderStatus = void 0;
const firestore_1 = require("firebase-admin/firestore");
var TopUpOrderStatus;
(function (TopUpOrderStatus) {
    TopUpOrderStatus["created"] = "created";
    TopUpOrderStatus["paid"] = "paid";
    TopUpOrderStatus["canceled"] = "canceled";
    TopUpOrderStatus["failed"] = "failed";
})(TopUpOrderStatus = exports.TopUpOrderStatus || (exports.TopUpOrderStatus = {}));
exports.TopUpOrderModelConverter = {
    toFirestore: function (modelObject) {
        const data = Object.assign({}, modelObject);
        if (data.createdAt) {
            data.createdAt = firestore_1.Timestamp.fromDate(data.createdAt);
        }
        return data;
    },
    fromFirestore: function (snapshot) {
        const data = snapshot.data();
        if (data.createdAt) {
            data.createdAt = data.createdAt.toDate();
        }
        if (data.updatedAt) {
            data.updatedAt = data.updatedAt.toDate();
        }
        data.id = snapshot.id;
        return data;
    },
};
//# sourceMappingURL=topup_order_model.js.map