@zeniai/client-epic-state 4.18.90 → 4.18.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +4 -0
- package/lib/commonStateTypes/classesView/getNestedClassIDHierarchyForReport.js +2 -0
- package/lib/commonStateTypes/classesView/nestedClassID.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +2 -1
- package/lib/entity/chargeCard/chargeCard.js +2 -0
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +2 -1
- package/lib/entity/chargeCard/chargeCardPayload.js +10 -9
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.d.ts +1 -2
- package/lib/entity/class/classPayload.d.ts +1 -0
- package/lib/entity/class/classPayload.js +9 -9
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +2 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +8 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +14 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +8 -0
- 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 +34 -8
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.js +8 -2
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/epic.d.ts +13 -1
- package/lib/epic.js +13 -1
- package/lib/index.d.ts +14 -12
- package/lib/index.js +53 -30
- package/lib/init.d.ts +2 -1
- package/lib/init.js +3 -2
- package/lib/responsePayload.d.ts +3 -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/classList/classListReducer.d.ts +3 -1
- package/lib/view/classList/classListReducer.js +8 -3
- package/lib/view/classList/fetchClassListEpic.js +6 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +2 -1
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +10 -2
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportViewEpic.js +2 -4
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +2 -1
- package/lib/view/dashboard/dashboardSelector.js +14 -6
- package/lib/view/dashboardLayout/dashboardLayoutReducer.js +1 -0
- package/lib/view/dashboardLayout/fetchDashboardLayoutEpic.js +14 -1
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +3 -1
- package/lib/view/expenseAutomationView/helpers/helpers.d.ts +3 -3
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +46 -64
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthClosePerformanceTrendEpic.d.ts +7 -0
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthClosePerformanceTrendEpic.js +47 -0
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.js +1 -1
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.d.ts +8 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.d.ts +11 -1
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.js +47 -3
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.d.ts +3 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +18 -13
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.d.ts +7 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +3 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +17 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +38 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +11 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +40 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +189 -26
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +19 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +87 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/closeChargeCardEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/closeChargeCardEpic.js +71 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardsRecurringExpensesEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardsRecurringExpensesEpic.js +44 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +4 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/lockChargeCardEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/lockChargeCardEpic.js +78 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/unlockChargeCardEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/unlockChargeCardEpic.js +75 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardNameEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardNameEpic.js +83 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +34 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +142 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +46 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +198 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/closeChargeCardsEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/closeChargeCardsEpic.js +69 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +18 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/lockChargeCardsEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/lockChargeCardsEpic.js +69 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeChargeCardsInviteEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeChargeCardsInviteEpic.js +71 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/unlockChargeCardsEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/unlockChargeCardsEpic.js +68 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/updateChargeCardsLimitEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/updateChargeCardsLimitEpic.js +76 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +24 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +1 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/zeniAPI.d.ts +12 -1
- package/lib/zeniAPI.js +33 -6
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
2
2
|
import { ClassListResponse } from './classListPayload';
|
|
3
3
|
import { ClassListState } from './classListState';
|
|
4
4
|
export declare const initialState: ClassListState;
|
|
5
|
-
export declare const fetchClassList: import("@reduxjs/toolkit").
|
|
5
|
+
export declare const fetchClassList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isIncludeDeleted?: boolean | undefined], {
|
|
6
|
+
isIncludeDeleted: boolean;
|
|
7
|
+
}, "classList/fetchClassList", never, never>, updateClassList: import("@reduxjs/toolkit").ActionCreatorWithPayload<ClassListResponse, "classList/updateClassList">, updateClassListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "classList/updateClassListFailure">, clearClassList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"classList/clearClassList">;
|
|
6
8
|
declare const _default: import("redux").Reducer<ClassListState>;
|
|
7
9
|
export default _default;
|
|
@@ -18,9 +18,14 @@ const classList = (0, toolkit_1.createSlice)({
|
|
|
18
18
|
name: 'classList',
|
|
19
19
|
initialState: exports.initialState,
|
|
20
20
|
reducers: {
|
|
21
|
-
fetchClassList
|
|
22
|
-
draft
|
|
23
|
-
|
|
21
|
+
fetchClassList: {
|
|
22
|
+
reducer(draft) {
|
|
23
|
+
draft.fetchState = 'In-Progress';
|
|
24
|
+
draft.error = undefined;
|
|
25
|
+
},
|
|
26
|
+
prepare(isIncludeDeleted) {
|
|
27
|
+
return { payload: { isIncludeDeleted: isIncludeDeleted !== null && isIncludeDeleted !== void 0 ? isIncludeDeleted : false } };
|
|
28
|
+
},
|
|
24
29
|
},
|
|
25
30
|
updateClassList(draft, action) {
|
|
26
31
|
var _a, _b, _c, _d;
|
|
@@ -6,9 +6,13 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const classReducer_1 = require("../../entity/class/classReducer");
|
|
7
7
|
const responsePayload_1 = require("../../responsePayload");
|
|
8
8
|
const classListReducer_1 = require("./classListReducer");
|
|
9
|
-
const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.switchMap)(() => {
|
|
9
|
+
const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { isIncludeDeleted } = action.payload;
|
|
11
|
+
const queryParams = isIncludeDeleted === true
|
|
12
|
+
? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
|
|
13
|
+
: '';
|
|
10
14
|
return zeniAPI
|
|
11
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/classes`)
|
|
15
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/classes${queryParams}`)
|
|
12
16
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
17
|
var _a, _b;
|
|
14
18
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
@@ -19,11 +19,12 @@ export declare const fetchImproveUsingZeniGPT: import("@reduxjs/toolkit").Action
|
|
|
19
19
|
}, "reviewCompanyView/updateImproveUsingZeniGPTSuccess", never, never>, updateImproveUsingZeniGPTFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>, companyId: string], {
|
|
20
20
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
21
21
|
companyId: string;
|
|
22
|
-
}, "reviewCompanyView/updateImproveUsingZeniGPTFailure", never, never>, fetchCompanyMonthEndReportView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any, companyId: string, tenantId?: string | undefined, insightDate?: string | undefined], {
|
|
22
|
+
}, "reviewCompanyView/updateImproveUsingZeniGPTFailure", never, never>, fetchCompanyMonthEndReportView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any, companyId: string, tenantId?: string | undefined, insightDate?: string | undefined, refreshInsights?: boolean | undefined], {
|
|
23
23
|
cacheOverride: any;
|
|
24
24
|
companyId: string;
|
|
25
25
|
tenantId: string | undefined;
|
|
26
26
|
insightDate: string | undefined;
|
|
27
|
+
refreshInsights: boolean | undefined;
|
|
27
28
|
}, "reviewCompanyView/fetchCompanyMonthEndReportView", never, never>, updateCompanyMonthEndReportViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, data: CompanyMonthEndReportViewPayload], {
|
|
28
29
|
companyId: string;
|
|
29
30
|
data: CompanyMonthEndReportViewPayload;
|
|
@@ -48,8 +48,16 @@ const companyMonthEndReportView = (0, toolkit_1.createSlice)({
|
|
|
48
48
|
initialState: exports.initialState,
|
|
49
49
|
reducers: {
|
|
50
50
|
fetchCompanyMonthEndReportView: {
|
|
51
|
-
prepare(cacheOverride = true, companyId, tenantId, insightDate) {
|
|
52
|
-
return {
|
|
51
|
+
prepare(cacheOverride = true, companyId, tenantId, insightDate, refreshInsights) {
|
|
52
|
+
return {
|
|
53
|
+
payload: {
|
|
54
|
+
cacheOverride,
|
|
55
|
+
companyId,
|
|
56
|
+
tenantId,
|
|
57
|
+
insightDate,
|
|
58
|
+
refreshInsights,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
53
61
|
},
|
|
54
62
|
reducer(draft, action) {
|
|
55
63
|
const companyId = action.payload.companyId;
|
|
@@ -7,15 +7,13 @@ const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const companyMonthEndReportViewReducer_1 = require("../companyMonthEndReportViewReducer");
|
|
9
9
|
const fetchCompanyMonthEndReportViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
-
const { cacheOverride, companyId, tenantId, insightDate } = action.payload;
|
|
10
|
+
const { cacheOverride, companyId, tenantId, refreshInsights, insightDate } = action.payload;
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const fetchState = state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].fetchState;
|
|
13
13
|
const zeniTenantId = tenantId !== null && tenantId !== void 0 ? tenantId : state.companyState.companiesById[companyId].companyInfo.tenantId;
|
|
14
14
|
if (zeniTenantId != null &&
|
|
15
15
|
(cacheOverride === true || fetchState !== 'Completed')) {
|
|
16
|
-
const queryParam = {
|
|
17
|
-
insight_date: insightDate !== null && insightDate !== void 0 ? insightDate : null,
|
|
18
|
-
};
|
|
16
|
+
const queryParam = Object.assign({ insight_date: insightDate !== null && insightDate !== void 0 ? insightDate : null }, (refreshInsights === true && { refresh_insights: refreshInsights }));
|
|
19
17
|
const apiUrl = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}/emails/month-end?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
|
|
20
18
|
return zeniAPI
|
|
21
19
|
.getJSON(apiUrl, {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DashboardState } from './dashboardState';
|
|
2
2
|
export declare const initialState: DashboardState;
|
|
3
|
-
export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("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], {
|
|
3
|
+
export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("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" | "treasury_promo_card")[] | undefined], {
|
|
4
4
|
userId: string;
|
|
5
5
|
companyId: string;
|
|
6
6
|
tenantId: string;
|
|
7
7
|
fetchFullReport: any;
|
|
8
8
|
cacheOverride: any;
|
|
9
|
-
excludeResources: ("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")[];
|
|
9
|
+
excludeResources: ("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" | "treasury_promo_card")[];
|
|
10
10
|
}, "dashboard/fetchDashboard", never, never>, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/clearDashboard">;
|
|
11
11
|
declare const _default: import("redux").Reducer<DashboardState>;
|
|
12
12
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReportID, SelectorReport, SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { TenantsOrdered } from '../../entity/tenant/tenantSelector';
|
|
3
3
|
import { LoggedInUser, Tenant } from '../../entity/tenant/tenantState';
|
|
4
|
+
import { RoleMap } from '../../entity/userRole/userRoleType';
|
|
4
5
|
import { RootState } from '../../reducer';
|
|
5
6
|
import { CardType } from './dashboardState';
|
|
6
7
|
export interface DashboardReport extends SelectorReport {
|
|
@@ -11,4 +12,4 @@ export interface DashboardReport extends SelectorReport {
|
|
|
11
12
|
currentTenant?: Tenant;
|
|
12
13
|
}
|
|
13
14
|
export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[], // used when reports are excluded through statsig
|
|
14
|
-
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean, isDebitCardFeatureEnabled: boolean) => DashboardReport;
|
|
15
|
+
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean, isDebitCardFeatureEnabled: boolean, isTreasuryFeatureEnabled: boolean, userRoleMap?: RoleMap) => DashboardReport;
|
|
@@ -45,8 +45,8 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
|
|
|
45
45
|
exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
|
|
46
46
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
47
47
|
return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
|
|
48
|
-
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isDebitCardFeatureEnabled) => isDebitCardFeatureEnabled, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isDebitCardFeatureEnabled) => {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
48
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isDebitCardFeatureEnabled) => isDebitCardFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, _debitEnabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, _debitEnabled, _treasuryEnabled, userRoleMap) => userRoleMap, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isDebitCardFeatureEnabled, isTreasuryFeatureEnabled, userRoleMap) => {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
50
50
|
const isReimbursementFeatureEnabled = (_a = tenants.currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
|
|
51
51
|
const isBillPayFeatureEnabled = (_b = tenants.currentTenant.company) === null || _b === void 0 ? void 0 : _b.featuresActivationInfo.isBillPayFeatureEnabled;
|
|
52
52
|
const isAdmin = Boolean((_c = tenants.currentTenant) === null || _c === void 0 ? void 0 : _c.userRole) === true
|
|
@@ -61,20 +61,20 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
61
61
|
const cardsToRemove = new Set();
|
|
62
62
|
const chargeCardInfo = (_l = tenants.currentTenant.companyChargeCardInfo) === null || _l === void 0 ? void 0 : _l.info;
|
|
63
63
|
const creditAccountLimit = (_m = chargeCardInfo === null || chargeCardInfo === void 0 ? void 0 : chargeCardInfo.chargeCardsCreditAccountLimit) !== null && _m !== void 0 ? _m : 0;
|
|
64
|
-
let
|
|
64
|
+
let isZeniPromoCardOn4thPosition = true;
|
|
65
65
|
const isChargeCardEnabled = (_o = chargeCardInfo === null || chargeCardInfo === void 0 ? void 0 : chargeCardInfo.isChargeCardEnabled) !== null && _o !== void 0 ? _o : false;
|
|
66
66
|
if (cardBalance != null &&
|
|
67
67
|
cardBalance.fetchState === 'Completed' &&
|
|
68
68
|
(cardBalance.accountsInOrder.length === 0 ||
|
|
69
69
|
((_p = cardBalance.status) === null || _p === void 0 ? void 0 : _p.code) !== 200)) {
|
|
70
70
|
cardsToRemove.add('card_balance');
|
|
71
|
-
|
|
71
|
+
isZeniPromoCardOn4thPosition = false;
|
|
72
72
|
}
|
|
73
73
|
else if (isChargeCardEnabled ||
|
|
74
74
|
creditAccountLimit === -1 ||
|
|
75
75
|
(isDebitCardFeatureEnabled && creditAccountLimit === 0)) {
|
|
76
76
|
cardsToRemove.add('zeni_promo_card');
|
|
77
|
-
|
|
77
|
+
isZeniPromoCardOn4thPosition = false;
|
|
78
78
|
}
|
|
79
79
|
if (hasTopExAccess === false) {
|
|
80
80
|
cardsToRemove.add('top_expenses');
|
|
@@ -166,7 +166,7 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
166
166
|
}
|
|
167
167
|
// //show cards carousel as priority, if ZC promo is coming in 2nd position, follow show promos based on Checking promo > Bills & Reimbursement promo
|
|
168
168
|
// //else if ZC promo is coming in 3rd position, follow ZC promo > Checking promo > Bills & Reimbursement promo
|
|
169
|
-
if (
|
|
169
|
+
if (isZeniPromoCardOn4thPosition) {
|
|
170
170
|
cardsToRemove.add('bill_pay_promo_card');
|
|
171
171
|
cardsToRemove.add('reimbursement_promo_card');
|
|
172
172
|
cardsToRemove.add('zeni_accounts_promo_card');
|
|
@@ -181,6 +181,14 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
181
181
|
cardsToRemove.add('zeni_accounts_promo_card');
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
+
// remove treasury promo card if its already enabled
|
|
185
|
+
const isUserHasTreasuryAccess = (0, userRoleType_1.hasTreasuryAccess)(userRoleMap);
|
|
186
|
+
const isTreasuryTOSAccepted = (_0 = (_z = tenants.currentTenant.companyTreasuryInfo) === null || _z === void 0 ? void 0 : _z.info) === null || _0 === void 0 ? void 0 : _0.isTreasuryTOSAccepted;
|
|
187
|
+
if (isTreasuryTOSAccepted === true ||
|
|
188
|
+
isTreasuryFeatureEnabled === false ||
|
|
189
|
+
isUserHasTreasuryAccess === false) {
|
|
190
|
+
cardsToRemove.add('treasury_promo_card');
|
|
191
|
+
}
|
|
184
192
|
cardsCopy = cardsCopy.filter((c) => !cardsToRemove.has(c));
|
|
185
193
|
const reportsInOrder = [
|
|
186
194
|
cashBalance,
|
|
@@ -10,7 +10,20 @@ const fetchDashboardLayoutEpic = (actions$, _, zeniAPI) => actions$.pipe((0, ope
|
|
|
10
10
|
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/webapp-preferences`)
|
|
11
11
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
12
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data) {
|
|
13
|
-
|
|
13
|
+
const cardOrder = response.data.preferences
|
|
14
|
+
.card_order;
|
|
15
|
+
let updatedCardOrder = cardOrder;
|
|
16
|
+
// if treasury promo card is not in the response, add it at third position
|
|
17
|
+
// and update in the backend
|
|
18
|
+
if (cardOrder.includes('treasury_promo_card') === false) {
|
|
19
|
+
updatedCardOrder = [
|
|
20
|
+
...cardOrder.slice(0, 2),
|
|
21
|
+
'treasury_promo_card',
|
|
22
|
+
...cardOrder.slice(2),
|
|
23
|
+
];
|
|
24
|
+
return (0, rxjs_1.of)((0, dashboardLayoutReducer_1.updateDashboardLayout)(updatedCardOrder));
|
|
25
|
+
}
|
|
26
|
+
return (0, rxjs_1.of)((0, dashboardLayoutReducer_1.fetchDashboardLayoutSuccess)(updatedCardOrder));
|
|
14
27
|
}
|
|
15
28
|
else {
|
|
16
29
|
const shouldCallPost = response.status.code === 404;
|
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js
CHANGED
|
@@ -48,7 +48,7 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
|
|
|
48
48
|
]);
|
|
49
49
|
case 'month_end_insights':
|
|
50
50
|
return (0, rxjs_1.from)([
|
|
51
|
-
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, undefined),
|
|
51
|
+
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, undefined, true),
|
|
52
52
|
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId, currentTenant.tenantId),
|
|
53
53
|
]);
|
|
54
54
|
case 'reconciliation': {
|
|
@@ -51,6 +51,7 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
51
51
|
...Object.keys(failedLineItemsByTransactionId),
|
|
52
52
|
]),
|
|
53
53
|
];
|
|
54
|
+
const allCategorizedTransactionIds = allReviewedTransactionIds.filter((transactionId) => !(transactionId in failedLineItemsByTransactionId));
|
|
54
55
|
const transactionsToRemoveFromEntity = [];
|
|
55
56
|
const transactionsToRemoveFromTab = [];
|
|
56
57
|
const transactionsToUpdateLineItems = {};
|
|
@@ -118,7 +119,8 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
118
119
|
selectedTab,
|
|
119
120
|
totalCount: updatedTotalCount,
|
|
120
121
|
}));
|
|
121
|
-
actions.push((0, snackbarReducer_1.openSnackbar)((0, transactionCategorizationLocalDataHelper_1.getSnackbarMessageForTransactionReview)(transactionsSuccess.length
|
|
122
|
+
actions.push((0, snackbarReducer_1.openSnackbar)((0, transactionCategorizationLocalDataHelper_1.getSnackbarMessageForTransactionReview)(transactionsSuccess.length -
|
|
123
|
+
allCategorizedTransactionIds.length, allFailedIds.length, allCategorizedTransactionIds.length)));
|
|
122
124
|
if (currentTenant != null) {
|
|
123
125
|
actions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
124
126
|
tenantId: currentTenant.tenantId,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CurrencyPayload } from '../../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
2
2
|
import { FluxAnalysisActionQueryType, FluxAnalysisQuerySortKey, MonthBalancePayload } from '../payload/fluxAnalysisPayload';
|
|
3
3
|
import { FluxAnalysisActionType, FluxAnalysisReviewStatus, FluxAnalysisSortKey, FluxBalancesByMonth } from '../types/fluxAnalysisViewState';
|
|
4
|
-
export declare const TRANSACTION_VARIABLE_NAME = "_transaction_";
|
|
5
4
|
export declare const TRANSACTION_COUNT_VARIABLE_NAME = "_transactions_count_";
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
5
|
+
export declare const TRANSACTION_CATEGORIZED_COUNT_VARIABLE_NAME = "_categorized_count_";
|
|
6
|
+
export declare const TRANSACTION_UPDATED_COUNT_VARIABLE_NAME = "_updated_count_";
|
|
7
|
+
export declare const TRANSACTION_FAILED_COUNT_VARIABLE_NAME = "_failed_count_";
|
|
8
8
|
export declare const toBalancesByMonthFromPayload: (month1: MonthBalancePayload, month2: MonthBalancePayload, currency: CurrencyPayload) => FluxBalancesByMonth;
|
|
9
9
|
export declare const toVendorFluxAnalysisSortKeyPayload: (sortKey: FluxAnalysisSortKey) => FluxAnalysisQuerySortKey;
|
|
10
10
|
export declare const toVendorFluxAnalysisReviewActionPayload: (actionType: FluxAnalysisActionType) => FluxAnalysisActionQueryType;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toVendorFluxAnalysisStatusFromPayload = exports.toVendorFluxAnalysisReviewActionPayload = exports.toVendorFluxAnalysisSortKeyPayload = exports.toBalancesByMonthFromPayload = exports.
|
|
3
|
+
exports.toVendorFluxAnalysisStatusFromPayload = exports.toVendorFluxAnalysisReviewActionPayload = exports.toVendorFluxAnalysisSortKeyPayload = exports.toBalancesByMonthFromPayload = exports.TRANSACTION_FAILED_COUNT_VARIABLE_NAME = exports.TRANSACTION_UPDATED_COUNT_VARIABLE_NAME = exports.TRANSACTION_CATEGORIZED_COUNT_VARIABLE_NAME = exports.TRANSACTION_COUNT_VARIABLE_NAME = void 0;
|
|
4
4
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
5
|
-
exports.TRANSACTION_VARIABLE_NAME = '_transaction_';
|
|
6
5
|
exports.TRANSACTION_COUNT_VARIABLE_NAME = '_transactions_count_';
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
6
|
+
exports.TRANSACTION_CATEGORIZED_COUNT_VARIABLE_NAME = '_categorized_count_';
|
|
7
|
+
exports.TRANSACTION_UPDATED_COUNT_VARIABLE_NAME = '_updated_count_';
|
|
8
|
+
exports.TRANSACTION_FAILED_COUNT_VARIABLE_NAME = '_failed_count_';
|
|
9
9
|
const toBalancesByMonthFromPayload = (month1, month2, currency) => {
|
|
10
10
|
var _a, _b, _c, _d;
|
|
11
11
|
return {
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: Su
|
|
|
16
16
|
export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: SupportedTransactionPayload[]) => Record<string, string[]>;
|
|
17
17
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
18
18
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
19
|
-
export declare const getSnackbarMessageForTransactionReview: (
|
|
20
|
-
messageSection: "
|
|
19
|
+
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
20
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
|
|
21
21
|
messageText: "notification" | "failed" | "success";
|
|
22
22
|
type: "error" | "success" | "info";
|
|
23
23
|
variables: {
|
|
@@ -457,85 +457,67 @@ const mergeTabSpecificLineItems = (currentTabSpecificLineItems, selectedTab, new
|
|
|
457
457
|
return tabSpecificLineItems;
|
|
458
458
|
};
|
|
459
459
|
exports.mergeTabSpecificLineItems = mergeTabSpecificLineItems;
|
|
460
|
-
const getSnackbarMessageForTransactionReview = (
|
|
461
|
-
let messageSection = '
|
|
460
|
+
const getSnackbarMessageForTransactionReview = (updatedCount, failedCount, categorizedCount) => {
|
|
461
|
+
let messageSection = 'transactions_categorized_updated_failed';
|
|
462
462
|
let messageText = 'notification';
|
|
463
463
|
let type = 'info';
|
|
464
464
|
let variables = [];
|
|
465
|
-
if (
|
|
466
|
-
messageSection =
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
variableValue: failedCount.toString(),
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
else if (successCount > 0 && failedCount === 0) {
|
|
476
|
-
if (reviewedSuccessCount === 0) {
|
|
477
|
-
messageSection =
|
|
478
|
-
successCount > 1 ? 'transactions_updated' : 'transaction_updated';
|
|
479
|
-
messageText = 'success';
|
|
465
|
+
if ([categorizedCount, updatedCount, failedCount].filter(count => count > 0).length === 1) {
|
|
466
|
+
messageSection = 'transaction_categorized_updated_failed';
|
|
467
|
+
let transactionCount = 0;
|
|
468
|
+
if (categorizedCount > 1 || updatedCount > 1 || failedCount > 1) {
|
|
469
|
+
messageSection = 'transactions_categorized_updated_failed';
|
|
470
|
+
}
|
|
471
|
+
if (categorizedCount > 0) {
|
|
480
472
|
type = 'success';
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
variableValue: successCount.toString(),
|
|
484
|
-
});
|
|
473
|
+
messageText = 'success';
|
|
474
|
+
transactionCount = categorizedCount;
|
|
485
475
|
}
|
|
486
|
-
else {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
variableName: helpers_1.TOTAL_TRANSACTIONS_COUNT_VARIABLE_NAME,
|
|
498
|
-
variableValue: successCount.toString(),
|
|
499
|
-
},
|
|
500
|
-
];
|
|
476
|
+
else if (updatedCount > 0) {
|
|
477
|
+
type = 'info';
|
|
478
|
+
messageText = 'notification';
|
|
479
|
+
transactionCount = updatedCount;
|
|
480
|
+
}
|
|
481
|
+
else if (failedCount > 0) {
|
|
482
|
+
type = 'error';
|
|
483
|
+
messageText = 'failed';
|
|
484
|
+
transactionCount = failedCount;
|
|
501
485
|
}
|
|
502
|
-
}
|
|
503
|
-
else if (successCount > 0 && failedCount > 0) {
|
|
504
486
|
variables = [
|
|
505
487
|
{
|
|
506
488
|
variableName: helpers_1.TRANSACTION_COUNT_VARIABLE_NAME,
|
|
507
|
-
variableValue:
|
|
489
|
+
variableValue: transactionCount.toString(),
|
|
490
|
+
},
|
|
491
|
+
];
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
const messageSectionList = [];
|
|
495
|
+
if (categorizedCount > 0) {
|
|
496
|
+
messageSectionList.push(categorizedCount > 1
|
|
497
|
+
? "transactionsCategorized"
|
|
498
|
+
: "transactionCategorized");
|
|
499
|
+
}
|
|
500
|
+
if (updatedCount > 0) {
|
|
501
|
+
messageSectionList.push(updatedCount > 1 ? "transactionsUpdated" : "transactionUpdated");
|
|
502
|
+
}
|
|
503
|
+
if (failedCount > 0) {
|
|
504
|
+
messageSectionList.push(failedCount > 1 ? "transactionsFailed" : "transactionFailed");
|
|
505
|
+
}
|
|
506
|
+
messageSection = messageSectionList.join("_");
|
|
507
|
+
variables = [
|
|
508
|
+
{
|
|
509
|
+
variableName: helpers_1.TRANSACTION_CATEGORIZED_COUNT_VARIABLE_NAME,
|
|
510
|
+
variableValue: categorizedCount.toString(),
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
variableName: helpers_1.TRANSACTION_UPDATED_COUNT_VARIABLE_NAME,
|
|
514
|
+
variableValue: updatedCount.toString(),
|
|
508
515
|
},
|
|
509
516
|
{
|
|
510
517
|
variableName: helpers_1.TRANSACTION_FAILED_COUNT_VARIABLE_NAME,
|
|
511
518
|
variableValue: failedCount.toString(),
|
|
512
519
|
},
|
|
513
520
|
];
|
|
514
|
-
if (failedCount === 1 && reviewedSuccessCount === 1) {
|
|
515
|
-
messageSection = 'transaction_reviewed';
|
|
516
|
-
}
|
|
517
|
-
else if (failedCount === 1 && reviewedSuccessCount > 1) {
|
|
518
|
-
messageSection = 'transactions_reviewed_failed';
|
|
519
|
-
}
|
|
520
|
-
else if (failedCount > 1 && reviewedSuccessCount === 1) {
|
|
521
|
-
messageSection = 'transaction_reviewed_failed';
|
|
522
|
-
}
|
|
523
|
-
else if (failedCount > 1 && reviewedSuccessCount > 1) {
|
|
524
|
-
messageSection = 'transactions_reviewed';
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
messageSection = 'transactions_updated';
|
|
528
|
-
variables = [
|
|
529
|
-
{
|
|
530
|
-
variableName: helpers_1.TRANSACTION_COUNT_VARIABLE_NAME,
|
|
531
|
-
variableValue: successCount.toString(),
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
variableName: helpers_1.TOTAL_TRANSACTIONS_COUNT_VARIABLE_NAME,
|
|
535
|
-
variableValue: (failedCount + successCount).toString(),
|
|
536
|
-
},
|
|
537
|
-
];
|
|
538
|
-
}
|
|
539
521
|
}
|
|
540
522
|
return {
|
|
541
523
|
messageSection,
|
|
@@ -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" | "zeni_credit_promo_card", "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" | "treasury_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" | "zeni_credit_promo_card" | 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" | "treasury_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" | "zeni_credit_promo_card" | 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" | "treasury_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<{
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchMonthClosePerformanceTrend, updateMonthClosePerformanceTrend, updateMonthClosePerformanceTrendFetchStatus } from '../monthEndCloseChecksViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchMonthClosePerformanceTrend> | ReturnType<typeof updateMonthClosePerformanceTrendFetchStatus> | ReturnType<typeof updateMonthClosePerformanceTrend>;
|
|
7
|
+
export declare const fetchMonthClosePerformanceTrendEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchMonthClosePerformanceTrendEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const monthEndCloseChecksViewReducer_1 = require("../monthEndCloseChecksViewReducer");
|
|
8
|
+
const fetchMonthClosePerformanceTrendEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(monthEndCloseChecksViewReducer_1.fetchMonthClosePerformanceTrend.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
+
const { period } = action.payload;
|
|
10
|
+
const month = String(period.month).padStart(2, '0');
|
|
11
|
+
const queryParam = {
|
|
12
|
+
month_and_year: `${month}-${period.year}`,
|
|
13
|
+
};
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/month-close/performance-trend?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
if (response.data != null) {
|
|
18
|
+
const actions = [
|
|
19
|
+
(0, monthEndCloseChecksViewReducer_1.updateMonthClosePerformanceTrend)({
|
|
20
|
+
performanceTrend: response.data.performance_trend,
|
|
21
|
+
period,
|
|
22
|
+
}),
|
|
23
|
+
];
|
|
24
|
+
return (0, rxjs_1.from)(actions);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const actions = [
|
|
28
|
+
(0, monthEndCloseChecksViewReducer_1.updateMonthClosePerformanceTrendFetchStatus)({
|
|
29
|
+
period,
|
|
30
|
+
fetchState: 'Error',
|
|
31
|
+
error: response.status,
|
|
32
|
+
}),
|
|
33
|
+
];
|
|
34
|
+
return (0, rxjs_1.from)(actions);
|
|
35
|
+
}
|
|
36
|
+
}), (0, operators_1.catchError)((error) => {
|
|
37
|
+
const actions = [
|
|
38
|
+
(0, monthEndCloseChecksViewReducer_1.updateMonthClosePerformanceTrendFetchStatus)({
|
|
39
|
+
period,
|
|
40
|
+
fetchState: 'Error',
|
|
41
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `Fetch Month close performance trend REST API call errored out: ${JSON.stringify(error)}`),
|
|
42
|
+
}),
|
|
43
|
+
];
|
|
44
|
+
return (0, rxjs_1.from)(actions);
|
|
45
|
+
}));
|
|
46
|
+
}));
|
|
47
|
+
exports.fetchMonthClosePerformanceTrendEpic = fetchMonthClosePerformanceTrendEpic;
|
|
@@ -8,7 +8,7 @@ const responsePayload_1 = require("../../../responsePayload");
|
|
|
8
8
|
const monthEndCloseChecksViewReducer_1 = require("../monthEndCloseChecksViewReducer");
|
|
9
9
|
const fetchMonthEndCloseChecksEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks.match), (0, operators_1.switchMap)((action) => {
|
|
10
10
|
const { period, tenantId, refreshViewInBackground } = action.payload;
|
|
11
|
-
const month = period.month
|
|
11
|
+
const month = String(period.month).padStart(2, '0');
|
|
12
12
|
const queryParam = {
|
|
13
13
|
month_and_year: `${month}-${period.year}`,
|
|
14
14
|
history_month_and_year_flag: true,
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { MonthEndCloseChecksPayload } from '../../entity/monthEndCloseChecks/monthEndCloseChecksPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
3
|
export type FetchMonthEndCloseChecksResponse = ZeniAPIResponse<MonthEndCloseChecksPayload>;
|
|
4
|
+
export type MonthClosePerformanceTrendPayload = {
|
|
5
|
+
audit_score_percentage: number;
|
|
6
|
+
month_and_year: string;
|
|
7
|
+
};
|
|
8
|
+
export interface MonthClosePerformanceTrendResponsePayload {
|
|
9
|
+
performance_trend: MonthClosePerformanceTrendPayload[];
|
|
10
|
+
}
|
|
11
|
+
export type FetchMonthClosePerformanceTrendResponse = ZeniAPIResponse<MonthClosePerformanceTrendResponsePayload>;
|