@zeniai/client-epic-state 5.1.55 → 5.1.57-beta0GS
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.
- package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconReducer.js +15 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/entity/accountRecon/accountReconReducer.js +15 -1
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +5 -3
- package/lib/esm/reducer.js +3 -0
- package/lib/esm/view/expenseAutomationView/selectors/statementParseViewSelector.js +0 -224
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +21 -0
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +20 -0
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +1 -0
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +76 -0
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +9 -0
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +1 -0
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +28 -0
- package/lib/index.d.ts +8 -4
- package/lib/index.js +46 -42
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.d.ts +1 -15
- package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.js +1 -233
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +7 -44
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.d.ts +7 -0
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +25 -0
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.d.ts +6 -0
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +24 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.d.ts +29 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +2 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.d.ts +16 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +80 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.d.ts +12 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +12 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.d.ts +8 -0
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +2 -0
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +28 -0
- package/package.json +1 -1
|
@@ -301,11 +301,13 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
|
|
|
301
301
|
const isLineIdInReplaceList = (findLineID) => lineIdsForReplace.find((lineId) => findLineID === lineId);
|
|
302
302
|
const isLineIdInUpdateList = (findLineID) => lineIdsForUpdateAll.find((lineId) => findLineID === lineId);
|
|
303
303
|
const newLineItems = {};
|
|
304
|
+
const persistedLineIds = new Set();
|
|
304
305
|
const checkIfNotJEAndDeposit = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
305
306
|
(0, customerTransaction_1.isCustomerTransaction)(transaction) === true;
|
|
306
307
|
if (transaction.lines != null) {
|
|
307
308
|
// always preserving the order of the line items. hence iterating over this
|
|
308
309
|
transaction.lines.forEach((line) => {
|
|
310
|
+
persistedLineIds.add(line.id);
|
|
309
311
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
310
312
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
311
313
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -436,6 +438,7 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
|
|
|
436
438
|
}
|
|
437
439
|
});
|
|
438
440
|
}
|
|
441
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
439
442
|
const newLocalData = {
|
|
440
443
|
...transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
441
444
|
memo: transactionDetailLocalData.memo,
|
|
@@ -457,11 +460,13 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
|
|
|
457
460
|
exports.toUpdateLineItemsOriginalCategoryClass = toUpdateLineItemsOriginalCategoryClass;
|
|
458
461
|
const toSetAllLineItemsToCategoryClass = (transaction, transactionDetailLocalData, isUpdateAll, lineEntity, chosenAccount, chosenClass) => {
|
|
459
462
|
const newLineItems = {};
|
|
463
|
+
const persistedLineIds = new Set();
|
|
460
464
|
const updateAllLines = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
461
465
|
(0, customerTransaction_1.isCustomerTransaction)(transaction) === true;
|
|
462
466
|
if (transaction.lines != null) {
|
|
463
467
|
// always preserving the order of the line items. hence iterating over this
|
|
464
468
|
transaction.lines.forEach((line) => {
|
|
469
|
+
persistedLineIds.add(line.id);
|
|
465
470
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
466
471
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
467
472
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -542,6 +547,7 @@ const toSetAllLineItemsToCategoryClass = (transaction, transactionDetailLocalDat
|
|
|
542
547
|
}
|
|
543
548
|
});
|
|
544
549
|
}
|
|
550
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
545
551
|
const newLocalData = {
|
|
546
552
|
...transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
547
553
|
memo: transactionDetailLocalData.memo,
|
|
@@ -563,11 +569,13 @@ const toSetAllLineItemsToCategoryClass = (transaction, transactionDetailLocalDat
|
|
|
563
569
|
exports.toSetAllLineItemsToCategoryClass = toSetAllLineItemsToCategoryClass;
|
|
564
570
|
const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDetailLocalData, isUpdateAll, entity) => {
|
|
565
571
|
const newLineItems = {};
|
|
572
|
+
const persistedLineIds = new Set();
|
|
566
573
|
const updateAllLines = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
567
574
|
(0, customerTransaction_1.isCustomerTransaction)(transaction) === true;
|
|
568
575
|
if (transaction.lines != null) {
|
|
569
576
|
// always preserving the order of the line items. hence iterating over this
|
|
570
577
|
transaction.lines.forEach((line) => {
|
|
578
|
+
persistedLineIds.add(line.id);
|
|
571
579
|
const lineId = line.id;
|
|
572
580
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
573
581
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
@@ -589,6 +597,7 @@ const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDe
|
|
|
589
597
|
}
|
|
590
598
|
});
|
|
591
599
|
}
|
|
600
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
592
601
|
const newLocalData = {
|
|
593
602
|
...transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
594
603
|
memo: transactionDetailLocalData.memo,
|
|
@@ -608,14 +617,23 @@ const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDe
|
|
|
608
617
|
return newLocalData;
|
|
609
618
|
};
|
|
610
619
|
exports.toSetAllLineItemsLocalDataIsUpdateAllChecked = toSetAllLineItemsLocalDataIsUpdateAllChecked;
|
|
620
|
+
const preserveLocalLines = (target, source, persistedLineIds) => {
|
|
621
|
+
Object.keys(source).forEach((lineId) => {
|
|
622
|
+
if (!persistedLineIds.has(lineId)) {
|
|
623
|
+
target[lineId] = { ...source[lineId] };
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
};
|
|
611
627
|
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedIncomeExpense, recommendationWithCOTByLineId) => {
|
|
612
628
|
const newLineItems = {};
|
|
613
629
|
let matchingEntityLineId = undefined;
|
|
614
630
|
const checkIfNotJEAndDeposit = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
615
631
|
(0, customerTransaction_1.isCustomerTransaction)(transaction) === true;
|
|
632
|
+
const persistedLineIds = new Set();
|
|
616
633
|
if (transaction.lines != null) {
|
|
617
634
|
// always preserving the order of the line items. hence iterating over this
|
|
618
635
|
transaction.lines.forEach((line) => {
|
|
636
|
+
persistedLineIds.add(line.id);
|
|
619
637
|
const lineId = line.id;
|
|
620
638
|
const oldRecord = transactionDetailLocalData.lineItemById[lineId];
|
|
621
639
|
// check if any line already has this entity
|
|
@@ -727,6 +745,7 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
727
745
|
}
|
|
728
746
|
});
|
|
729
747
|
}
|
|
748
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
730
749
|
// if we have found a matching entity
|
|
731
750
|
if (matchingEntityLineId != null) {
|
|
732
751
|
const matchingRecord = transactionDetailLocalData.lineItemById[matchingEntityLineId];
|
|
@@ -771,9 +790,11 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
771
790
|
exports.setEntityRecommendationForLineIdInLocalData = setEntityRecommendationForLineIdInLocalData;
|
|
772
791
|
const removeEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, recommendationLineIds) => {
|
|
773
792
|
const newLineItems = {};
|
|
793
|
+
const persistedLineIds = new Set();
|
|
774
794
|
if (transaction.lines != null) {
|
|
775
795
|
// always preserving the order of the line items. hence iterating over this
|
|
776
796
|
transaction.lines.forEach((line) => {
|
|
797
|
+
persistedLineIds.add(line.id);
|
|
777
798
|
const lineId = line.id;
|
|
778
799
|
const oldRecord = transactionDetailLocalData.lineItemById[lineId];
|
|
779
800
|
// check if any line already has this entity
|
|
@@ -804,6 +825,7 @@ const removeEntityRecommendationForLineIdInLocalData = (transaction, transaction
|
|
|
804
825
|
}
|
|
805
826
|
});
|
|
806
827
|
}
|
|
828
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
807
829
|
const newLocalData = {
|
|
808
830
|
...transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
809
831
|
memo: transactionDetailLocalData.memo,
|
|
@@ -871,9 +893,11 @@ const toLineCustomerOrVendor = (entity) => {
|
|
|
871
893
|
};
|
|
872
894
|
const toSetAllLineItemsToVendor = (transaction, transactionDetailLocalData, entity) => {
|
|
873
895
|
const newLineItems = {};
|
|
896
|
+
const persistedLineIds = new Set();
|
|
874
897
|
if (transaction.lines != null) {
|
|
875
898
|
// always preserving the order of the line items. hence iterating over this
|
|
876
899
|
transaction.lines.forEach((line) => {
|
|
900
|
+
persistedLineIds.add(line.id);
|
|
877
901
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
878
902
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
879
903
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -918,6 +942,7 @@ const toSetAllLineItemsToVendor = (transaction, transactionDetailLocalData, enti
|
|
|
918
942
|
}
|
|
919
943
|
});
|
|
920
944
|
}
|
|
945
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
921
946
|
const newLocalData = {
|
|
922
947
|
...transactionDetailLocalData,
|
|
923
948
|
lineItemById: newLineItems,
|
|
@@ -929,9 +954,11 @@ exports.toSetAllLineItemsToVendor = toSetAllLineItemsToVendor;
|
|
|
929
954
|
const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalData, lineIdToRetainVendorSelection) => {
|
|
930
955
|
const newLineItems = {};
|
|
931
956
|
const transactionWithCOT = (0, transactionHelper_1.getTransactionWithCOT)(transaction);
|
|
957
|
+
const persistedLineIds = new Set();
|
|
932
958
|
if (transaction.lines != null) {
|
|
933
959
|
// always preserving the order of the line items. hence iterating over this
|
|
934
960
|
transaction.lines.forEach((line) => {
|
|
961
|
+
persistedLineIds.add(line.id);
|
|
935
962
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
936
963
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
937
964
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -1032,6 +1059,7 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
|
|
|
1032
1059
|
}
|
|
1033
1060
|
});
|
|
1034
1061
|
}
|
|
1062
|
+
preserveLocalLines(newLineItems, transactionDetailLocalData.lineItemById, persistedLineIds);
|
|
1035
1063
|
const newLocalData = {
|
|
1036
1064
|
...transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
1037
1065
|
memo: transactionDetailLocalData.memo,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.57-beta0GS",
|
|
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
|
"module": "lib/esm/index.js",
|