@zeniai/client-epic-state 4.18.4 → 4.18.5
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 +19 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountPayload.d.ts +3 -2
- package/lib/entity/account/accountPayload.js +10 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classPayload.d.ts +3 -2
- package/lib/entity/class/classPayload.js +9 -0
- 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 +1 -0
- package/lib/entity/company/companyPayload.js +5 -4
- package/lib/entity/company/companyStateTypes.d.ts +1 -0
- 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 +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +51 -1
- package/lib/entity/transaction/transactionHelper.d.ts +1 -0
- package/lib/entity/transaction/transactionHelper.js +13 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +9 -8
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +1 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +2 -0
- 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 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- 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 +11 -8
- 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 +11 -6
- package/lib/view/recommendation/recommendationHelper.d.ts +5 -3
- package/lib/view/recommendation/recommendationHelper.js +31 -1
- package/lib/view/recommendation/recommendationPayload.d.ts +5 -1
- package/lib/view/recommendation/recommendationReducer.d.ts +2 -1
- package/lib/view/recommendation/recommendationReducer.js +2 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +31 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewState.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.js +48 -0
- 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 +1 -4
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +3 -3
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -4
- package/package.json +1 -1
|
@@ -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, recommendationWithCOTByLineId, 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
|
+
recommendationWithCOTByLineId,
|
|
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.recommendationWithCOTByLineId),
|
|
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", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
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" | "zeni_credit_promo_card", "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" | undefined], {
|
|
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" | "zeni_credit_promo_card" | 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" | 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" | "zeni_credit_promo_card" | 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, } = action.payload;
|
|
15
|
+
const { entity, amount, transactionDetails, isBulkFetch, isTransactionCategorizationFlow, isFetchCOT, } = action.payload;
|
|
16
16
|
const { expenseAutomationTransactionsViewState: { selectedTransactionCategorizationTab, }, } = state$.value;
|
|
17
17
|
const query = {
|
|
18
18
|
amount,
|
|
@@ -20,16 +20,22 @@ 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
|
+
}
|
|
23
26
|
return zeniAPI
|
|
24
27
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/${(0, exports.toEntityTypeURL)(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
25
28
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
26
29
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
27
30
|
const actions = [];
|
|
28
31
|
const { transactionId, transaction, lineIds } = transactionDetails;
|
|
29
|
-
const
|
|
32
|
+
const recommendationWithCOTByLineId = (0, recommendationHelper_1.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT)(response.data.recommendations, lineIds);
|
|
30
33
|
const recommendations = (0, recommendationHelper_1.getRecommendationFromRecommendationPayload)(response.data.recommendations);
|
|
31
34
|
// Convert transaction to COT format for categorization flow
|
|
32
|
-
|
|
35
|
+
// Use COT recommendations if available, otherwise use existing transaction recommendations
|
|
36
|
+
const transactionWithCOT = isFetchCOT === true && recommendationWithCOTByLineId != null
|
|
37
|
+
? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
|
|
38
|
+
: (0, transactionHelper_1.getTransactionWithCOT)(transaction);
|
|
33
39
|
actions.push((0, recommendationReducer_1.updateRecommendationForEntity)({
|
|
34
40
|
entityId: entity.id,
|
|
35
41
|
entityType: entity.type,
|
|
@@ -38,14 +44,13 @@ const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI
|
|
|
38
44
|
if (isBulkFetch === true) {
|
|
39
45
|
actions.push((0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
|
|
40
46
|
}
|
|
41
|
-
if (
|
|
47
|
+
if (recommendationWithCOTByLineId != null) {
|
|
42
48
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
|
|
43
49
|
if (isTransactionCategorizationFlow === true) {
|
|
44
|
-
const recommendationWithCOTByLineId = (0, transactionHelper_1.convertRecommendationByLineIdToCOT)(recommendationByLineId, transactionWithCOT);
|
|
45
50
|
actions.push((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(selectedTransactionCategorizationTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
|
-
actions.push((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId,
|
|
53
|
+
actions.push((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
56
|
return (0, rxjs_1.from)(actions);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { RecommendationPayload } from '../../commonPayloadTypes/recommendationPayload';
|
|
1
|
+
import { RecommendationPayload, RecommendationPayloadWithCOT } from '../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { ID } from '../../commonStateTypes/common';
|
|
3
|
-
import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
4
|
-
import { RecommendationByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
3
|
+
import { Recommendation, RecommendationWithCOT } from '../../commonStateTypes/recommendationBase';
|
|
4
|
+
import { RecommendationByLineId, RecommendationWithCOTByLineId } 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.getRecommendationByLineIdFromRecommendationPayload = exports.getRecommendationFromRecommendationPayload = void 0;
|
|
3
|
+
exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = 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,3 +32,33 @@ 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 } from '../../commonPayloadTypes/recommendationPayload';
|
|
1
|
+
import { RecommendationPayload, RecommendationPayloadWithCOT } from '../../commonPayloadTypes/recommendationPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
3
|
interface RecommendationUpdatePayload {
|
|
4
4
|
recommendations: RecommendationPayload[];
|
|
@@ -8,4 +8,8 @@ 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>;
|
|
11
15
|
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, isFetchCOT?: any], {
|
|
14
14
|
entity: Entity;
|
|
15
15
|
amount: number;
|
|
16
16
|
transactionDetails: {
|
|
@@ -20,6 +20,7 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
20
20
|
};
|
|
21
21
|
isBulkFetch: boolean;
|
|
22
22
|
isTransactionCategorizationFlow: any;
|
|
23
|
+
isFetchCOT: any;
|
|
23
24
|
}, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
|
|
24
25
|
entityName: string;
|
|
25
26
|
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, isFetchCOT = false) {
|
|
24
24
|
return {
|
|
25
25
|
payload: {
|
|
26
26
|
entity,
|
|
@@ -28,6 +28,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
28
28
|
transactionDetails,
|
|
29
29
|
isBulkFetch,
|
|
30
30
|
isTransactionCategorizationFlow,
|
|
31
|
+
isFetchCOT,
|
|
31
32
|
},
|
|
32
33
|
};
|
|
33
34
|
},
|
|
@@ -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" | "zeni_credit_promo_card";
|
|
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,6 +13,8 @@ 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>,
|
|
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>, expressInterestInChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
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">;
|
|
17
19
|
declare const _default: import("redux").Reducer<ChargeCardSetupViewState>;
|
|
18
20
|
export default _default;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
4
|
+
exports.clearChargeCardSetupView = exports.expressInterestInChargeCardFailure = exports.expressInterestInChargeCardSuccess = exports.expressInterestInChargeCard = 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
|
+
},
|
|
10
14
|
earlyPayFetchStatus: {
|
|
11
15
|
fetchState: 'Not-Started',
|
|
12
16
|
error: undefined,
|
|
@@ -117,10 +121,35 @@ const chargeCardSetupView = (0, toolkit_1.createSlice)({
|
|
|
117
121
|
};
|
|
118
122
|
},
|
|
119
123
|
},
|
|
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
|
+
},
|
|
120
149
|
clearChargeCardSetupView(draft) {
|
|
121
150
|
Object.assign(draft, exports.initialState);
|
|
122
151
|
},
|
|
123
152
|
},
|
|
124
153
|
});
|
|
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;
|
|
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.expressInterestInChargeCard = _a.expressInterestInChargeCard, exports.expressInterestInChargeCardSuccess = _a.expressInterestInChargeCardSuccess, exports.expressInterestInChargeCardFailure = _a.expressInterestInChargeCardFailure, exports.clearChargeCardSetupView = _a.clearChargeCardSetupView;
|
|
126
155
|
exports.default = chargeCardSetupView.reducer;
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, 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;
|
|
7
8
|
isRefreshingViewInBackground: boolean;
|
|
8
9
|
chargeCardTermsDetails?: {
|
|
9
10
|
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 } = chargeCardSetupViewState;
|
|
17
|
+
const { fetchState, error, expressInterestInChargeCardStatus: { fetchState: expressInterestInChargeCardFetchState, }, } = 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,7 +24,8 @@ function getChargeCardSetupViewDetails(state, companyId) {
|
|
|
24
24
|
error,
|
|
25
25
|
updateStatus,
|
|
26
26
|
selectedCompanyOfficer,
|
|
27
|
-
isRefreshingViewInBackground
|
|
27
|
+
isRefreshingViewInBackground,
|
|
28
|
+
expressInterestInChargeCardFetchState });
|
|
28
29
|
}
|
|
29
30
|
function getChargeCardBusinessVerificationDetails(state, companyId) {
|
|
30
31
|
const chargeCardBusinessVerificationDetails = (0, setupViewSelector_1.getBusinessVerificationDetails)(state, companyId);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState } from '../../../../commonStateTypes/common';
|
|
2
2
|
export interface ChargeCardSetupViewState extends FetchedState {
|
|
3
3
|
earlyPayFetchStatus: FetchStateAndError;
|
|
4
|
+
expressInterestInChargeCardStatus: FetchStateAndError;
|
|
4
5
|
isRefreshingViewInBackground: boolean;
|
|
5
6
|
chargeCardTermsDetails?: {
|
|
6
7
|
fetchStatus: FetchStateAndError;
|
package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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;
|
|
@@ -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" | "zeni_credit_promo_card";
|
|
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" | "zeni_credit_promo_card";
|
|
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 { RecommendationWithCOTByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
7
7
|
import { JournalEntryTransactionLine, TransactionWithAccountAndClassLine } from '../../entity/transaction/stateTypes/transactionLine';
|
|
8
|
-
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
8
|
+
import { SupportedTransaction, SupportedTransactionWithCOT } 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: SupportedTransactionWithCOT, transactionDetailLocalData: TransactionDetailLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedIncomeExpense: UncategorizedAccounts, recommendationWithCOTByLineId?: RecommendationWithCOTByLineId) => 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;
|
|
@@ -530,11 +530,8 @@ const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDe
|
|
|
530
530
|
return newLocalData;
|
|
531
531
|
};
|
|
532
532
|
exports.toSetAllLineItemsLocalDataIsUpdateAllChecked = toSetAllLineItemsLocalDataIsUpdateAllChecked;
|
|
533
|
-
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedIncomeExpense,
|
|
533
|
+
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, uncategorizedIncomeExpense, recommendationWithCOTByLineId) => {
|
|
534
534
|
const newLineItems = {};
|
|
535
|
-
const recommendationWithCOTByLineId = recommendationByLineId != null
|
|
536
|
-
? (0, transactionHelper_1.convertRecommendationByLineIdToCOT)(recommendationByLineId, (0, transactionHelper_1.getTransactionWithCOT)(transaction))
|
|
537
|
-
: undefined;
|
|
538
535
|
let matchingEntityLineId = undefined;
|
|
539
536
|
const checkIfNotJEAndDeposit = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
540
537
|
(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 { RecommendationWithCOTByLineId, 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, recommendationWithCOTByLineId: RecommendationWithCOTByLineId, uncategorizedIncomeExpense: UncategorizedAccounts], {
|
|
109
109
|
transactionId: TransactionID;
|
|
110
110
|
transaction: SupportedTransaction;
|
|
111
111
|
lineIds: string[];
|
|
112
112
|
entity: Entity;
|
|
113
113
|
amount: number;
|
|
114
|
-
|
|
114
|
+
recommendationWithCOTByLineId: RecommendationWithCOTByLineId;
|
|
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, recommendationWithCOTByLineId, 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, recommendationWithCOTByLineId);
|
|
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, recommendationWithCOTByLineId, 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
|
+
recommendationWithCOTByLineId,
|
|
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.5",
|
|
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",
|