@zeniai/client-epic-state 4.18.86 → 4.18.87
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/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/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -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 +12 -0
- 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/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.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +13 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +6 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +6 -3
- 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 +2 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +13 -6
- 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/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
|
@@ -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': {
|
|
@@ -4,6 +4,6 @@ import { removeTransactionCategorization } from '../../../../entity/transaction/
|
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
5
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
6
|
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
7
|
-
import { markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateTotalCountForTransactionCategorization } from '../../reducers/transactionsViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdateForCategorization> | ReturnType<typeof updateTotalCountForTransactionCategorization>;
|
|
7
|
+
import { fetchTransactionCategorizationView, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateTotalCountForTransactionCategorization } from '../../reducers/transactionsViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof removeTransactionCategorization> | ReturnType<typeof openSnackbar> | ReturnType<typeof markTransactionAsNotMiscategorized> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateStatusForTransactionNotMiscategorizedUpdateForCategorization> | ReturnType<typeof updateTotalCountForTransactionCategorization> | ReturnType<typeof fetchTransactionCategorizationView>;
|
|
9
9
|
export declare const markTransactionAsNotMiscategorizedEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -13,12 +13,11 @@ const transactionCategorizationLocalDataHelper_1 = require("../../helpers/transa
|
|
|
13
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
14
|
const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
16
|
-
const transactionsInReview = action.payload
|
|
16
|
+
const { transactionsInReview, selectedTab, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
17
17
|
const transactionsSuccess = transactionsInReview.transactions_update_success;
|
|
18
18
|
const transactionsFailed = transactionsInReview.transactions_update_failed;
|
|
19
19
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
20
20
|
const selectedPeriod = expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
21
|
-
const { selectedTab } = action.payload;
|
|
22
21
|
const otherTab = selectedTab === 'review' ? 'autoCategorized' : 'review';
|
|
23
22
|
const currentTabViewState = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
24
23
|
const otherTabViewState = expenseAutomationTransactionsViewState.transactionCategorizationView[otherTab];
|
|
@@ -102,6 +101,18 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
102
101
|
transactionIds: transactionsToRemoveFromEntity,
|
|
103
102
|
}));
|
|
104
103
|
}
|
|
104
|
+
// refetch review tab refresh fetch state to let it auto refresh
|
|
105
|
+
if (selectedTab === 'autoCategorized' &&
|
|
106
|
+
Object.keys(failedLineItemsByTransactionId).length > 0) {
|
|
107
|
+
const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
|
|
108
|
+
const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
|
|
109
|
+
const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
|
|
110
|
+
if (timePeriodStart != null && timePeriodEnd != null) {
|
|
111
|
+
actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)('review', { start: timePeriodStart, end: timePeriodEnd }, true, // cacheOverride = true to force refresh
|
|
112
|
+
false, undefined, undefined, true, // refreshViewInBackground
|
|
113
|
+
false, isUncategorizedExpenseCategoryEnabled));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
105
116
|
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
106
117
|
selectedPeriod,
|
|
107
118
|
selectedTab,
|
|
@@ -12,7 +12,7 @@ const accountListSelector_1 = require("../../../accountList/accountListSelector"
|
|
|
12
12
|
const saveTransactionHelper_1 = require("../../helpers/saveTransactionHelper");
|
|
13
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
14
|
const saveTransactionCategorizationEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.saveTransactionCategorization.match), (0, operators_1.mergeMap)((action) => {
|
|
15
|
-
const { transactionIds, cotTrackingByTransactionId, selectedTab } = action.payload;
|
|
15
|
+
const { transactionIds, cotTrackingByTransactionId, selectedTab, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
16
16
|
const fetchActions = [];
|
|
17
17
|
const { transactionState, expenseAutomationTransactionsViewState } = state$.value;
|
|
18
18
|
const transactionSaveUpdates = [];
|
|
@@ -25,7 +25,7 @@ const saveTransactionCategorizationEpic = (actions$, state$) => actions$.pipe((0
|
|
|
25
25
|
transactionSaveUpdates.push((0, saveTransactionHelper_1.toTransactionUpdatesFromTransactionCategorizationLocalData)(localData, transaction, uncategorizedIncomeExpense));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
fetchActions.push((0, transactionsViewReducer_1.updateTransactionCategorization)(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId));
|
|
28
|
+
fetchActions.push((0, transactionsViewReducer_1.updateTransactionCategorization)(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled));
|
|
29
29
|
return (0, rxjs_1.from)(fetchActions);
|
|
30
30
|
}));
|
|
31
31
|
exports.saveTransactionCategorizationEpic = saveTransactionCategorizationEpic;
|
|
@@ -21,7 +21,7 @@ const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
|
21
21
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
22
22
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
23
23
|
const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.updateTransactionCategorization.match), (0, operators_1.mergeMap)((action) => {
|
|
24
|
-
const { selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, } = action.payload;
|
|
24
|
+
const { selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
25
25
|
const { transactionState, vendorState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
26
26
|
const payloadArray = preparePayload(selectedTab, transactionState, vendorState, expenseAutomationTransactionsViewState, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId).filter((payload) => payload != null);
|
|
27
27
|
return zeniAPI
|
|
@@ -30,7 +30,7 @@ const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actio
|
|
|
30
30
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
31
31
|
const transactionsInReview = response.data;
|
|
32
32
|
const actions = [];
|
|
33
|
-
actions.push((0, transactionsViewReducer_1.markTransactionAsNotMiscategorized)(selectedTab, transactionsInReview), (0, transactionsViewReducer_1.updateTransactionCategorizationSaveStatus)(selectedTab, 'Completed', (0, responsePayload_1.createZeniAPIStatus)('Completed', 'Transaction categorization updated successfully')));
|
|
33
|
+
actions.push((0, transactionsViewReducer_1.markTransactionAsNotMiscategorized)(selectedTab, transactionsInReview, isUncategorizedExpenseCategoryEnabled), (0, transactionsViewReducer_1.updateTransactionCategorizationSaveStatus)(selectedTab, 'Completed', (0, responsePayload_1.createZeniAPIStatus)('Completed', 'Transaction categorization updated successfully')));
|
|
34
34
|
return (0, rxjs_1.from)(actions);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
@@ -51,24 +51,27 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
51
51
|
selectedPeriod: MonthYearPeriod;
|
|
52
52
|
selectedTab: TransactionsTab;
|
|
53
53
|
status: ZeniAPIStatus;
|
|
54
|
-
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId], {
|
|
54
|
+
}, "expenseAutomationTransactionsView/fetchTransactionCategorizationFailure">, saveTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
55
55
|
selectedTab: "review" | "autoCategorized";
|
|
56
56
|
transactionIds: string[];
|
|
57
57
|
cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
|
|
58
|
-
|
|
58
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
59
|
+
}, "expenseAutomationTransactionsView/saveTransactionCategorization", never, never>, updateTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionIds: string[], transactionSaveUpdates: TransactionSaveUpdates[], cotTrackingByTransactionId: COTTransactionTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
59
60
|
selectedTab: "review" | "autoCategorized";
|
|
60
61
|
transactionIds: string[];
|
|
61
62
|
transactionSaveUpdates: TransactionSaveUpdates[];
|
|
62
63
|
cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
|
|
64
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
63
65
|
}, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
|
|
64
66
|
newSelectedTab: "review" | "autoCategorized";
|
|
65
67
|
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
66
68
|
selectedTab: "review" | "autoCategorized";
|
|
67
69
|
fetchState: FetchState;
|
|
68
70
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
69
|
-
}, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload], {
|
|
71
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionsInReview: UpdateTransactionCategorizationResponsePayload, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
70
72
|
selectedTab: "review" | "autoCategorized";
|
|
71
73
|
transactionsInReview: UpdateTransactionCategorizationResponsePayload;
|
|
74
|
+
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
72
75
|
}, "expenseAutomationTransactionsView/markTransactionAsNotMiscategorized", never, never>, updateStatusForTransactionNotMiscategorizedUpdateForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", uncheckTransactionIds: string[], removeTransactionIdsFromSelectedPeriod: string[], selectedPeriod: MonthYearPeriod, fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined, updateLineItemsByTransactionId?: Record<string, string[]> | undefined], {
|
|
73
76
|
removeTransactionIdsFromSelectedPeriod: string[];
|
|
74
77
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -228,12 +228,13 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
saveTransactionCategorization: {
|
|
231
|
-
prepare(selectedTab, transactionIds, cotTrackingByTransactionId) {
|
|
231
|
+
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
232
232
|
return {
|
|
233
233
|
payload: {
|
|
234
234
|
selectedTab,
|
|
235
235
|
transactionIds,
|
|
236
236
|
cotTrackingByTransactionId,
|
|
237
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
237
238
|
},
|
|
238
239
|
};
|
|
239
240
|
},
|
|
@@ -258,13 +259,14 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
258
259
|
fetchState: 'In-Progress',
|
|
259
260
|
};
|
|
260
261
|
},
|
|
261
|
-
prepare(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId) {
|
|
262
|
+
prepare(selectedTab, transactionIds, transactionSaveUpdates, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
262
263
|
return {
|
|
263
264
|
payload: {
|
|
264
265
|
selectedTab,
|
|
265
266
|
transactionIds,
|
|
266
267
|
transactionSaveUpdates,
|
|
267
268
|
cotTrackingByTransactionId,
|
|
269
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
268
270
|
},
|
|
269
271
|
};
|
|
270
272
|
},
|
|
@@ -535,11 +537,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
535
537
|
error: undefined,
|
|
536
538
|
};
|
|
537
539
|
},
|
|
538
|
-
prepare(selectedTab, transactionsInReview) {
|
|
540
|
+
prepare(selectedTab, transactionsInReview, isUncategorizedExpenseCategoryEnabled) {
|
|
539
541
|
return {
|
|
540
542
|
payload: {
|
|
541
543
|
selectedTab,
|
|
542
544
|
transactionsInReview,
|
|
545
|
+
isUncategorizedExpenseCategoryEnabled,
|
|
543
546
|
},
|
|
544
547
|
};
|
|
545
548
|
},
|
|
@@ -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>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FetchState, ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
|
|
3
3
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { MonthClosePerformanceTrendPayload } from './monthEndCloseChecksViewPayload';
|
|
4
5
|
import { MonthEndCloseChecksViewState } from './monthEndCloseChecksViewState';
|
|
5
6
|
export declare const initialState: MonthEndCloseChecksViewState;
|
|
6
7
|
export declare const fetchMonthEndCloseChecks: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -13,6 +14,15 @@ export declare const fetchMonthEndCloseChecks: import("@reduxjs/toolkit").Action
|
|
|
13
14
|
refreshViewInBackground: boolean;
|
|
14
15
|
tenantId: ID;
|
|
15
16
|
error?: ZeniAPIStatus;
|
|
16
|
-
}, "monthEndCloseChecksView/updateMonthEndCloseChecksView">, clearAllMonthEndCloseChecksView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"monthEndCloseChecksView/clearAllMonthEndCloseChecksView"
|
|
17
|
+
}, "monthEndCloseChecksView/updateMonthEndCloseChecksView">, clearAllMonthEndCloseChecksView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"monthEndCloseChecksView/clearAllMonthEndCloseChecksView">, fetchMonthClosePerformanceTrend: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: MonthYearPeriod], {
|
|
18
|
+
period: MonthYearPeriod;
|
|
19
|
+
}, "monthEndCloseChecksView/fetchMonthClosePerformanceTrend", never, never>, updateMonthClosePerformanceTrend: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
performanceTrend: MonthClosePerformanceTrendPayload[];
|
|
21
|
+
period: MonthYearPeriod;
|
|
22
|
+
}, "monthEndCloseChecksView/updateMonthClosePerformanceTrend">, updateMonthClosePerformanceTrendFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
23
|
+
fetchState: FetchState;
|
|
24
|
+
period: MonthYearPeriod;
|
|
25
|
+
error?: ZeniAPIStatus;
|
|
26
|
+
}, "monthEndCloseChecksView/updateMonthClosePerformanceTrendFetchStatus">;
|
|
17
27
|
declare const _default: import("redux").Reducer<MonthEndCloseChecksViewState>;
|
|
18
28
|
export default _default;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllMonthEndCloseChecksView = exports.updateMonthEndCloseChecksView = exports.fetchMonthEndCloseChecks = exports.initialState = void 0;
|
|
4
|
+
exports.updateMonthClosePerformanceTrendFetchStatus = exports.updateMonthClosePerformanceTrend = exports.fetchMonthClosePerformanceTrend = exports.clearAllMonthEndCloseChecksView = exports.updateMonthEndCloseChecksView = exports.fetchMonthEndCloseChecks = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
6
7
|
const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
8
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
9
|
exports.initialState = {
|
|
8
10
|
monthEndCloseChecksViewByTenantId: {},
|
|
9
11
|
refreshStatus: {
|
|
10
12
|
fetchState: 'Not-Started',
|
|
11
13
|
},
|
|
14
|
+
monthClosePerformanceTrend: {},
|
|
15
|
+
monthClosePerformanceTrendFetchStatus: {},
|
|
12
16
|
};
|
|
13
17
|
const monthEndCloseChecksView = (0, toolkit_1.createSlice)({
|
|
14
18
|
name: 'monthEndCloseChecksView',
|
|
@@ -40,10 +44,50 @@ const monthEndCloseChecksView = (0, toolkit_1.createSlice)({
|
|
|
40
44
|
draft.refreshStatus.fetchState = 'Completed';
|
|
41
45
|
}
|
|
42
46
|
},
|
|
47
|
+
fetchMonthClosePerformanceTrend: {
|
|
48
|
+
prepare(period) {
|
|
49
|
+
return { payload: { period } };
|
|
50
|
+
},
|
|
51
|
+
reducer(draft, action) {
|
|
52
|
+
const { period } = action.payload;
|
|
53
|
+
draft.monthClosePerformanceTrendFetchStatus[(0, timePeriod_1.toMonthYearPeriodId)(period)] = {
|
|
54
|
+
fetchState: 'In-Progress',
|
|
55
|
+
error: undefined,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
updateMonthClosePerformanceTrend(draft, action) {
|
|
60
|
+
const { performanceTrend, period } = action.payload;
|
|
61
|
+
draft.monthClosePerformanceTrend[(0, timePeriod_1.toMonthYearPeriodId)(period)] = [];
|
|
62
|
+
performanceTrend.forEach((curr) => {
|
|
63
|
+
const parsedDate = (0, zeniDayJS_1.date)(curr.month_and_year, formatZeniDateFY_1.MM_YYYY_FORMAT);
|
|
64
|
+
const parsedPeriod = {
|
|
65
|
+
month: (0, timePeriod_1.toMonth)(parsedDate.month() + 1),
|
|
66
|
+
year: parsedDate.year(),
|
|
67
|
+
};
|
|
68
|
+
draft.monthClosePerformanceTrend[(0, timePeriod_1.toMonthYearPeriodId)(period)].push({
|
|
69
|
+
auditScore: curr.audit_score_percentage,
|
|
70
|
+
period: parsedPeriod,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
draft.monthClosePerformanceTrendFetchStatus[(0, timePeriod_1.toMonthYearPeriodId)(period)] =
|
|
74
|
+
{
|
|
75
|
+
fetchState: 'Completed',
|
|
76
|
+
error: undefined,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
updateMonthClosePerformanceTrendFetchStatus(draft, action) {
|
|
80
|
+
const { period, fetchState, error } = action.payload;
|
|
81
|
+
draft.monthClosePerformanceTrendFetchStatus[(0, timePeriod_1.toMonthYearPeriodId)(period)] =
|
|
82
|
+
{
|
|
83
|
+
fetchState,
|
|
84
|
+
error,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
43
87
|
clearAllMonthEndCloseChecksView(draft) {
|
|
44
|
-
draft.
|
|
88
|
+
Object.assign(draft, exports.initialState);
|
|
45
89
|
},
|
|
46
90
|
},
|
|
47
91
|
});
|
|
48
|
-
_a = monthEndCloseChecksView.actions, exports.fetchMonthEndCloseChecks = _a.fetchMonthEndCloseChecks, exports.updateMonthEndCloseChecksView = _a.updateMonthEndCloseChecksView, exports.clearAllMonthEndCloseChecksView = _a.clearAllMonthEndCloseChecksView;
|
|
92
|
+
_a = monthEndCloseChecksView.actions, exports.fetchMonthEndCloseChecks = _a.fetchMonthEndCloseChecks, exports.updateMonthEndCloseChecksView = _a.updateMonthEndCloseChecksView, exports.clearAllMonthEndCloseChecksView = _a.clearAllMonthEndCloseChecksView, exports.fetchMonthClosePerformanceTrend = _a.fetchMonthClosePerformanceTrend, exports.updateMonthClosePerformanceTrend = _a.updateMonthClosePerformanceTrend, exports.updateMonthClosePerformanceTrendFetchStatus = _a.updateMonthClosePerformanceTrendFetchStatus;
|
|
49
93
|
exports.default = monthEndCloseChecksView.reducer;
|