@zeniai/client-epic-state 4.18.7 → 4.18.8
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/commonPayloadTypes/recommendationPayload.d.ts +0 -19
- package/lib/commonStateTypes/accountView/getNestedAccountIDHierarchyForReport.js +0 -2
- package/lib/commonStateTypes/accountView/nestedAccountID.d.ts +0 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/entity/account/accountPayload.d.ts +2 -4
- package/lib/entity/account/accountPayload.js +2 -12
- package/lib/entity/account/accountSelector.d.ts +0 -3
- package/lib/entity/account/accountSelector.js +0 -2
- package/lib/entity/account/accountState.d.ts +1 -2
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +0 -1
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +0 -22
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classPayload.d.ts +2 -3
- package/lib/entity/class/classPayload.js +0 -9
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +0 -1
- package/lib/entity/company/companyPayload.js +4 -5
- package/lib/entity/company/companyStateTypes.d.ts +0 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -51
- package/lib/entity/transaction/transactionHelper.d.ts +0 -1
- package/lib/entity/transaction/transactionHelper.js +0 -13
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -9
- package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +0 -29
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -1
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -2
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -2
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardSelector.js +8 -11
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +3 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +3 -3
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +6 -11
- package/lib/view/recommendation/recommendationHelper.d.ts +3 -5
- package/lib/view/recommendation/recommendationHelper.js +1 -31
- package/lib/view/recommendation/recommendationPayload.d.ts +1 -5
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
- package/lib/view/recommendation/recommendationReducer.js +1 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -31
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewState.d.ts +0 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.d.ts +3 -3
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +3 -3
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -4
- package/package.json +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.js +0 -48
|
@@ -326,7 +326,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
326
326
|
},
|
|
327
327
|
},
|
|
328
328
|
setEntityRecommendationForLineIdsForCategorization: {
|
|
329
|
-
prepare(selectedTab, transactionId, transaction, lineIds, entity, amount,
|
|
329
|
+
prepare(selectedTab, transactionId, transaction, lineIds, entity, amount, recommendationByLineId, uncategorizedAccounts) {
|
|
330
330
|
return {
|
|
331
331
|
payload: {
|
|
332
332
|
selectedTab,
|
|
@@ -335,7 +335,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
335
335
|
lineIds,
|
|
336
336
|
entity,
|
|
337
337
|
amount,
|
|
338
|
-
|
|
338
|
+
recommendationByLineId,
|
|
339
339
|
uncategorizedAccounts,
|
|
340
340
|
},
|
|
341
341
|
};
|
|
@@ -347,7 +347,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
347
347
|
if (transactionLocalData != null) {
|
|
348
348
|
draft.transactionCategorizationView[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
349
349
|
transactionId: transaction.id,
|
|
350
|
-
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.
|
|
350
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(draft.transactionCategorizationView[selectedTab], transaction, transactionLocalData.transactionReviewLocalData, entity, lineIds, uncategorizedAccounts, action.payload.recommendationByLineId),
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
},
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
firstMonthOfFY: Month;
|
|
18
18
|
maxNumOfPeriodsToHighlight: number;
|
|
19
19
|
thisPeriod: TimeframeTick;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation"
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" |
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" |
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -12,7 +12,7 @@ const transactionDetailState_1 = require("../transactionDetail/transactionDetail
|
|
|
12
12
|
const recommendationHelper_1 = require("./recommendationHelper");
|
|
13
13
|
const recommendationReducer_1 = require("./recommendationReducer");
|
|
14
14
|
const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.fetchEntityRecommendationsByTransactionId.match), (0, operators_1.switchMap)((action) => {
|
|
15
|
-
const { entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow,
|
|
15
|
+
const { entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow, } = action.payload;
|
|
16
16
|
const { expenseAutomationTransactionsViewState: { selectedTransactionCategorizationTab, }, } = state$.value;
|
|
17
17
|
const query = {
|
|
18
18
|
amount,
|
|
@@ -20,22 +20,16 @@ const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI
|
|
|
20
20
|
transaction_type: transactionDetails.transaction.type,
|
|
21
21
|
line_ids: transactionDetails.lineIds,
|
|
22
22
|
};
|
|
23
|
-
if (isFetchCOT === true) {
|
|
24
|
-
query.include_cot = true;
|
|
25
|
-
}
|
|
26
23
|
return zeniAPI
|
|
27
24
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/${(0, exports.toEntityTypeURL)(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
28
25
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
26
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
30
27
|
const actions = [];
|
|
31
28
|
const { transactionId, transaction, lineIds } = transactionDetails;
|
|
32
|
-
const
|
|
29
|
+
const recommendationByLineId = (0, recommendationHelper_1.getRecommendationByLineIdFromRecommendationPayload)(response.data.recommendations, lineIds);
|
|
33
30
|
const recommendations = (0, recommendationHelper_1.getRecommendationFromRecommendationPayload)(response.data.recommendations);
|
|
34
31
|
// Convert transaction to COT format for categorization flow
|
|
35
|
-
|
|
36
|
-
const transactionWithCOT = isFetchCOT === true && recommendationWithCOTByLineId != null
|
|
37
|
-
? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
|
|
38
|
-
: (0, transactionHelper_1.getTransactionWithCOT)(transaction);
|
|
32
|
+
const transactionWithCOT = (0, transactionHelper_1.getTransactionWithCOT)(transaction);
|
|
39
33
|
actions.push((0, recommendationReducer_1.updateRecommendationForEntity)({
|
|
40
34
|
entityId: entity.id,
|
|
41
35
|
entityType: entity.type,
|
|
@@ -44,13 +38,14 @@ const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI
|
|
|
44
38
|
if (isBulkFetch === true) {
|
|
45
39
|
actions.push((0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
|
|
46
40
|
}
|
|
47
|
-
if (
|
|
41
|
+
if (recommendationByLineId != null) {
|
|
48
42
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
|
|
49
43
|
if (isTransactionCategorizationFlow === true) {
|
|
44
|
+
const recommendationWithCOTByLineId = (0, transactionHelper_1.convertRecommendationByLineIdToCOT)(recommendationByLineId, transactionWithCOT);
|
|
50
45
|
actions.push((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(selectedTransactionCategorizationTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
|
|
51
46
|
}
|
|
52
47
|
else {
|
|
53
|
-
actions.push((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId,
|
|
48
|
+
actions.push((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transaction, lineIds, entity, amount, recommendationByLineId, uncategorizedIncomeExpense));
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
return (0, rxjs_1.from)(actions);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { RecommendationPayload
|
|
1
|
+
import { RecommendationPayload } from '../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { ID } from '../../commonStateTypes/common';
|
|
3
|
-
import { Recommendation
|
|
4
|
-
import { RecommendationByLineId
|
|
3
|
+
import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
4
|
+
import { RecommendationByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
5
5
|
export declare const getRecommendationFromRecommendationPayload: (payload: RecommendationPayload[]) => Recommendation[] | undefined;
|
|
6
6
|
export declare const getRecommendationByLineIdFromRecommendationPayload: (recommendationPayload: RecommendationPayload[], lineIds: ID[]) => RecommendationByLineId | undefined;
|
|
7
|
-
export declare const getRecommendationWithCOTFromRecommendationPayloadWithCOT: (payload: RecommendationPayloadWithCOT[]) => RecommendationWithCOT[] | undefined;
|
|
8
|
-
export declare const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT: (recommendationPayload: RecommendationPayloadWithCOT[], lineIds: ID[]) => RecommendationWithCOTByLineId | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRecommendationByLineIdFromRecommendationPayload = exports.getRecommendationFromRecommendationPayload = void 0;
|
|
4
4
|
const transactionPayload_1 = require("../../entity/transaction/payloadTypes/transactionPayload");
|
|
5
5
|
const getRecommendationFromRecommendationPayload = (payload) => {
|
|
6
6
|
if (payload == null || payload.length === 0) {
|
|
@@ -32,33 +32,3 @@ const getRecommendationByLineIdFromRecommendationPayload = (recommendationPayloa
|
|
|
32
32
|
return recommendationsWithLine;
|
|
33
33
|
};
|
|
34
34
|
exports.getRecommendationByLineIdFromRecommendationPayload = getRecommendationByLineIdFromRecommendationPayload;
|
|
35
|
-
const getRecommendationWithCOTFromRecommendationPayloadWithCOT = (payload) => {
|
|
36
|
-
if (payload == null || payload.length === 0) {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
const recommendations = [];
|
|
40
|
-
payload.forEach((recommendationPayload) => {
|
|
41
|
-
recommendations.push(...(0, transactionPayload_1.transformRecommendationWithCOT)(recommendationPayload));
|
|
42
|
-
});
|
|
43
|
-
return recommendations;
|
|
44
|
-
};
|
|
45
|
-
exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = getRecommendationWithCOTFromRecommendationPayloadWithCOT;
|
|
46
|
-
const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = (recommendationPayload, lineIds) => {
|
|
47
|
-
if (recommendationPayload.length === 0) {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
const recommendationsWithLine = {};
|
|
51
|
-
/* Note: Below case will happen only when we are fetching vendor recomemndations from a JE transaction line item.
|
|
52
|
-
And in such a case, we only want to update recommendation for that line.lineIds will always have a single element */
|
|
53
|
-
if (lineIds.length !== recommendationPayload.length) {
|
|
54
|
-
recommendationsWithLine[lineIds[0]] = (0, transactionPayload_1.transformRecommendationWithCOT)(recommendationPayload[parseInt(lineIds[0])]);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
recommendationPayload.forEach((lineRecommendations, index) => {
|
|
58
|
-
recommendationsWithLine[lineIds[index]] =
|
|
59
|
-
(0, transactionPayload_1.transformRecommendationWithCOT)(lineRecommendations);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return recommendationsWithLine;
|
|
63
|
-
};
|
|
64
|
-
exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RecommendationPayload
|
|
1
|
+
import { RecommendationPayload } from '../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
3
|
interface RecommendationUpdatePayload {
|
|
4
4
|
recommendations: RecommendationPayload[];
|
|
@@ -8,8 +8,4 @@ interface FetchRecommendationPayload {
|
|
|
8
8
|
recommendations: RecommendationPayload[];
|
|
9
9
|
}
|
|
10
10
|
export type FetchRecommendationResponse = ZeniAPIResponse<FetchRecommendationPayload>;
|
|
11
|
-
interface FetchRecommendationPayloadWithCOT {
|
|
12
|
-
recommendations: RecommendationPayloadWithCOT[];
|
|
13
|
-
}
|
|
14
|
-
export type FetchRecommendationResponseWithCOT = ZeniAPIResponse<FetchRecommendationPayloadWithCOT>;
|
|
15
11
|
export {};
|
|
@@ -10,7 +10,7 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
10
10
|
lineIds: ID[];
|
|
11
11
|
transaction: SupportedTransaction;
|
|
12
12
|
transactionId: TransactionID;
|
|
13
|
-
}, isBulkFetch: boolean, isTransactionCategorizationFlow?: any
|
|
13
|
+
}, isBulkFetch: boolean, isTransactionCategorizationFlow?: any], {
|
|
14
14
|
entity: Entity;
|
|
15
15
|
amount: number;
|
|
16
16
|
transactionDetails: {
|
|
@@ -20,7 +20,6 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
20
20
|
};
|
|
21
21
|
isBulkFetch: boolean;
|
|
22
22
|
isTransactionCategorizationFlow: any;
|
|
23
|
-
isFetchCOT: any;
|
|
24
23
|
}, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
|
|
25
24
|
entityName: string;
|
|
26
25
|
entityType: EntityType;
|
|
@@ -20,7 +20,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
20
20
|
draft.recommendationByEntity[key] = Object.assign(Object.assign({}, recommendationState_1.initialEntityRecommendationState), { fetchState: 'In-Progress' });
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
prepare(entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow = false
|
|
23
|
+
prepare(entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow = false) {
|
|
24
24
|
return {
|
|
25
25
|
payload: {
|
|
26
26
|
entity,
|
|
@@ -28,7 +28,6 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
28
28
|
transactionDetails,
|
|
29
29
|
isBulkFetch,
|
|
30
30
|
isTransactionCategorizationFlow,
|
|
31
|
-
isFetchCOT,
|
|
32
31
|
},
|
|
33
32
|
};
|
|
34
33
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation"
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ export declare const fetchChargeCardSetupView: import("@reduxjs/toolkit").Action
|
|
|
13
13
|
enableChargeCard: boolean;
|
|
14
14
|
chargeCardSetupViewType: "charge_cards" | "debit_cards" | "charge_cards__debit_cards";
|
|
15
15
|
isEarlyPayEnabled: boolean;
|
|
16
|
-
}, "chargeCardSetupView/acceptChargeCardTerms", never, never>, acceptChargeCardTermsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/acceptChargeCardTermsSuccess">, acceptChargeCardTermsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/acceptChargeCardTermsFailure", never, never>,
|
|
17
|
-
companyId: string;
|
|
18
|
-
}, "chargeCardSetupView/expressInterestInChargeCard", never, never>, expressInterestInChargeCardSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/expressInterestInChargeCardSuccess">, expressInterestInChargeCardFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/expressInterestInChargeCardFailure">, clearChargeCardSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/clearChargeCardSetupView">;
|
|
16
|
+
}, "chargeCardSetupView/acceptChargeCardTerms", never, never>, acceptChargeCardTermsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/acceptChargeCardTermsSuccess">, acceptChargeCardTermsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "chargeCardSetupView/acceptChargeCardTermsFailure", never, never>, clearChargeCardSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardSetupView/clearChargeCardSetupView">;
|
|
19
17
|
declare const _default: import("redux").Reducer<ChargeCardSetupViewState>;
|
|
20
18
|
export default _default;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearChargeCardSetupView = exports.
|
|
4
|
+
exports.clearChargeCardSetupView = exports.acceptChargeCardTermsFailure = exports.acceptChargeCardTermsSuccess = exports.acceptChargeCardTerms = exports.enableChargeCardAutoPayFailure = exports.enableChargeCardAutoPaySuccess = exports.enableChargeCardAutoPay = exports.fetchChargeCardSetupViewFailure = exports.fetchChargeCardSetupViewSuccess = exports.fetchChargeCardSetupView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialState = {
|
|
7
7
|
fetchState: 'Not-Started',
|
|
8
8
|
error: undefined,
|
|
9
9
|
isRefreshingViewInBackground: false,
|
|
10
|
-
expressInterestInChargeCardStatus: {
|
|
11
|
-
fetchState: 'Not-Started',
|
|
12
|
-
error: undefined,
|
|
13
|
-
},
|
|
14
10
|
earlyPayFetchStatus: {
|
|
15
11
|
fetchState: 'Not-Started',
|
|
16
12
|
error: undefined,
|
|
@@ -121,35 +117,10 @@ const chargeCardSetupView = (0, toolkit_1.createSlice)({
|
|
|
121
117
|
};
|
|
122
118
|
},
|
|
123
119
|
},
|
|
124
|
-
expressInterestInChargeCard: {
|
|
125
|
-
reducer(draft) {
|
|
126
|
-
draft.expressInterestInChargeCardStatus = {
|
|
127
|
-
fetchState: 'In-Progress',
|
|
128
|
-
error: undefined,
|
|
129
|
-
};
|
|
130
|
-
},
|
|
131
|
-
prepare(companyId) {
|
|
132
|
-
return {
|
|
133
|
-
payload: { companyId },
|
|
134
|
-
};
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
expressInterestInChargeCardSuccess(draft) {
|
|
138
|
-
draft.expressInterestInChargeCardStatus = {
|
|
139
|
-
fetchState: 'Completed',
|
|
140
|
-
error: undefined,
|
|
141
|
-
};
|
|
142
|
-
},
|
|
143
|
-
expressInterestInChargeCardFailure(draft, action) {
|
|
144
|
-
draft.expressInterestInChargeCardStatus = {
|
|
145
|
-
fetchState: 'Error',
|
|
146
|
-
error: action.payload,
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
120
|
clearChargeCardSetupView(draft) {
|
|
150
121
|
Object.assign(draft, exports.initialState);
|
|
151
122
|
},
|
|
152
123
|
},
|
|
153
124
|
});
|
|
154
|
-
_a = chargeCardSetupView.actions, exports.fetchChargeCardSetupView = _a.fetchChargeCardSetupView, exports.fetchChargeCardSetupViewSuccess = _a.fetchChargeCardSetupViewSuccess, exports.fetchChargeCardSetupViewFailure = _a.fetchChargeCardSetupViewFailure, exports.enableChargeCardAutoPay = _a.enableChargeCardAutoPay, exports.enableChargeCardAutoPaySuccess = _a.enableChargeCardAutoPaySuccess, exports.enableChargeCardAutoPayFailure = _a.enableChargeCardAutoPayFailure, exports.acceptChargeCardTerms = _a.acceptChargeCardTerms, exports.acceptChargeCardTermsSuccess = _a.acceptChargeCardTermsSuccess, exports.acceptChargeCardTermsFailure = _a.acceptChargeCardTermsFailure, exports.
|
|
125
|
+
_a = chargeCardSetupView.actions, exports.fetchChargeCardSetupView = _a.fetchChargeCardSetupView, exports.fetchChargeCardSetupViewSuccess = _a.fetchChargeCardSetupViewSuccess, exports.fetchChargeCardSetupViewFailure = _a.fetchChargeCardSetupViewFailure, exports.enableChargeCardAutoPay = _a.enableChargeCardAutoPay, exports.enableChargeCardAutoPaySuccess = _a.enableChargeCardAutoPaySuccess, exports.enableChargeCardAutoPayFailure = _a.enableChargeCardAutoPayFailure, exports.acceptChargeCardTerms = _a.acceptChargeCardTerms, exports.acceptChargeCardTermsSuccess = _a.acceptChargeCardTermsSuccess, exports.acceptChargeCardTermsFailure = _a.acceptChargeCardTermsFailure, exports.clearChargeCardSetupView = _a.clearChargeCardSetupView;
|
|
155
126
|
exports.default = chargeCardSetupView.reducer;
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { CompanyChargeCardInfo, CompanyDebitCardInfo, CompanyLocaleInfo } from '../../../../entity/company/companyStateTypes';
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
5
|
import { BusinessVerificationDetails, CompanyOfficersDetails, SetupView } from '../../commonSetup/setupViewSelector';
|
|
6
6
|
export interface ChargeCardSetupView extends SetupView, SelectorView {
|
|
7
|
-
expressInterestInChargeCardFetchState: FetchState;
|
|
8
7
|
isRefreshingViewInBackground: boolean;
|
|
9
8
|
chargeCardTermsDetails?: {
|
|
10
9
|
fetchStatus: FetchStateAndError;
|
|
@@ -14,7 +14,7 @@ function getChargeCardSetupViewDetails(state, companyId) {
|
|
|
14
14
|
const { chargeCardSetupViewState, setupViewState } = state;
|
|
15
15
|
const { chargeCardTermsDetails, isRefreshingViewInBackground } = chargeCardSetupViewState;
|
|
16
16
|
const { updateStatus } = setupViewState;
|
|
17
|
-
const { fetchState, error
|
|
17
|
+
const { fetchState, error } = chargeCardSetupViewState;
|
|
18
18
|
const businessVerificationDetails = getChargeCardBusinessVerificationDetails(state, companyId);
|
|
19
19
|
const selectedCompanyOfficer = (0, helpers_1.getSelectedCompanyOfficer)(businessVerificationDetails);
|
|
20
20
|
return Object.assign(Object.assign({}, chargeCardSetupViewDetails), { chargeCardTermsDetails,
|
|
@@ -24,8 +24,7 @@ function getChargeCardSetupViewDetails(state, companyId) {
|
|
|
24
24
|
error,
|
|
25
25
|
updateStatus,
|
|
26
26
|
selectedCompanyOfficer,
|
|
27
|
-
isRefreshingViewInBackground
|
|
28
|
-
expressInterestInChargeCardFetchState });
|
|
27
|
+
isRefreshingViewInBackground });
|
|
29
28
|
}
|
|
30
29
|
function getChargeCardBusinessVerificationDetails(state, companyId) {
|
|
31
30
|
const chargeCardBusinessVerificationDetails = (0, setupViewSelector_1.getBusinessVerificationDetails)(state, companyId);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState } from '../../../../commonStateTypes/common';
|
|
2
2
|
export interface ChargeCardSetupViewState extends FetchedState {
|
|
3
3
|
earlyPayFetchStatus: FetchStateAndError;
|
|
4
|
-
expressInterestInChargeCardStatus: FetchStateAndError;
|
|
5
4
|
isRefreshingViewInBackground: boolean;
|
|
6
5
|
chargeCardTermsDetails?: {
|
|
7
6
|
fetchStatus: FetchStateAndError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation"
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation"
|
|
7
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
|
@@ -3,9 +3,9 @@ import { RecommendationWithCOT } from '../../commonStateTypes/recommendationBase
|
|
|
3
3
|
import { AccountBase, RecommendedAccountBase } from '../../entity/account/accountState';
|
|
4
4
|
import { ClassBase, RecommendedClassBase } from '../../entity/class/classState';
|
|
5
5
|
import { Entity } from '../../entity/genericEntity/entity';
|
|
6
|
-
import {
|
|
6
|
+
import { RecommendationByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
7
7
|
import { JournalEntryTransactionLine, TransactionWithAccountAndClassLine } from '../../entity/transaction/stateTypes/transactionLine';
|
|
8
|
-
import { SupportedTransaction
|
|
8
|
+
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
9
9
|
import { UncategorizedAccounts } from '../accountList/accountListSelector';
|
|
10
10
|
import { TransactionDetailLineItemData, TransactionDetailLocalData } from './transactionDetailTypes';
|
|
11
11
|
export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction, defaultVendorId: ID | undefined, uncategorizedIncomeExpense: UncategorizedAccounts) => TransactionDetailLocalData;
|
|
@@ -30,7 +30,7 @@ export declare const toSetAllLineItemsToCategoryClass: (transaction: SupportedTr
|
|
|
30
30
|
updateOrRetain: "update" | "retain";
|
|
31
31
|
}) => TransactionDetailLocalData;
|
|
32
32
|
export declare const toSetAllLineItemsLocalDataIsUpdateAllChecked: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, isUpdateAll: boolean, entity?: Entity) => TransactionDetailLocalData;
|
|
33
|
-
export declare const setEntityRecommendationForLineIdInLocalData: (transaction:
|
|
33
|
+
export declare const setEntityRecommendationForLineIdInLocalData: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedIncomeExpense: UncategorizedAccounts, recommendationByLineId?: RecommendationByLineId) => TransactionDetailLocalData;
|
|
34
34
|
export declare const removeEntityRecommendationForLineIdInLocalData: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, recommendationLineIds: ID[]) => TransactionDetailLocalData;
|
|
35
35
|
export declare const getChangedLineItemCountFromLocalData: (transaction: SupportedTransaction, transactionLocalData: TransactionDetailLocalData) => number;
|
|
36
36
|
export declare const toSetAllLineItemsToVendor: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, entity: Entity) => TransactionDetailLocalData;
|
|
@@ -521,8 +521,11 @@ const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDe
|
|
|
521
521
|
return newLocalData;
|
|
522
522
|
};
|
|
523
523
|
exports.toSetAllLineItemsLocalDataIsUpdateAllChecked = toSetAllLineItemsLocalDataIsUpdateAllChecked;
|
|
524
|
-
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedIncomeExpense,
|
|
524
|
+
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedIncomeExpense, recommendationByLineId) => {
|
|
525
525
|
const newLineItems = {};
|
|
526
|
+
const recommendationWithCOTByLineId = recommendationByLineId != null
|
|
527
|
+
? (0, transactionHelper_1.convertRecommendationByLineIdToCOT)(recommendationByLineId, (0, transactionHelper_1.getTransactionWithCOT)(transaction))
|
|
528
|
+
: undefined;
|
|
526
529
|
let matchingEntityLineId = undefined;
|
|
527
530
|
const checkIfNotJEAndDeposit = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
528
531
|
(0, customerTransaction_1.isCustomerTransaction)(transaction) === true;
|
|
@@ -3,7 +3,7 @@ import { COTTransactionTracking, Recommendation } from '../../commonStateTypes/r
|
|
|
3
3
|
import { AccountBase } from '../../entity/account/accountState';
|
|
4
4
|
import { ClassBase } from '../../entity/class/classState';
|
|
5
5
|
import { Entity } from '../../entity/genericEntity/entity';
|
|
6
|
-
import {
|
|
6
|
+
import { RecommendationByLineId, TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
7
7
|
import { SupportedTransaction, SupportedTransactionPayload } from '../../entity/transaction/transactionState';
|
|
8
8
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
9
9
|
import { UncategorizedAccounts } from '../accountList/accountListSelector';
|
|
@@ -105,13 +105,13 @@ export declare const downloadAccountingProviderAttachment: import("@reduxjs/tool
|
|
|
105
105
|
transaction: SupportedTransaction;
|
|
106
106
|
isUpdateAll: boolean;
|
|
107
107
|
entity: Entity | undefined;
|
|
108
|
-
}, "transactionDetail/setAllLineItemsLocalDataIsUpdateAllChecked", never, never>, setEntityRecommendationForLineIdsForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineIds: string[], entity: Entity, amount: number,
|
|
108
|
+
}, "transactionDetail/setAllLineItemsLocalDataIsUpdateAllChecked", never, never>, setEntityRecommendationForLineIdsForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineIds: string[], entity: Entity, amount: number, recommendationByLineId: RecommendationByLineId, uncategorizedIncomeExpense: UncategorizedAccounts], {
|
|
109
109
|
transactionId: TransactionID;
|
|
110
110
|
transaction: SupportedTransaction;
|
|
111
111
|
lineIds: string[];
|
|
112
112
|
entity: Entity;
|
|
113
113
|
amount: number;
|
|
114
|
-
|
|
114
|
+
recommendationByLineId: RecommendationByLineId;
|
|
115
115
|
uncategorizedIncomeExpense: UncategorizedAccounts;
|
|
116
116
|
}, "transactionDetail/setEntityRecommendationForLineIdsForTransactionDetail", never, never>, removeEntityRecommendationForLineIdForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineId: string], {
|
|
117
117
|
transactionId: TransactionID;
|
|
@@ -299,15 +299,15 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
299
299
|
setEntityRecommendationForLineIdsForTransactionDetail: {
|
|
300
300
|
// ToDo: Add a reducer test case to handle this part for JE tran as well - where we only update for targeted line
|
|
301
301
|
reducer(draft, action) {
|
|
302
|
-
const { transaction, lineIds,
|
|
302
|
+
const { transaction, lineIds, recommendationByLineId, uncategorizedIncomeExpense, } = action.payload;
|
|
303
303
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
304
304
|
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
305
305
|
if (detail != null) {
|
|
306
|
-
const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds, uncategorizedIncomeExpense,
|
|
306
|
+
const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds, uncategorizedIncomeExpense, recommendationByLineId);
|
|
307
307
|
draft.transactionDetailById[key] = Object.assign(Object.assign({}, detail), { transactionDetailLocalData: newLocalData });
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
|
-
prepare(transactionId, transaction, lineIds, entity, amount,
|
|
310
|
+
prepare(transactionId, transaction, lineIds, entity, amount, recommendationByLineId, uncategorizedIncomeExpense) {
|
|
311
311
|
return {
|
|
312
312
|
payload: {
|
|
313
313
|
transactionId,
|
|
@@ -315,7 +315,7 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
315
315
|
lineIds,
|
|
316
316
|
entity,
|
|
317
317
|
amount,
|
|
318
|
-
|
|
318
|
+
recommendationByLineId,
|
|
319
319
|
uncategorizedIncomeExpense,
|
|
320
320
|
},
|
|
321
321
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.8",
|
|
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",
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
6
|
-
import { updateUserRoles } from '../../../../../entity/userRole/userRoleReducer';
|
|
7
|
-
import { RootState } from '../../../../../reducer';
|
|
8
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
9
|
-
import { expressInterestInChargeCard, expressInterestInChargeCardFailure, expressInterestInChargeCardSuccess } from '../chargeCardSetUpViewReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof expressInterestInChargeCard> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof expressInterestInChargeCardSuccess> | ReturnType<typeof expressInterestInChargeCardFailure> | ReturnType<typeof openSnackbar>;
|
|
11
|
-
export declare const expressInterestChargeCardEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expressInterestChargeCardEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const userReducer_1 = require("../../../../../entity/user/userReducer");
|
|
9
|
-
const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReducer");
|
|
10
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
-
const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUpViewReducer");
|
|
12
|
-
const expressInterestChargeCardEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardSetUpViewReducer_1.expressInterestInChargeCard.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { companyId } = action.payload;
|
|
14
|
-
const payload = {
|
|
15
|
-
is_company_interested_in_charge_card: true,
|
|
16
|
-
};
|
|
17
|
-
return zeniAPI
|
|
18
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
19
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
21
|
-
const actions = [
|
|
22
|
-
(0, userReducer_1.updateAllUsers)({ users: response.data.users }),
|
|
23
|
-
(0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
|
|
24
|
-
(0, companyReducer_1.updateCompanies)({
|
|
25
|
-
payload: response.data.companies,
|
|
26
|
-
schema: {},
|
|
27
|
-
}),
|
|
28
|
-
(0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardSuccess)(),
|
|
29
|
-
];
|
|
30
|
-
return (0, rxjs_1.from)(actions);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return (0, rxjs_1.of)((0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
34
|
-
messageSection: 'charge_card_express_interest',
|
|
35
|
-
messageText: 'failed',
|
|
36
|
-
type: 'error',
|
|
37
|
-
variables: [
|
|
38
|
-
{
|
|
39
|
-
variableName: '_api-error_',
|
|
40
|
-
variableValue: response.status.message,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Express Interest in Charge Card errored out' +
|
|
46
|
-
JSON.stringify(error))))));
|
|
47
|
-
}));
|
|
48
|
-
exports.expressInterestChargeCardEpic = expressInterestChargeCardEpic;
|