@zeniai/client-epic-state 4.11.21 → 4.11.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ exports.toTransactionUpdatesFromTransactionDetailLocalData = void 0;
|
|
|
4
4
|
const recommendationBase_1 = require("../../../commonStateTypes/recommendationBase");
|
|
5
5
|
const entity_1 = require("../../../entity/genericEntity/entity");
|
|
6
6
|
const customerTransaction_1 = require("../../../entity/transaction/stateTypes/customerTransaction");
|
|
7
|
+
const transactionType_1 = require("../../../entity/transaction/stateTypes/transactionType");
|
|
7
8
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
8
9
|
const recommendationState_1 = require("../../recommendation/recommendationState");
|
|
9
10
|
// This function will extract the data that will determine which all APIs need to be called
|
|
@@ -259,8 +260,12 @@ const isTransactionMiscategorized = (transaction) => {
|
|
|
259
260
|
const lineItem = line;
|
|
260
261
|
if (lineItem.isCategoryMiscategorized ||
|
|
261
262
|
lineItem.isClassMiscategorized ||
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
// This ensures that neither vendor or customer is present at line level, safe to say miscat line due to vendor/customer
|
|
264
|
+
((0, transactionType_1.toVendorTransactionTypeStrict)(transaction.type) &&
|
|
265
|
+
transaction.vendor == null) ||
|
|
266
|
+
((0, transactionType_1.toJEAndDepositTransactionTypeStrict)(transaction.type) &&
|
|
267
|
+
lineItem.vendor == null &&
|
|
268
|
+
lineItem.customer == null)) {
|
|
264
269
|
isTransactionMisCategorized = true;
|
|
265
270
|
}
|
|
266
271
|
}
|
|
@@ -68,7 +68,8 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
68
68
|
if ((0, transactionType_1.toVendorTransactionTypeStrict)(response.data.transaction.transaction_type) != null ||
|
|
69
69
|
(0, transactionType_1.toJEAndDepositTransactionTypeStrict)(response.data.transaction.transaction_type) != null) {
|
|
70
70
|
const isAnyClassMissing = checkIfClassMissingForAnyLineItem(response.data.transaction);
|
|
71
|
-
const isVendorOrCustomerMissingInAnyLine =
|
|
71
|
+
const isVendorOrCustomerMissingInAnyLine = (0, transactionType_1.toJEAndDepositTransactionTypeStrict)(response.data.transaction.transaction_type) != null &&
|
|
72
|
+
checkIfVendorOrCustomerMissingForAnyLineItem(response.data.transaction);
|
|
72
73
|
if (((vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.id) == null &&
|
|
73
74
|
isVendorOrCustomerMissingInAnyLine == true) ||
|
|
74
75
|
isAnyClassMissing == true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.22",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|