"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayableAccountItem = void 0;
const lodash_1 = __importDefault(require("lodash"));
const column_desciptions_helper_1 = require("../helpers/column-desciptions.helper");
const collaterals_enum_1 = require("../enums/collaterals.enum");
class PayableAccountItem {
    bbcDate = null;
    apDate = '';
    poNumber = '';
    customerName = '';
    amount = 0;
    otherInformation1 = '';
    otherInformation2 = '';
    otherInformation3 = '';
    constructor(item, bbcDate = null) {
        const itemWithDates = (0, column_desciptions_helper_1.convertIntoDates)(item, collaterals_enum_1.ECollaterals.ACCOUNT_PAYABLE);
        const itemWithoutNulls = lodash_1.default.omitBy(itemWithDates, (value) => value === null);
        Object.assign(this, itemWithoutNulls);
        this.bbcDate = bbcDate;
        this.apDate = !this.apDate ? (new Date()).toISOString() : this.apDate;
    }
}
exports.PayableAccountItem = PayableAccountItem;
