UNPKG

wallee

Version:
60 lines (59 loc) 3.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfBankTransaction = instanceOfBankTransaction; exports.BankTransactionFromJSON = BankTransactionFromJSON; exports.BankTransactionFromJSONTyped = BankTransactionFromJSONTyped; exports.BankTransactionToJSON = BankTransactionToJSON; exports.BankTransactionToJSONTyped = BankTransactionToJSONTyped; const BankTransactionFlowDirection_1 = require("./BankTransactionFlowDirection"); const BankTransactionState_1 = require("./BankTransactionState"); const CurrencyBankAccount_1 = require("./CurrencyBankAccount"); const PaymentAdjustment_1 = require("./PaymentAdjustment"); /** * Check if a given object implements the BankTransaction interface. */ function instanceOfBankTransaction(value) { return true; } function BankTransactionFromJSON(json) { return BankTransactionFromJSONTyped(json, false); } function BankTransactionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'adjustments': json['adjustments'] == null ? undefined : (json['adjustments'].map(PaymentAdjustment_1.PaymentAdjustmentFromJSON)), 'currencyBankAccount': json['currencyBankAccount'] == null ? undefined : (0, CurrencyBankAccount_1.CurrencyBankAccountFromJSON)(json['currencyBankAccount']), 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'externalId': json['externalId'] == null ? undefined : json['externalId'], 'postingAmount': json['postingAmount'] == null ? undefined : json['postingAmount'], 'source': json['source'] == null ? undefined : json['source'], 'valueDate': json['valueDate'] == null ? undefined : (new Date(json['valueDate'])), 'type': json['type'] == null ? undefined : json['type'], 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'version': json['version'] == null ? undefined : json['version'], 'reference': json['reference'] == null ? undefined : json['reference'], 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'valueAmount': json['valueAmount'] == null ? undefined : json['valueAmount'], 'flowDirection': json['flowDirection'] == null ? undefined : (0, BankTransactionFlowDirection_1.BankTransactionFlowDirectionFromJSON)(json['flowDirection']), 'createdBy': json['createdBy'] == null ? undefined : json['createdBy'], 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : (0, BankTransactionState_1.BankTransactionStateFromJSON)(json['state']), 'paymentDate': json['paymentDate'] == null ? undefined : (new Date(json['paymentDate'])), 'totalAdjustmentAmountIncludingTax': json['totalAdjustmentAmountIncludingTax'] == null ? undefined : json['totalAdjustmentAmountIncludingTax'], }; } function BankTransactionToJSON(json) { return BankTransactionToJSONTyped(json, false); } function BankTransactionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'currencyBankAccount': (0, CurrencyBankAccount_1.CurrencyBankAccountToJSON)(value['currencyBankAccount']), 'flowDirection': (0, BankTransactionFlowDirection_1.BankTransactionFlowDirectionToJSON)(value['flowDirection']), 'state': (0, BankTransactionState_1.BankTransactionStateToJSON)(value['state']), }; }