"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PurchaseOrderExpense = exports.ProductPurchaseLookup = void 0;
const jackson_js_1 = require("jackson-js");
const transaction_1 = require("../../dto/transaction");
const lodash_1 = __importDefault(require("lodash"));
class ProductPurchaseLookup {
    constructor(productPurchaseId, quantity) {
        this.productPurchaseId = productPurchaseId;
        this.quantity = quantity;
    }
}
__decorate([
    (0, jackson_js_1.JsonProperty)()
], ProductPurchaseLookup.prototype, "productPurchaseId", void 0);
__decorate([
    (0, jackson_js_1.JsonProperty)()
], ProductPurchaseLookup.prototype, "quantity", void 0);
exports.ProductPurchaseLookup = ProductPurchaseLookup;
class PurchaseOrderExpense {
    constructor(expense) {
        // PurchaseOrderExpense is ment to be a message payload, therefore we need to
        // strip useless fields
        const exp = lodash_1.default.cloneDeep(expense);
        exp.strip();
        this.purchaseOrderStatus = "";
        this.expenseType = "";
        this.productPurchasesMap = {};
        this.expense = exp;
    }
}
__decorate([
    (0, jackson_js_1.JsonProperty)()
], PurchaseOrderExpense.prototype, "purchaseOrderStatus", void 0);
__decorate([
    (0, jackson_js_1.JsonProperty)()
], PurchaseOrderExpense.prototype, "expenseType", void 0);
__decorate([
    (0, jackson_js_1.JsonProperty)(),
    (0, jackson_js_1.JsonClassType)({ type: () => [Object] })
], PurchaseOrderExpense.prototype, "productPurchasesMap", void 0);
__decorate([
    (0, jackson_js_1.JsonProperty)(),
    (0, jackson_js_1.JsonClassType)({ type: () => [transaction_1.Transaction] })
], PurchaseOrderExpense.prototype, "expense", void 0);
exports.PurchaseOrderExpense = PurchaseOrderExpense;
//# sourceMappingURL=expense.js.map