@zeniai/client-epic-state 4.20.2-betaRD2 → 4.20.2
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/commonStateTypes/animations.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -38
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -4
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -37
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -4
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -5
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +7 -8
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -12
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -18
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -3
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -9
- package/lib/index.d.ts +10 -13
- package/lib/index.js +32 -42
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -15
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -8
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -20
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -3
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +2 -9
- package/package.json +1 -1
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +0 -19
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -2
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
|
@@ -16,7 +16,6 @@ const companySelector_1 = require("../../../../entity/company/companySelector");
|
|
|
16
16
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
17
17
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
18
18
|
const paymentInstrumentSelector_1 = require("../../../../entity/paymentInstrument/paymentInstrumentSelector");
|
|
19
|
-
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
20
19
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
21
20
|
const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
22
21
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -182,15 +181,12 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
182
181
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
183
182
|
billStage = billPayInfo?.stage.code ?? 'draft';
|
|
184
183
|
if (billViewState != null) {
|
|
185
|
-
|
|
184
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
186
185
|
sourceBillDetail.fetchStatus,
|
|
187
186
|
accountListState.byReportId.billPayAccountList,
|
|
187
|
+
classListState,
|
|
188
188
|
billPaySetupApproverViewState,
|
|
189
|
-
];
|
|
190
|
-
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
191
|
-
fetchStateList.push(classListState);
|
|
192
|
-
}
|
|
193
|
-
fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
189
|
+
]).fetchState;
|
|
194
190
|
deleteStatus = billViewState.deleteStatus;
|
|
195
191
|
billActivities = (0, billDetailViewSelector_1.getBillActivities)(state, billId, billPayInfo?.stage.code);
|
|
196
192
|
}
|
|
@@ -204,14 +200,11 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
204
200
|
}
|
|
205
201
|
}
|
|
206
202
|
else {
|
|
207
|
-
|
|
203
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
208
204
|
accountListState.byReportId.billPayAccountList,
|
|
205
|
+
classListState,
|
|
209
206
|
billPaySetupApproverViewState,
|
|
210
|
-
];
|
|
211
|
-
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
212
|
-
newBillFetchStateList.push(classListState);
|
|
213
|
-
}
|
|
214
|
-
fetchState = (0, reduceFetchState_1.reduceFetchState)(newBillFetchStateList).fetchState;
|
|
207
|
+
]).fetchState;
|
|
215
208
|
}
|
|
216
209
|
if (sourceBillDetail != null && fetchState == 'Completed') {
|
|
217
210
|
const updatedRecord = sourceBillDetail.billDetailLocalData;
|
|
@@ -42,7 +42,7 @@ interface TwoFAState {
|
|
|
42
42
|
otpChallenge?: string;
|
|
43
43
|
phone?: string;
|
|
44
44
|
}
|
|
45
|
-
export declare const toChargeCardTransactionSortKeyType: (v: string) => "amount" | "type" | "
|
|
45
|
+
export declare const toChargeCardTransactionSortKeyType: (v: string) => "amount" | "type" | "merchant" | "paymentDate" | "receipts";
|
|
46
46
|
export declare type ChargeCardTransactionSortKey = ReturnType<typeof toChargeCardTransactionSortKeyType>;
|
|
47
47
|
export interface ChargeCardDetailTransactionList extends FetchStateAndError {
|
|
48
48
|
isViewReceiptClickedImmediatelyAfterUploadTransactionId: Record<ID, boolean>;
|
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -233,8 +233,6 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
233
233
|
return card.cardName.toLowerCase();
|
|
234
234
|
case 'cardType':
|
|
235
235
|
return card.type.code;
|
|
236
|
-
case 'accountType':
|
|
237
|
-
return card.type.code.includes('credit') ? 'credit' : 'debit';
|
|
238
236
|
case 'status':
|
|
239
237
|
return card.status.code;
|
|
240
238
|
case 'utilisation':
|
|
@@ -69,16 +69,13 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
69
69
|
paymentTo: reimbursementInfo?.toAccount.billAccountId,
|
|
70
70
|
};
|
|
71
71
|
if (sourceRemiDetail != null) {
|
|
72
|
-
|
|
72
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
73
73
|
sourceRemiDetail.fetchStatus,
|
|
74
74
|
accountListState.byReportId.reimbursementAccountList,
|
|
75
|
+
classListState,
|
|
75
76
|
merchantListState,
|
|
76
77
|
reimbursementConfigState,
|
|
77
|
-
];
|
|
78
|
-
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
79
|
-
fetchStateList.push(classListState);
|
|
80
|
-
}
|
|
81
|
-
fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
78
|
+
]).fetchState;
|
|
82
79
|
remiStage = reimbursementInfo?.stage.code ?? 'draft';
|
|
83
80
|
createdBy = (0, userSelector_1.getUserByUserId)(userState, reimbursement?.createdBy ?? '');
|
|
84
81
|
createTime = reimbursement?.createTime;
|
|
@@ -42,7 +42,6 @@ export interface ReimbursementView extends Reimbursement {
|
|
|
42
42
|
approvers: Approvers;
|
|
43
43
|
submittedBy: User | undefined;
|
|
44
44
|
bulkSelectInfo?: RemiBulkSelectInfo;
|
|
45
|
-
createdByUser?: User;
|
|
46
45
|
}
|
|
47
46
|
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
|
|
48
47
|
export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
@@ -51,7 +51,6 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
51
51
|
return {
|
|
52
52
|
...reimbursement,
|
|
53
53
|
submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
|
|
54
|
-
createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
|
|
55
54
|
approvers: approvers,
|
|
56
55
|
};
|
|
57
56
|
});
|
|
@@ -424,14 +423,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
424
423
|
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
425
424
|
}
|
|
426
425
|
break;
|
|
427
|
-
case 'createdBy':
|
|
428
|
-
if (reimbursement.createdByUser != null) {
|
|
429
|
-
reimbursementsWithSortKeyValue.push(reimbursement);
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
433
|
-
}
|
|
434
|
-
break;
|
|
435
426
|
}
|
|
436
427
|
});
|
|
437
428
|
const getColumnWiseSortOrder = (sortOrder) => {
|
|
@@ -439,7 +430,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
439
430
|
case 'reportName':
|
|
440
431
|
case 'type':
|
|
441
432
|
case 'status':
|
|
442
|
-
case 'createdBy':
|
|
443
433
|
return sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
444
434
|
default:
|
|
445
435
|
return sortOrder === 'ascending' ? 'desc' : 'asc';
|
|
@@ -459,8 +449,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
459
449
|
return getStatusPerTab(reimbursement);
|
|
460
450
|
case 'amount':
|
|
461
451
|
return reimbursement.amount.amount ?? 0;
|
|
462
|
-
case 'createdBy':
|
|
463
|
-
return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
|
|
464
452
|
}
|
|
465
453
|
}, getColumnWiseSortOrder(sortOrder));
|
|
466
454
|
return [
|
|
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
|
|
|
38
38
|
export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
|
|
39
39
|
export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
|
|
40
40
|
export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
|
|
41
|
-
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "
|
|
41
|
+
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
|
|
42
42
|
export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
|
|
43
43
|
export interface ReimbursementFilters {
|
|
44
44
|
categories: ReimbursementFilterCategory[];
|
|
@@ -78,8 +78,8 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
78
78
|
lineItem.account?.qboId !== accountLine.account.qboId &&
|
|
79
79
|
Boolean(lineItem.account?.qboId);
|
|
80
80
|
hasClassChanged =
|
|
81
|
-
(lineItem.class?.qboId
|
|
82
|
-
lineItem.class?.qboId !== accountLine.class
|
|
81
|
+
Boolean(lineItem.class?.qboId) &&
|
|
82
|
+
lineItem.class?.qboId !== accountLine.class.qboId;
|
|
83
83
|
const recommendedAccountBase = (0, exports.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
84
84
|
const recommendedClassBase = (0, exports.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
85
85
|
const latestRecommendedCategory = lineItem.recommendedAccount;
|
|
@@ -144,13 +144,13 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
144
144
|
record.isRetainedCategorySelected = false;
|
|
145
145
|
}
|
|
146
146
|
if (Boolean(recommendedClass?.qboId) &&
|
|
147
|
-
recommendedClass?.qboId !== accountLine.class
|
|
147
|
+
recommendedClass?.qboId !== accountLine.class.qboId) {
|
|
148
148
|
record.isRecommendedClassSelected = false;
|
|
149
149
|
record.recommendedClass = recommendedClass;
|
|
150
150
|
record.isClassUpdateSelected = false;
|
|
151
151
|
}
|
|
152
152
|
if (accountLine.isClassMiscategorized &&
|
|
153
|
-
Boolean(accountLine.class
|
|
153
|
+
Boolean(accountLine.class.qboId) &&
|
|
154
154
|
Boolean(isVendorOrCustomerPresent)) {
|
|
155
155
|
record.retainedClass = accountLine.class;
|
|
156
156
|
record.isRetainedClassSelected = false;
|
|
@@ -342,14 +342,14 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
|
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
const updateClass = () => {
|
|
345
|
-
if (recommendedClass?.qboId !== accountLine.class
|
|
345
|
+
if (recommendedClass?.qboId !== accountLine.class.qboId &&
|
|
346
346
|
Boolean(recommendedClass?.qboId)) {
|
|
347
347
|
record.class = accountLine.class;
|
|
348
348
|
record.isRecommendedClassSelected = false;
|
|
349
349
|
record.recommendedClass = recommendedClass;
|
|
350
350
|
record.isClassUpdateSelected = false;
|
|
351
351
|
if (accountLine.isClassMiscategorized &&
|
|
352
|
-
Boolean(accountLine.class
|
|
352
|
+
Boolean(accountLine.class.qboId) &&
|
|
353
353
|
Boolean(isVendorOrCustomerPresent)) {
|
|
354
354
|
record.retainedClass = accountLine.class;
|
|
355
355
|
record.isRetainedClassSelected = false;
|
|
@@ -362,7 +362,7 @@ const toUpdateLineItemsOriginalCategoryClass = (transaction, transactionDetailLo
|
|
|
362
362
|
record.recommendedClass = recommendedClass;
|
|
363
363
|
record.isClassUpdateSelected = false;
|
|
364
364
|
if (accountLine.isClassMiscategorized &&
|
|
365
|
-
Boolean(accountLine.class
|
|
365
|
+
Boolean(accountLine.class.qboId) &&
|
|
366
366
|
Boolean(isVendorOrCustomerPresent)) {
|
|
367
367
|
record.retainedClass = recommendedClass;
|
|
368
368
|
record.isRetainedClassSelected = false;
|
|
@@ -659,13 +659,13 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
659
659
|
record.isRetainedCategorySelected = false;
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
if (recommendedClass?.qboId !== accountLine.class
|
|
662
|
+
if (recommendedClass?.qboId !== accountLine.class.qboId &&
|
|
663
663
|
Boolean(recommendedClass?.qboId)) {
|
|
664
664
|
record.isRecommendedClassSelected = false;
|
|
665
665
|
record.recommendedClass = recommendedClass;
|
|
666
666
|
record.isClassUpdateSelected = false;
|
|
667
667
|
if (accountLine.isClassMiscategorized &&
|
|
668
|
-
Boolean(accountLine.class
|
|
668
|
+
Boolean(accountLine.class.qboId)) {
|
|
669
669
|
record.retainedClass = accountLine.class;
|
|
670
670
|
record.isRetainedClassSelected = false;
|
|
671
671
|
}
|
|
@@ -673,12 +673,12 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
673
673
|
else {
|
|
674
674
|
record.isRecommendedClassSelected = false;
|
|
675
675
|
record.recommendedClass = recommendedClass;
|
|
676
|
-
if (recommendedClass?.qboId === accountLine.class
|
|
676
|
+
if (recommendedClass?.qboId === accountLine.class.qboId) {
|
|
677
677
|
record.recommendedClass = undefined;
|
|
678
678
|
}
|
|
679
679
|
record.isClassUpdateSelected = false;
|
|
680
680
|
if (accountLine.isClassMiscategorized &&
|
|
681
|
-
Boolean(accountLine.class
|
|
681
|
+
Boolean(accountLine.class.qboId)) {
|
|
682
682
|
record.retainedClass = recommendedClass;
|
|
683
683
|
record.isRetainedClassSelected = false;
|
|
684
684
|
}
|
|
@@ -694,7 +694,7 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
694
694
|
Boolean(recommendedAccount?.qboId) !== false) {
|
|
695
695
|
record.account = recommendedAccount;
|
|
696
696
|
}
|
|
697
|
-
if (Boolean(record.class
|
|
697
|
+
if (Boolean(record.class.qboId) === false &&
|
|
698
698
|
Boolean(recommendedClass?.qboId) !== false) {
|
|
699
699
|
record.class = recommendedClass;
|
|
700
700
|
}
|
|
@@ -817,9 +817,7 @@ const getChangedLineItemCountFromLocalData = (transaction, transactionLocalData)
|
|
|
817
817
|
accountLineLocal.account?.qboId !== accountLine.account.qboId &&
|
|
818
818
|
accountLineLocal.account?.accountId !== accountLine.account.accountId;
|
|
819
819
|
hasClassChanged =
|
|
820
|
-
|
|
821
|
-
accountLine.class?.qboId != null) &&
|
|
822
|
-
accountLineLocal.class?.qboId !== accountLine.class?.qboId;
|
|
820
|
+
accountLineLocal.class?.qboId !== accountLine.class.qboId;
|
|
823
821
|
}
|
|
824
822
|
hasDescriptionChanged =
|
|
825
823
|
transactionLocalData.lineItemById[lineId] != null
|
|
@@ -959,10 +957,10 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
|
|
|
959
957
|
record.isRecommendedClassSelected = false;
|
|
960
958
|
record.recommendedClass = recommendedClass;
|
|
961
959
|
record.isClassUpdateSelected = false;
|
|
962
|
-
if (recommendedClass?.qboId !== accountLine.class
|
|
960
|
+
if (recommendedClass?.qboId !== accountLine.class.qboId &&
|
|
963
961
|
Boolean(recommendedClass?.qboId)) {
|
|
964
962
|
if (accountLine.isClassMiscategorized &&
|
|
965
|
-
Boolean(accountLine.class
|
|
963
|
+
Boolean(accountLine.class.qboId) &&
|
|
966
964
|
Boolean(isVendorOrCustomerPresent)) {
|
|
967
965
|
record.retainedClass = accountLine.class;
|
|
968
966
|
record.isRetainedClassSelected = false;
|
|
@@ -975,7 +973,7 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
|
|
|
975
973
|
record.recommendedClass = recommendedClass;
|
|
976
974
|
record.isClassUpdateSelected = false;
|
|
977
975
|
if (accountLine.isClassMiscategorized &&
|
|
978
|
-
Boolean(accountLine.class
|
|
976
|
+
Boolean(accountLine.class.qboId) &&
|
|
979
977
|
Boolean(isVendorOrCustomerPresent)) {
|
|
980
978
|
record.retainedClass = recommendedClass;
|
|
981
979
|
record.isRetainedClassSelected = false;
|
|
@@ -17,7 +17,6 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
17
17
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
18
18
|
classList: ClassListSelectorView;
|
|
19
19
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
20
|
-
isAccountingClassesEnabled: boolean;
|
|
21
20
|
linkedTransactions: SupportedTransactionWithCOT[];
|
|
22
21
|
transactionDetailLocalData: TransactionDetailLocalData;
|
|
23
22
|
transactionDetailUpdateStatus: FetchStateAndError;
|
|
@@ -7,7 +7,6 @@ exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTra
|
|
|
7
7
|
exports.getTransactionDetailForTransaction = getTransactionDetailForTransaction;
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
10
|
-
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
11
10
|
const transactionType_1 = require("../../entity/transaction/stateTypes/transactionType");
|
|
12
11
|
const transactionHelper_1 = require("../../entity/transaction/transactionHelper");
|
|
13
12
|
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
@@ -59,14 +58,9 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
const accountsList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
62
|
-
const
|
|
63
|
-
const classList = isAccountingClassesEnabled
|
|
64
|
-
? (0, classListSelector_1.getClassList)(classState, classListState)
|
|
65
|
-
: { classes: [], nestedClassHierarchy: [], fetchState: 'Completed', error: undefined, version: 0 };
|
|
61
|
+
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
66
62
|
const accountsHierarchyList = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList');
|
|
67
|
-
const classHierarchyList =
|
|
68
|
-
? (0, classListSelector_1.getNestedClassListHierarchy)(classListState)
|
|
69
|
-
: [];
|
|
63
|
+
const classHierarchyList = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
70
64
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
71
65
|
const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
|
|
72
66
|
return {
|
|
@@ -84,7 +78,6 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
84
78
|
classHierarchyList,
|
|
85
79
|
accountsHierarchyList,
|
|
86
80
|
classList: classList,
|
|
87
|
-
isAccountingClassesEnabled,
|
|
88
81
|
isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
|
|
89
82
|
transactionDetailLocalData: transactionDetail?.transactionDetailLocalData ??
|
|
90
83
|
transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.20.2
|
|
3
|
+
"version": "4.20.2",
|
|
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",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical union of `page_context` values for GET …/suggested-questions (and related Redux
|
|
3
|
-
* `suggestedQuestionsByPageContext` on `AiCfoViewState`).
|
|
4
|
-
*
|
|
5
|
-
* ## Report IDs vs `page_context`
|
|
6
|
-
*
|
|
7
|
-
* **These strings are not all finance `report_id` values.** They are the **API’s** `page_context`
|
|
8
|
-
* slugs. Only the **reports tab** subset is *derived* from `ReportID` (e.g. `profit_and_loss` →
|
|
9
|
-
* `profit_loss`). That mapping lives in the web app:
|
|
10
|
-
* `zeni-web-app-ui/src/aiCfo/aiCfoSuggestedQuestionsPageContext.ts`
|
|
11
|
-
* (`reportIdToAiCfoSuggestedQuestionsPageContext`).
|
|
12
|
-
*
|
|
13
|
-
* Other members (e.g. `dashboard`, `bills_list`, `task_checklist`) come from **product routes /
|
|
14
|
-
* screens**, not from report IDs. Adding a new host screen usually means extending this union and
|
|
15
|
-
* wiring route resolution in the UI; coordinate with the backend for suggested-questions support.
|
|
16
|
-
*
|
|
17
|
-
* @see README.md in this directory for maintenance expectations.
|
|
18
|
-
*/
|
|
19
|
-
export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details' | 'dashboard' | 'cash_balance' | 'card_balance' | 'command_centre' | 'je_schedules' | 'reconciliation' | 'flux_analysis' | 'receipts' | 'mei' | 'task_checklist' | 'performance' | 'bills_list' | 'bills_details' | 'reimbursement_list' | 'reimbursement_details' | 'vendors_summary' | 'opex_by_vendor' | 'prepaid_expenses' | 'fixed_assets' | 'form_1099' | 'accrued_expenses' | 'forecast' | 'checking' | 'checking_details' | 'treasury' | 'cards' | 'cards_detail' | 'people' | 'rewards' | 'notifications';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
|
|
5
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
6
|
-
export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match),
|
|
7
|
-
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
8
|
-
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
9
|
-
mergeMap((action) => {
|
|
10
|
-
const { pageContext } = action.payload;
|
|
11
|
-
const query = new URLSearchParams({ page_context: pageContext });
|
|
12
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
13
|
-
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
14
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
15
|
-
return of(fetchSuggestedQuestionsSuccess({
|
|
16
|
-
pageContext: response.data.page_context,
|
|
17
|
-
generatedAt: response.data.generated_at,
|
|
18
|
-
suggestedQuestions: response.data.suggested_questions,
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
return of(fetchSuggestedQuestionsFailure({
|
|
22
|
-
pageContext,
|
|
23
|
-
error: response.status,
|
|
24
|
-
}));
|
|
25
|
-
}), catchError((error) => of(fetchSuggestedQuestionsFailure({
|
|
26
|
-
pageContext,
|
|
27
|
-
error: createZeniAPIStatus('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
|
|
28
|
-
}))));
|
|
29
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
|
|
7
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
8
|
-
export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchSuggestedQuestionsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
9
|
-
const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
|
|
10
|
-
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
11
|
-
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
12
|
-
(0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { pageContext } = action.payload;
|
|
14
|
-
const query = new URLSearchParams({ page_context: pageContext });
|
|
15
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
16
|
-
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
|
|
19
|
-
pageContext: response.data.page_context,
|
|
20
|
-
generatedAt: response.data.generated_at,
|
|
21
|
-
suggestedQuestions: response.data.suggested_questions,
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
25
|
-
pageContext,
|
|
26
|
-
error: response.status,
|
|
27
|
-
}));
|
|
28
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
29
|
-
pageContext,
|
|
30
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
|
|
31
|
-
}))));
|
|
32
|
-
}));
|
|
33
|
-
exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;
|