@zeniai/client-epic-state 5.1.53-betaRD1 → 5.1.53-betaRD2
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.
|
@@ -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.classId !== classObj?.classId &&
|
|
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.classId === classObj?.classId) {
|
|
273
273
|
isLineItemClassCorrectlyCategorized = true;
|
|
274
274
|
}
|
|
275
275
|
// Note: In case of uncat transactions, if category is correctly categorized,
|
|
@@ -639,8 +639,11 @@ 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
|
-
//
|
|
642
|
+
// Account comparisons use qboId (backend guarantees every account
|
|
643
|
+
// recommendation carries one). Class comparisons below use classId
|
|
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.
|
|
644
647
|
if (recommendedAccount?.qboId !== accountLine.account.qboId &&
|
|
645
648
|
Boolean(recommendedAccount?.qboId)) {
|
|
646
649
|
record.isRecommendedCategorySelected = false;
|
|
@@ -668,13 +671,13 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
668
671
|
record.isRetainedCategorySelected = false;
|
|
669
672
|
}
|
|
670
673
|
}
|
|
671
|
-
if (recommendedClass?.
|
|
672
|
-
Boolean(recommendedClass?.
|
|
674
|
+
if (recommendedClass?.classId !== accountLine.class?.classId &&
|
|
675
|
+
Boolean(recommendedClass?.classId)) {
|
|
673
676
|
record.isRecommendedClassSelected = false;
|
|
674
677
|
record.recommendedClass = recommendedClass;
|
|
675
678
|
record.isClassUpdateSelected = false;
|
|
676
679
|
if (accountLine.isClassMiscategorized &&
|
|
677
|
-
Boolean(accountLine.class?.
|
|
680
|
+
Boolean(accountLine.class?.classId)) {
|
|
678
681
|
record.retainedClass = accountLine.class;
|
|
679
682
|
record.isRetainedClassSelected = false;
|
|
680
683
|
}
|
|
@@ -682,12 +685,12 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
682
685
|
else {
|
|
683
686
|
record.isRecommendedClassSelected = false;
|
|
684
687
|
record.recommendedClass = recommendedClass;
|
|
685
|
-
if (recommendedClass?.
|
|
688
|
+
if (recommendedClass?.classId === accountLine.class?.classId) {
|
|
686
689
|
record.recommendedClass = undefined;
|
|
687
690
|
}
|
|
688
691
|
record.isClassUpdateSelected = false;
|
|
689
692
|
if (accountLine.isClassMiscategorized &&
|
|
690
|
-
Boolean(accountLine.class?.
|
|
693
|
+
Boolean(accountLine.class?.classId)) {
|
|
691
694
|
record.retainedClass = recommendedClass;
|
|
692
695
|
record.isRetainedClassSelected = false;
|
|
693
696
|
}
|
|
@@ -703,8 +706,8 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
703
706
|
Boolean(recommendedAccount?.qboId) !== false) {
|
|
704
707
|
record.account = recommendedAccount;
|
|
705
708
|
}
|
|
706
|
-
if (Boolean(record.class?.
|
|
707
|
-
Boolean(recommendedClass?.
|
|
709
|
+
if (Boolean(record.class?.classId) === false &&
|
|
710
|
+
Boolean(recommendedClass?.classId) !== false) {
|
|
708
711
|
record.class = recommendedClass;
|
|
709
712
|
}
|
|
710
713
|
newLineItems[line.id] = record;
|
|
@@ -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.classId !== classObj?.classId &&
|
|
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.classId === classObj?.classId) {
|
|
278
278
|
isLineItemClassCorrectlyCategorized = true;
|
|
279
279
|
}
|
|
280
280
|
// Note: In case of uncat transactions, if category is correctly categorized,
|
|
@@ -648,8 +648,11 @@ 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
|
-
//
|
|
651
|
+
// Account comparisons use qboId (backend guarantees every account
|
|
652
|
+
// recommendation carries one). Class comparisons below use classId
|
|
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.
|
|
653
656
|
if (recommendedAccount?.qboId !== accountLine.account.qboId &&
|
|
654
657
|
Boolean(recommendedAccount?.qboId)) {
|
|
655
658
|
record.isRecommendedCategorySelected = false;
|
|
@@ -677,13 +680,13 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
677
680
|
record.isRetainedCategorySelected = false;
|
|
678
681
|
}
|
|
679
682
|
}
|
|
680
|
-
if (recommendedClass?.
|
|
681
|
-
Boolean(recommendedClass?.
|
|
683
|
+
if (recommendedClass?.classId !== accountLine.class?.classId &&
|
|
684
|
+
Boolean(recommendedClass?.classId)) {
|
|
682
685
|
record.isRecommendedClassSelected = false;
|
|
683
686
|
record.recommendedClass = recommendedClass;
|
|
684
687
|
record.isClassUpdateSelected = false;
|
|
685
688
|
if (accountLine.isClassMiscategorized &&
|
|
686
|
-
Boolean(accountLine.class?.
|
|
689
|
+
Boolean(accountLine.class?.classId)) {
|
|
687
690
|
record.retainedClass = accountLine.class;
|
|
688
691
|
record.isRetainedClassSelected = false;
|
|
689
692
|
}
|
|
@@ -691,12 +694,12 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
691
694
|
else {
|
|
692
695
|
record.isRecommendedClassSelected = false;
|
|
693
696
|
record.recommendedClass = recommendedClass;
|
|
694
|
-
if (recommendedClass?.
|
|
697
|
+
if (recommendedClass?.classId === accountLine.class?.classId) {
|
|
695
698
|
record.recommendedClass = undefined;
|
|
696
699
|
}
|
|
697
700
|
record.isClassUpdateSelected = false;
|
|
698
701
|
if (accountLine.isClassMiscategorized &&
|
|
699
|
-
Boolean(accountLine.class?.
|
|
702
|
+
Boolean(accountLine.class?.classId)) {
|
|
700
703
|
record.retainedClass = recommendedClass;
|
|
701
704
|
record.isRetainedClassSelected = false;
|
|
702
705
|
}
|
|
@@ -712,8 +715,8 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
712
715
|
Boolean(recommendedAccount?.qboId) !== false) {
|
|
713
716
|
record.account = recommendedAccount;
|
|
714
717
|
}
|
|
715
|
-
if (Boolean(record.class?.
|
|
716
|
-
Boolean(recommendedClass?.
|
|
718
|
+
if (Boolean(record.class?.classId) === false &&
|
|
719
|
+
Boolean(recommendedClass?.classId) !== false) {
|
|
717
720
|
record.class = recommendedClass;
|
|
718
721
|
}
|
|
719
722
|
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-betaRD2",
|
|
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",
|