@zeniai/client-epic-state 5.1.53-betaRD2 → 5.1.53
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/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +8 -18
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +11 -14
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +2 -2
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +7 -17
- package/lib/view/recommendation/recommendationReducer.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +11 -14
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { getTransactionWithCOT, getTransactionWithCOTFromRecommendations, } from
|
|
|
5
5
|
import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
|
|
6
6
|
import { getUncategorizedAccounts } from '../accountList/accountListSelector';
|
|
7
7
|
import { markCategoryClassRecommendationsCompletedForCategorization, markCategoryClassRecommendationsFailureForCategorization, markCategoryClassRecommendationsInProgressForCategorization, setEntityRecommendationForLineIdsForCategorization, } from '../expenseAutomationView/reducers/transactionsViewReducer';
|
|
8
|
-
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail,
|
|
8
|
+
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail, } from '../transactionDetail/transactionDetailReducer';
|
|
9
9
|
import { buildRecommendationUrl, getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT, } from './recommendationHelper';
|
|
10
10
|
import { fetchEntityRecommendationsForLineUpdate } from './recommendationReducer';
|
|
11
11
|
// Close the per-target groupBy bucket after this much idle time so inactive
|
|
@@ -38,16 +38,6 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
|
|
|
38
38
|
const payload = action.payload;
|
|
39
39
|
const { transactionId, transaction, lineIds } = payload.transactionDetails;
|
|
40
40
|
const { entity, amount, isFetchCOT, isUncategorizedExpenseCategoryEnabled, } = payload;
|
|
41
|
-
// The vendor "Update all lines" popup on the detail page watches
|
|
42
|
-
// its own transaction-level fetch status, separate from the
|
|
43
|
-
// per-line statuses below — surface completion/failure there too
|
|
44
|
-
// when this fetch was triggered by that bulk action, or the popup
|
|
45
|
-
// hangs until its own 60s timeout regardless of how this request
|
|
46
|
-
// resolves.
|
|
47
|
-
const isBulkDetailFetch = payload.flowType === 'detail' && payload.isBulkFetch === true;
|
|
48
|
-
const emitWithBulkStatus = (primaryAction, bulkAction) => isBulkDetailFetch && bulkAction != null
|
|
49
|
-
? of(primaryAction, bulkAction)
|
|
50
|
-
: of(primaryAction);
|
|
51
41
|
// Synchronously emit the start arm so the per-line skeleton +
|
|
52
42
|
// row uncheck happen before the HTTP request begins. The
|
|
53
43
|
// discriminated-union payload narrows `payload.selectedTab` to
|
|
@@ -61,9 +51,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
|
|
|
61
51
|
.getJSON(url)
|
|
62
52
|
.pipe(mergeMap((response) => {
|
|
63
53
|
if (!isSuccessResponse(response) || response.data == null) {
|
|
64
|
-
return
|
|
54
|
+
return of(payload.flowType === 'categorization'
|
|
65
55
|
? markCategoryClassRecommendationsFailureForCategorization(payload.selectedTab, transactionId, lineIds, response.status)
|
|
66
|
-
: markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, response.status)
|
|
56
|
+
: markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, response.status));
|
|
67
57
|
}
|
|
68
58
|
const recommendationWithCOTByLineId = getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT(response.data.recommendations, lineIds);
|
|
69
59
|
// HTTP 200 with no per-line recommendations: NOT an error.
|
|
@@ -71,9 +61,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
|
|
|
71
61
|
// downstream UI can treat this as "we tried, nothing to
|
|
72
62
|
// apply".
|
|
73
63
|
if (recommendationWithCOTByLineId == null) {
|
|
74
|
-
return
|
|
64
|
+
return of(payload.flowType === 'categorization'
|
|
75
65
|
? markCategoryClassRecommendationsCompletedForCategorization(payload.selectedTab, transactionId, lineIds)
|
|
76
|
-
: markCategoryClassRecommendationsCompletedForTransactionDetail(transactionId, lineIds)
|
|
66
|
+
: markCategoryClassRecommendationsCompletedForTransactionDetail(transactionId, lineIds));
|
|
77
67
|
}
|
|
78
68
|
const transactionWithCOT = isFetchCOT === true
|
|
79
69
|
? getTransactionWithCOTFromRecommendations(transaction, recommendationWithCOTByLineId)
|
|
@@ -82,16 +72,16 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
|
|
|
82
72
|
if (payload.flowType === 'categorization') {
|
|
83
73
|
return of(setEntityRecommendationForLineIdsForCategorization(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, getIsAccountingClassesEnabled(state$.value)));
|
|
84
74
|
}
|
|
85
|
-
return
|
|
75
|
+
return of(setEntityRecommendationForLineIdsForTransactionDetail(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
|
|
86
76
|
}), catchError((error) => {
|
|
87
77
|
const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
|
|
88
78
|
(error instanceof Error
|
|
89
79
|
? error.message
|
|
90
80
|
: JSON.stringify(error));
|
|
91
81
|
const status = createZeniAPIStatus('Unexpected Error', errorMessage);
|
|
92
|
-
return
|
|
82
|
+
return of(payload.flowType === 'categorization'
|
|
93
83
|
? markCategoryClassRecommendationsFailureForCategorization(payload.selectedTab, transactionId, lineIds, status)
|
|
94
|
-
: markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, status)
|
|
84
|
+
: markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, status));
|
|
95
85
|
}));
|
|
96
86
|
return concat(of(startAction), httpStream$);
|
|
97
87
|
}))));
|
|
@@ -256,7 +256,7 @@ export const getRecommendedCategoryClass = (isCategoryMiscategorized, isClassMis
|
|
|
256
256
|
recommendedAccount = accountWithoutCOT;
|
|
257
257
|
}
|
|
258
258
|
if (rec.class != null &&
|
|
259
|
-
rec.class.
|
|
259
|
+
rec.class.qboId !== classObj?.qboId &&
|
|
260
260
|
recommendedClass == undefined) {
|
|
261
261
|
const { cot, reasoning, ...classWithoutCOT } = rec.class;
|
|
262
262
|
void cot;
|
|
@@ -269,7 +269,7 @@ export const getRecommendedCategoryClass = (isCategoryMiscategorized, isClassMis
|
|
|
269
269
|
isAccountUncategorized(uncategorizedIncomeExpense, account?.qboId);
|
|
270
270
|
if ((isClassMiscategorized === false || isUncategorizedAccount) &&
|
|
271
271
|
rec.class != null &&
|
|
272
|
-
rec.class.
|
|
272
|
+
rec.class.qboId === classObj?.qboId) {
|
|
273
273
|
isLineItemClassCorrectlyCategorized = true;
|
|
274
274
|
}
|
|
275
275
|
// Note: In case of uncat transactions, if category is correctly categorized,
|
|
@@ -639,11 +639,8 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
639
639
|
record.billable = accountLine.billable;
|
|
640
640
|
record.recommendationsWithCOT = recommendationsWithCOT;
|
|
641
641
|
const { recommendedAccount, recommendedClass } = getRecommendedCategoryClass(accountLine.isCategoryMiscategorized ?? false, accountLine.isClassMiscategorized ?? false, recommendationsWithCOT, accountLine.account, accountLine.class);
|
|
642
|
-
//
|
|
643
|
-
//
|
|
644
|
-
// instead: ClassBase.qboId is optional and frequently absent even
|
|
645
|
-
// when a real class recommendation exists, so qboId-based
|
|
646
|
-
// comparison silently dropped valid class recommendations.
|
|
642
|
+
// TODO: comparing with qboId because backend temporarily required us to compare
|
|
643
|
+
// class and account based on qbo id. This should ideally be based on accountId/ClassId
|
|
647
644
|
if (recommendedAccount?.qboId !== accountLine.account.qboId &&
|
|
648
645
|
Boolean(recommendedAccount?.qboId)) {
|
|
649
646
|
record.isRecommendedCategorySelected = false;
|
|
@@ -671,13 +668,13 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
671
668
|
record.isRetainedCategorySelected = false;
|
|
672
669
|
}
|
|
673
670
|
}
|
|
674
|
-
if (recommendedClass?.
|
|
675
|
-
Boolean(recommendedClass?.
|
|
671
|
+
if (recommendedClass?.qboId !== accountLine.class?.qboId &&
|
|
672
|
+
Boolean(recommendedClass?.qboId)) {
|
|
676
673
|
record.isRecommendedClassSelected = false;
|
|
677
674
|
record.recommendedClass = recommendedClass;
|
|
678
675
|
record.isClassUpdateSelected = false;
|
|
679
676
|
if (accountLine.isClassMiscategorized &&
|
|
680
|
-
Boolean(accountLine.class?.
|
|
677
|
+
Boolean(accountLine.class?.qboId)) {
|
|
681
678
|
record.retainedClass = accountLine.class;
|
|
682
679
|
record.isRetainedClassSelected = false;
|
|
683
680
|
}
|
|
@@ -685,12 +682,12 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
685
682
|
else {
|
|
686
683
|
record.isRecommendedClassSelected = false;
|
|
687
684
|
record.recommendedClass = recommendedClass;
|
|
688
|
-
if (recommendedClass?.
|
|
685
|
+
if (recommendedClass?.qboId === accountLine.class?.qboId) {
|
|
689
686
|
record.recommendedClass = undefined;
|
|
690
687
|
}
|
|
691
688
|
record.isClassUpdateSelected = false;
|
|
692
689
|
if (accountLine.isClassMiscategorized &&
|
|
693
|
-
Boolean(accountLine.class?.
|
|
690
|
+
Boolean(accountLine.class?.qboId)) {
|
|
694
691
|
record.retainedClass = recommendedClass;
|
|
695
692
|
record.isRetainedClassSelected = false;
|
|
696
693
|
}
|
|
@@ -706,8 +703,8 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
706
703
|
Boolean(recommendedAccount?.qboId) !== false) {
|
|
707
704
|
record.account = recommendedAccount;
|
|
708
705
|
}
|
|
709
|
-
if (Boolean(record.class?.
|
|
710
|
-
Boolean(recommendedClass?.
|
|
706
|
+
if (Boolean(record.class?.qboId) === false &&
|
|
707
|
+
Boolean(recommendedClass?.qboId) !== false) {
|
|
711
708
|
record.class = recommendedClass;
|
|
712
709
|
}
|
|
713
710
|
newLineItems[line.id] = record;
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../zeniAPI';
|
|
5
5
|
import { markCategoryClassRecommendationsCompletedForCategorization, markCategoryClassRecommendationsFailureForCategorization, markCategoryClassRecommendationsInProgressForCategorization, setEntityRecommendationForLineIdsForCategorization } from '../expenseAutomationView/reducers/transactionsViewReducer';
|
|
6
|
-
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail
|
|
6
|
+
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail } from '../transactionDetail/transactionDetailReducer';
|
|
7
7
|
import { fetchEntityRecommendationsForLineUpdate } from './recommendationReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchEntityRecommendationsForLineUpdate> | ReturnType<typeof markCategoryClassRecommendationsInProgressForCategorization> | ReturnType<typeof markCategoryClassRecommendationsCompletedForCategorization> | ReturnType<typeof markCategoryClassRecommendationsFailureForCategorization> | ReturnType<typeof markCategoryClassRecommendationsInProgressForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsCompletedForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsFailureForTransactionDetail> | ReturnType<typeof setEntityRecommendationForLineIdsForCategorization> | ReturnType<typeof setEntityRecommendationForLineIdsForTransactionDetail
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchEntityRecommendationsForLineUpdate> | ReturnType<typeof markCategoryClassRecommendationsInProgressForCategorization> | ReturnType<typeof markCategoryClassRecommendationsCompletedForCategorization> | ReturnType<typeof markCategoryClassRecommendationsFailureForCategorization> | ReturnType<typeof markCategoryClassRecommendationsInProgressForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsCompletedForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsFailureForTransactionDetail> | ReturnType<typeof setEntityRecommendationForLineIdsForCategorization> | ReturnType<typeof setEntityRecommendationForLineIdsForTransactionDetail>;
|
|
9
9
|
export declare const fetchEntityRecommendationsForLineUpdateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -41,16 +41,6 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
41
41
|
const payload = action.payload;
|
|
42
42
|
const { transactionId, transaction, lineIds } = payload.transactionDetails;
|
|
43
43
|
const { entity, amount, isFetchCOT, isUncategorizedExpenseCategoryEnabled, } = payload;
|
|
44
|
-
// The vendor "Update all lines" popup on the detail page watches
|
|
45
|
-
// its own transaction-level fetch status, separate from the
|
|
46
|
-
// per-line statuses below — surface completion/failure there too
|
|
47
|
-
// when this fetch was triggered by that bulk action, or the popup
|
|
48
|
-
// hangs until its own 60s timeout regardless of how this request
|
|
49
|
-
// resolves.
|
|
50
|
-
const isBulkDetailFetch = payload.flowType === 'detail' && payload.isBulkFetch === true;
|
|
51
|
-
const emitWithBulkStatus = (primaryAction, bulkAction) => isBulkDetailFetch && bulkAction != null
|
|
52
|
-
? (0, rxjs_1.of)(primaryAction, bulkAction)
|
|
53
|
-
: (0, rxjs_1.of)(primaryAction);
|
|
54
44
|
// Synchronously emit the start arm so the per-line skeleton +
|
|
55
45
|
// row uncheck happen before the HTTP request begins. The
|
|
56
46
|
// discriminated-union payload narrows `payload.selectedTab` to
|
|
@@ -64,9 +54,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
64
54
|
.getJSON(url)
|
|
65
55
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
66
56
|
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
67
|
-
return
|
|
57
|
+
return (0, rxjs_1.of)(payload.flowType === 'categorization'
|
|
68
58
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, response.status)
|
|
69
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status)
|
|
59
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status));
|
|
70
60
|
}
|
|
71
61
|
const recommendationWithCOTByLineId = (0, recommendationHelper_1.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT)(response.data.recommendations, lineIds);
|
|
72
62
|
// HTTP 200 with no per-line recommendations: NOT an error.
|
|
@@ -74,9 +64,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
74
64
|
// downstream UI can treat this as "we tried, nothing to
|
|
75
65
|
// apply".
|
|
76
66
|
if (recommendationWithCOTByLineId == null) {
|
|
77
|
-
return
|
|
67
|
+
return (0, rxjs_1.of)(payload.flowType === 'categorization'
|
|
78
68
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsCompletedForCategorization)(payload.selectedTab, transactionId, lineIds)
|
|
79
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds)
|
|
69
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds));
|
|
80
70
|
}
|
|
81
71
|
const transactionWithCOT = isFetchCOT === true
|
|
82
72
|
? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
|
|
@@ -85,16 +75,16 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
85
75
|
if (payload.flowType === 'categorization') {
|
|
86
76
|
return (0, rxjs_1.of)((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
|
|
87
77
|
}
|
|
88
|
-
return
|
|
78
|
+
return (0, rxjs_1.of)((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
|
|
89
79
|
}), (0, operators_1.catchError)((error) => {
|
|
90
80
|
const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
|
|
91
81
|
(error instanceof Error
|
|
92
82
|
? error.message
|
|
93
83
|
: JSON.stringify(error));
|
|
94
84
|
const status = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', errorMessage);
|
|
95
|
-
return
|
|
85
|
+
return (0, rxjs_1.of)(payload.flowType === 'categorization'
|
|
96
86
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, status)
|
|
97
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status)
|
|
87
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status));
|
|
98
88
|
}));
|
|
99
89
|
return (0, rxjs_1.concat)((0, rxjs_1.of)(startAction), httpStream$);
|
|
100
90
|
}))));
|
|
@@ -261,7 +261,7 @@ const getRecommendedCategoryClass = (isCategoryMiscategorized, isClassMiscategor
|
|
|
261
261
|
recommendedAccount = accountWithoutCOT;
|
|
262
262
|
}
|
|
263
263
|
if (rec.class != null &&
|
|
264
|
-
rec.class.
|
|
264
|
+
rec.class.qboId !== classObj?.qboId &&
|
|
265
265
|
recommendedClass == undefined) {
|
|
266
266
|
const { cot, reasoning, ...classWithoutCOT } = rec.class;
|
|
267
267
|
void cot;
|
|
@@ -274,7 +274,7 @@ const getRecommendedCategoryClass = (isCategoryMiscategorized, isClassMiscategor
|
|
|
274
274
|
(0, exports.isAccountUncategorized)(uncategorizedIncomeExpense, account?.qboId);
|
|
275
275
|
if ((isClassMiscategorized === false || isUncategorizedAccount) &&
|
|
276
276
|
rec.class != null &&
|
|
277
|
-
rec.class.
|
|
277
|
+
rec.class.qboId === classObj?.qboId) {
|
|
278
278
|
isLineItemClassCorrectlyCategorized = true;
|
|
279
279
|
}
|
|
280
280
|
// Note: In case of uncat transactions, if category is correctly categorized,
|
|
@@ -648,11 +648,8 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
648
648
|
record.billable = accountLine.billable;
|
|
649
649
|
record.recommendationsWithCOT = recommendationsWithCOT;
|
|
650
650
|
const { recommendedAccount, recommendedClass } = (0, exports.getRecommendedCategoryClass)(accountLine.isCategoryMiscategorized ?? false, accountLine.isClassMiscategorized ?? false, recommendationsWithCOT, accountLine.account, accountLine.class);
|
|
651
|
-
//
|
|
652
|
-
//
|
|
653
|
-
// instead: ClassBase.qboId is optional and frequently absent even
|
|
654
|
-
// when a real class recommendation exists, so qboId-based
|
|
655
|
-
// comparison silently dropped valid class recommendations.
|
|
651
|
+
// TODO: comparing with qboId because backend temporarily required us to compare
|
|
652
|
+
// class and account based on qbo id. This should ideally be based on accountId/ClassId
|
|
656
653
|
if (recommendedAccount?.qboId !== accountLine.account.qboId &&
|
|
657
654
|
Boolean(recommendedAccount?.qboId)) {
|
|
658
655
|
record.isRecommendedCategorySelected = false;
|
|
@@ -680,13 +677,13 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
680
677
|
record.isRetainedCategorySelected = false;
|
|
681
678
|
}
|
|
682
679
|
}
|
|
683
|
-
if (recommendedClass?.
|
|
684
|
-
Boolean(recommendedClass?.
|
|
680
|
+
if (recommendedClass?.qboId !== accountLine.class?.qboId &&
|
|
681
|
+
Boolean(recommendedClass?.qboId)) {
|
|
685
682
|
record.isRecommendedClassSelected = false;
|
|
686
683
|
record.recommendedClass = recommendedClass;
|
|
687
684
|
record.isClassUpdateSelected = false;
|
|
688
685
|
if (accountLine.isClassMiscategorized &&
|
|
689
|
-
Boolean(accountLine.class?.
|
|
686
|
+
Boolean(accountLine.class?.qboId)) {
|
|
690
687
|
record.retainedClass = accountLine.class;
|
|
691
688
|
record.isRetainedClassSelected = false;
|
|
692
689
|
}
|
|
@@ -694,12 +691,12 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
694
691
|
else {
|
|
695
692
|
record.isRecommendedClassSelected = false;
|
|
696
693
|
record.recommendedClass = recommendedClass;
|
|
697
|
-
if (recommendedClass?.
|
|
694
|
+
if (recommendedClass?.qboId === accountLine.class?.qboId) {
|
|
698
695
|
record.recommendedClass = undefined;
|
|
699
696
|
}
|
|
700
697
|
record.isClassUpdateSelected = false;
|
|
701
698
|
if (accountLine.isClassMiscategorized &&
|
|
702
|
-
Boolean(accountLine.class?.
|
|
699
|
+
Boolean(accountLine.class?.qboId)) {
|
|
703
700
|
record.retainedClass = recommendedClass;
|
|
704
701
|
record.isRetainedClassSelected = false;
|
|
705
702
|
}
|
|
@@ -715,8 +712,8 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
715
712
|
Boolean(recommendedAccount?.qboId) !== false) {
|
|
716
713
|
record.account = recommendedAccount;
|
|
717
714
|
}
|
|
718
|
-
if (Boolean(record.class?.
|
|
719
|
-
Boolean(recommendedClass?.
|
|
715
|
+
if (Boolean(record.class?.qboId) === false &&
|
|
716
|
+
Boolean(recommendedClass?.qboId) !== false) {
|
|
720
717
|
record.class = recommendedClass;
|
|
721
718
|
}
|
|
722
719
|
newLineItems[line.id] = record;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.53
|
|
3
|
+
"version": "5.1.53",
|
|
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",
|