@zeniai/client-epic-state 4.20.4 → 4.20.6
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/coaBalance/additionalBalances/getSummationBalance.d.ts +1 -1
- package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +0 -2
- package/lib/commonStateTypes/coaBalance/coaBalanceType.js +0 -6
- package/lib/commonStateTypes/currencyHelper.d.ts +0 -3
- package/lib/commonStateTypes/currencyHelper.js +1 -6
- package/lib/commonStateTypes/reduceFetchState.d.ts +0 -9
- package/lib/commonStateTypes/reduceFetchState.js +0 -26
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountPayload.js +0 -2
- package/lib/entity/account/accountState.d.ts +0 -2
- package/lib/entity/customer/customerState.d.ts +2 -0
- package/lib/entity/customer/customerState.js +5 -0
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +1 -8
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +0 -2
- package/lib/entity/reimbursement/reimbursementPayload.js +0 -7
- package/lib/entity/reimbursement/reimbursementState.d.ts +0 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/task/taskPayload.d.ts +0 -1
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +0 -1
- package/lib/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +0 -5
- package/lib/esm/commonStateTypes/currencyHelper.js +0 -5
- package/lib/esm/commonStateTypes/reduceFetchState.js +0 -25
- package/lib/esm/entity/account/accountPayload.js +0 -2
- package/lib/esm/entity/customer/customerState.js +4 -1
- package/lib/esm/entity/depositAccount/depositAccount.js +1 -8
- package/lib/esm/entity/reimbursement/reimbursementPayload.js +0 -7
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/entity/task/taskPayload.js +0 -1
- package/lib/esm/epic.js +1 -12
- package/lib/esm/index.js +10 -19
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
- package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -189
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -433
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -23
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -244
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -44
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/esm/view/financeStatement/financeStatementReducer.js +8 -11
- package/lib/esm/view/financeStatement/financeStatementSelector.js +9 -24
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
- package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
- package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +7 -9
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +1 -3
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
- package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +0 -11
- package/lib/esm/zeniAPI.js +2 -0
- package/lib/index.d.ts +12 -20
- package/lib/index.js +34 -94
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -118
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -201
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -76
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -434
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -24
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -243
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -142
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -54
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/view/financeStatement/financeStatementReducer.js +8 -11
- package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
- package/lib/view/financeStatement/financeStatementSelector.js +9 -24
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +2 -4
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +2 -7
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +0 -4
- package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
- package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +6 -8
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +0 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +0 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +1 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +1 -3
- package/lib/view/userListView/fetchUserListByTypeEpic.js +0 -11
- package/lib/view/userListView/userListViewPayload.d.ts +0 -2
- package/lib/zeniAPI.js +2 -0
- package/package.json +3 -3
- package/lib/entity/userGroups/userGroupsPayload.d.ts +0 -7
- package/lib/entity/userGroups/userGroupsPayload.js +0 -10
- package/lib/entity/userGroups/userGroupsReducer.d.ts +0 -8
- package/lib/entity/userGroups/userGroupsReducer.js +0 -29
- package/lib/entity/userGroups/userGroupsSelector.d.ts +0 -4
- package/lib/entity/userGroups/userGroupsSelector.js +0 -12
- package/lib/entity/userGroups/userGroupsState.d.ts +0 -9
- package/lib/entity/userGroups/userGroupsState.js +0 -2
- package/lib/esm/entity/userGroups/userGroupsPayload.js +0 -7
- package/lib/esm/entity/userGroups/userGroupsReducer.js +0 -25
- package/lib/esm/entity/userGroups/userGroupsSelector.js +0 -8
- package/lib/esm/entity/userGroups/userGroupsState.js +0 -1
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -33
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -56
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -77
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
- package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +0 -17
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -331
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -9
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -262
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +0 -65
- package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +0 -16
- package/lib/esm/view/userGroupListView/userGroupListViewState.js +0 -1
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -18
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -33
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -37
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -61
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -81
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -25
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +0 -9
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +0 -20
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +0 -15
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -335
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +0 -111
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -13
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +0 -6
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -265
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +0 -23
- package/lib/view/userGroupListView/userGroupListViewReducer.js +0 -69
- package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +0 -7
- package/lib/view/userGroupListView/userGroupListViewSelector.js +0 -20
- package/lib/view/userGroupListView/userGroupListViewState.d.ts +0 -8
- package/lib/view/userGroupListView/userGroupListViewState.js +0 -2
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFinanceStatement = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const coaBalanceType_1 = require("../../commonStateTypes/coaBalance/coaBalanceType");
|
|
6
5
|
const coaBalancesFilter_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilter");
|
|
7
6
|
const coaBalancesFilterClassesView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterClassesView");
|
|
8
7
|
const dataAvailable_1 = require("../../commonStateTypes/dataAvailable");
|
|
@@ -12,7 +11,6 @@ const thisPeriodHelpers_1 = require("../../commonStateTypes/viewAndReport/thisPe
|
|
|
12
11
|
const balanceSheetSelector_1 = require("../balanceSheet/balanceSheetSelector");
|
|
13
12
|
const cashFlowSelector_1 = require("../cashFlow/cashFlowSelector");
|
|
14
13
|
const profitAndLossSelector_1 = require("../profitAndLoss/profitAndLossSelector");
|
|
15
|
-
const profitAndLossClassesByClassHorizontalSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector");
|
|
16
14
|
const profitAndLossClassesViewSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesViewSelector");
|
|
17
15
|
function getDateRangeForFinanceReports(profitAndLossState, balanceSheetState, cashFlowState) {
|
|
18
16
|
const datesSorted = [
|
|
@@ -47,11 +45,11 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
47
45
|
if (dataAvailable != null) {
|
|
48
46
|
const noFilter = (0, coaBalancesFilter_1.newBalancesFilterForDateRange)(firstMonthOfFY, financeStatementState.timeframe, dataAvailable, 'ascending_date', []);
|
|
49
47
|
const profitAndLossForTimeframeTicks = (0, profitAndLossSelector_1.getProfitAndLossReport)(noFilter, undefined, accountState, accountGroupState, sectionAccountsViewState, profitAndLossState, forecastState);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
if (profitAndLossForTimeframeTicks.sections.expenses != null) {
|
|
49
|
+
balancesInTimeframe =
|
|
50
|
+
profitAndLossForTimeframeTicks.sections.expenses.balances.length > 0
|
|
51
|
+
? profitAndLossForTimeframeTicks.sections['expenses'].balances
|
|
52
|
+
: profitAndLossForTimeframeTicks.sections['income'].balances;
|
|
55
53
|
allTimeframeTicks = balancesInTimeframe.map((balance) => (0, timeframeTick_1.toTimeframeTick)(balance));
|
|
56
54
|
}
|
|
57
55
|
}
|
|
@@ -59,22 +57,12 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
59
57
|
if (thisPeriod == null && balancesInTimeframe.length > 0) {
|
|
60
58
|
thisPeriod = (0, timeframeTick_1.toTimeframeTick)(balancesInTimeframe[balancesInTimeframe.length - 1]);
|
|
61
59
|
}
|
|
62
|
-
const
|
|
60
|
+
const filter = (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, financeStatementState.timeframe, Math.min((0, dataAvailable_1.getNumberOfPeriods)(firstMonthOfFY, financeStatementState.timeframe, dataAvailable) ?? financeStatementState.selectedCOABalancesRange.numberOfPeriods, financeStatementState.selectedCOABalancesRange.numberOfPeriods), thisPeriod, 'ascending_date', financeStatementState.isAdditionalBalancesShown === true
|
|
63
61
|
? financeStatementState.selectedAdditionalBalances
|
|
64
|
-
: [];
|
|
65
|
-
const useHorizontalClassesLayout = profitAndLossClassesViewState.uiState.classViewLayout ===
|
|
66
|
-
'horizontal' &&
|
|
67
|
-
financeStatementState.selectedReportId === 'profit_and_loss_by_classes';
|
|
68
|
-
const additionalBalancesForFilter = useHorizontalClassesLayout
|
|
69
|
-
? (0, coaBalanceType_1.stripCompareAdditionalBalanceTypes)(rawAdditionalBalances)
|
|
70
|
-
: rawAdditionalBalances;
|
|
71
|
-
const filter = (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, financeStatementState.timeframe, Math.min((0, dataAvailable_1.getNumberOfPeriods)(firstMonthOfFY, financeStatementState.timeframe, dataAvailable) ?? financeStatementState.selectedCOABalancesRange.numberOfPeriods, financeStatementState.selectedCOABalancesRange.numberOfPeriods), thisPeriod, 'ascending_date', additionalBalancesForFilter);
|
|
62
|
+
: []);
|
|
72
63
|
const profitAndLossReport = (0, profitAndLossSelector_1.getProfitAndLossReport)(filter, undefined, accountState, accountGroupState, sectionAccountsViewState, profitAndLossState, forecastState);
|
|
73
64
|
const classFilter = (0, coaBalancesFilterClassesView_1.newBalancesFilterClassesView)(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossClassesViewState.uiState.classesToFilterOut);
|
|
74
65
|
const profitAndLossByClassReport = (0, profitAndLossClassesViewSelector_1.getProfitAndLossClassesView)(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState);
|
|
75
|
-
const profitAndLossByClassHorizontalReport = (0, profitAndLossClassesByClassHorizontalSelector_1.getProfitAndLossClassesHorizontalView)(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState, profitAndLossClassesViewState.uiState.classViewLayout === 'horizontal'
|
|
76
|
-
? thisPeriod
|
|
77
|
-
: undefined);
|
|
78
66
|
const balanceSheetReport = (0, balanceSheetSelector_1.getBalanceSheet)(filter, accountState, accountGroupState, sectionAccountsViewState, balanceSheetState);
|
|
79
67
|
const cashFlowReport = (0, cashFlowSelector_1.getCashFlow)(filter, accountState, accountGroupState, sectionAccountsViewState, cashFlowState);
|
|
80
68
|
const allReports = [
|
|
@@ -122,15 +110,12 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
122
110
|
dataAvailable,
|
|
123
111
|
profitAndLossReport,
|
|
124
112
|
profitAndLossByClassReport,
|
|
125
|
-
profitAndLossByClassHorizontalReport,
|
|
126
113
|
balanceSheetReport,
|
|
127
114
|
cashFlowReport,
|
|
128
115
|
filter,
|
|
129
116
|
selectedReportId: financeStatementState.selectedReportId,
|
|
130
117
|
downloadState: financeStatementState.downloadState,
|
|
131
|
-
isCompareModeOn:
|
|
132
|
-
|
|
133
|
-
: financeStatementState.selectedAdditionalBalances.includes('this_period_vs_last_period') ||
|
|
134
|
-
financeStatementState.selectedAdditionalBalances.includes('this_period_vs_last_period_percent'),
|
|
118
|
+
isCompareModeOn: financeStatementState.selectedAdditionalBalances.includes('this_period_vs_last_period') ||
|
|
119
|
+
financeStatementState.selectedAdditionalBalances.includes('this_period_vs_last_period_percent'),
|
|
135
120
|
};
|
|
136
121
|
});
|
|
@@ -2,7 +2,7 @@ import { NestedClassID } from '../../commonStateTypes/classesView/nestedClassID'
|
|
|
2
2
|
import { AccountViewMode, ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { ZeniAPIStatus, ZeniReportData } from '../../responsePayload';
|
|
4
4
|
import { ProfitAndLossClassesViewPayload } from './profitAndLossClassesViewPayload';
|
|
5
|
-
import {
|
|
5
|
+
import { ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
|
|
6
6
|
export declare const initialState: ProfitAndLossClassesViewState;
|
|
7
7
|
export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
8
8
|
cacheOverride: boolean;
|
|
@@ -30,8 +30,6 @@ export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").A
|
|
|
30
30
|
};
|
|
31
31
|
}, "profitAndLossClassesView/updateProfitAndLossClassesViewUIState">, updateAccountViewMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
32
|
viewMode: AccountViewMode;
|
|
33
|
-
}, "profitAndLossClassesView/updateAccountViewMode">,
|
|
34
|
-
classViewLayout: ClassViewLayout;
|
|
35
|
-
}, "profitAndLossClassesView/updateClassViewLayout">, resetProfitAndLossClassesNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/resetProfitAndLossClassesNodeCollapseState">, clearProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/clearProfitAndLossClassesView">;
|
|
33
|
+
}, "profitAndLossClassesView/updateAccountViewMode">, resetProfitAndLossClassesNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/resetProfitAndLossClassesNodeCollapseState">, clearProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/clearProfitAndLossClassesView">;
|
|
36
34
|
declare const _default: import("redux").Reducer<ProfitAndLossClassesViewState>;
|
|
37
35
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.
|
|
4
|
+
exports.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.updateClassesToFilterOut = exports.updateProfitAndLossForTimeframeClassesViewFailure = exports.updateProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossClassesView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
7
|
const getNestedClassIDHierarchyForReport_1 = require("../../commonStateTypes/classesView/getNestedClassIDHierarchyForReport");
|
|
@@ -27,7 +27,6 @@ exports.initialState = {
|
|
|
27
27
|
nodeCollapseState: {},
|
|
28
28
|
scrollPosition: undefined,
|
|
29
29
|
accountViewMode: 'account_group',
|
|
30
|
-
classViewLayout: 'vertical',
|
|
31
30
|
classesToFilterOut: [],
|
|
32
31
|
},
|
|
33
32
|
firstMonthOfFY: 1,
|
|
@@ -99,9 +98,6 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
99
98
|
updateAccountViewMode(draft, action) {
|
|
100
99
|
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
101
100
|
},
|
|
102
|
-
updateClassViewLayout(draft, action) {
|
|
103
|
-
draft.uiState.classViewLayout = action.payload.classViewLayout;
|
|
104
|
-
},
|
|
105
101
|
resetProfitAndLossClassesNodeCollapseState(draft) {
|
|
106
102
|
draft.uiState.nodeCollapseState = {};
|
|
107
103
|
},
|
|
@@ -110,11 +106,10 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
110
106
|
},
|
|
111
107
|
},
|
|
112
108
|
});
|
|
113
|
-
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.
|
|
109
|
+
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.resetProfitAndLossClassesNodeCollapseState = _a.resetProfitAndLossClassesNodeCollapseState, exports.clearProfitAndLossClassesView = _a.clearProfitAndLossClassesView;
|
|
114
110
|
exports.default = profitAndLossClassesView.reducer;
|
|
115
111
|
const doUpdatedProfitAndLossClassesView = (draft, timeframe, pandLReport) => {
|
|
116
112
|
const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(pandLReport.report);
|
|
117
|
-
draft.currency = report.currency;
|
|
118
113
|
draft.dataAvailable = report.dataAvailable;
|
|
119
114
|
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
120
115
|
draft.bookCloseDate = report.bookCloseDate;
|
|
@@ -4,7 +4,6 @@ exports.getProfitAndLossClassesView = exports.profitAndLossIdsInOrder = void 0;
|
|
|
4
4
|
const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
|
|
5
5
|
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
6
6
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
7
|
-
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
8
7
|
const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
|
|
9
8
|
const profitAndLossClassesViewSelectorTypes_1 = require("./profitAndLossClassesViewSelectorTypes");
|
|
10
9
|
exports.profitAndLossIdsInOrder = [
|
|
@@ -19,7 +18,7 @@ exports.profitAndLossIdsInOrder = [
|
|
|
19
18
|
'netIncome',
|
|
20
19
|
];
|
|
21
20
|
const getProfitAndLossClassesView = (filter, accountState, classState, sectionsState, profitAndLossClassesViewState) => {
|
|
22
|
-
const fetchState = (
|
|
21
|
+
const fetchState = reduceFetchState([
|
|
23
22
|
profitAndLossClassesViewState.fetchState.month,
|
|
24
23
|
profitAndLossClassesViewState.fetchState.quarter,
|
|
25
24
|
profitAndLossClassesViewState.fetchState.year,
|
|
@@ -69,3 +68,31 @@ const getProfitAndLossClassesView = (filter, accountState, classState, sectionsS
|
|
|
69
68
|
};
|
|
70
69
|
};
|
|
71
70
|
exports.getProfitAndLossClassesView = getProfitAndLossClassesView;
|
|
71
|
+
function reduceFetchState(fetchStateList) {
|
|
72
|
+
const isAnyProgress = fetchStateList.reduce((prevValue, currentValue) => {
|
|
73
|
+
return prevValue === true || currentValue.fetchState === 'In-Progress';
|
|
74
|
+
}, false);
|
|
75
|
+
const isAllCompleted = fetchStateList.reduce((prevValue, currentValue) => {
|
|
76
|
+
return prevValue === true && currentValue.fetchState === 'Completed';
|
|
77
|
+
}, true);
|
|
78
|
+
const isAnyError = fetchStateList.reduce((prevValue, currentValue) => {
|
|
79
|
+
return prevValue === true || currentValue.fetchState === 'Error';
|
|
80
|
+
}, false);
|
|
81
|
+
const error = fetchStateList.reduce((prevValue, currentValue) => {
|
|
82
|
+
return prevValue ?? currentValue.error;
|
|
83
|
+
}, undefined);
|
|
84
|
+
let fetchState = 'Not-Started';
|
|
85
|
+
if (isAnyProgress) {
|
|
86
|
+
fetchState = 'In-Progress';
|
|
87
|
+
}
|
|
88
|
+
else if (isAllCompleted) {
|
|
89
|
+
fetchState = 'Completed';
|
|
90
|
+
}
|
|
91
|
+
else if (isAnyError) {
|
|
92
|
+
fetchState = 'Error';
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
fetchState,
|
|
96
|
+
error,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Currency } from '../../commonStateTypes/amount';
|
|
2
1
|
import { NestedClassHierarchyForReport, NestedClassID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
2
|
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
4
3
|
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
-
export type ClassViewLayout = 'vertical' | 'horizontal';
|
|
6
4
|
export interface ProfitAndLossClassesViewUIState {
|
|
7
5
|
accountViewMode: AccountViewMode;
|
|
8
6
|
classesToFilterOut: NestedClassID[];
|
|
9
|
-
classViewLayout: ClassViewLayout;
|
|
10
7
|
nodeCollapseState: Record<ID, boolean>;
|
|
11
8
|
scrollPosition: {
|
|
12
9
|
scrollTop: number;
|
|
@@ -21,5 +18,4 @@ export interface ProfitAndLossClassesViewState extends Report {
|
|
|
21
18
|
year: FetchStateAndError;
|
|
22
19
|
};
|
|
23
20
|
uiState: ProfitAndLossClassesViewUIState;
|
|
24
|
-
currency?: Currency;
|
|
25
21
|
}
|
|
@@ -27,13 +27,11 @@ const fetchProfitAndLossForTimeframeClassesViewEpic = (actions$, _, zeniAPI) =>
|
|
|
27
27
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
28
28
|
if (response.data != null && (0, responsePayload_1.isSuccessResponse)(response)) {
|
|
29
29
|
const actions = [];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
33
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
34
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
35
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherExpenses', 'profit_and_loss_by_classes', report.other_expenses, report.classes, report.accounts, currency));
|
|
36
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherIncome', 'profit_and_loss_by_classes', report.other_income, report.classes, report.accounts, currency));
|
|
30
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'cogs', 'profit_and_loss_by_classes', response.data.report.cogs, response.data.report.classes, response.data.report.accounts, response.data.report.currency));
|
|
31
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'expenses', 'profit_and_loss_by_classes', response.data.report.expenses, response.data.report.classes, response.data.report.accounts, response.data.report.currency));
|
|
32
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'income', 'profit_and_loss_by_classes', response.data.report.income, response.data.report.classes, response.data.report.accounts, response.data.report.currency));
|
|
33
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherExpenses', 'profit_and_loss_by_classes', response.data.report.other_expenses, response.data.report.classes, response.data.report.accounts, response.data.report.currency));
|
|
34
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherIncome', 'profit_and_loss_by_classes', response.data.report.other_income, response.data.report.classes, response.data.report.accounts, response.data.report.currency));
|
|
37
35
|
actions.push((0, profitAndLossClassesViewReducer_1.updateProfitAndLossForTimeframeClassesView)({
|
|
38
36
|
timeframe: action.payload.timeframe,
|
|
39
37
|
report: response.data,
|
|
@@ -11,13 +11,9 @@ const opExReducer_1 = require("../opEx/opExReducer");
|
|
|
11
11
|
const revenueReducer_1 = require("../revenue/revenueReducer");
|
|
12
12
|
const reportUIOptionsReducer_1 = require("./reportUIOptionsReducer");
|
|
13
13
|
const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(reportUIOptionsReducer_1.updateReportUIOptionCOABalancesRange.match), (0, operators_1.switchMap)((action) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const numberOfPeriodsFromSelection = selectedRange.numberOfPeriods;
|
|
18
|
-
const highlightedNoOfPeriods = state$.value.reportUIOptionsState.isCompareModeOn === true
|
|
19
|
-
? numberOfPeriodsFromSelection
|
|
20
|
-
: 1;
|
|
14
|
+
const thisPeriod = action.payload.selectedCOABalancesRange.thisPeriod;
|
|
15
|
+
const orderBy = action.payload.selectedCOABalancesRange.orderBy;
|
|
16
|
+
const highlightedNoOfPeriods = state$.value.reportUIOptionsState.isCompareModeOn === true ? 4 : 1;
|
|
21
17
|
const highlightedCOABalancesRange = action.payload.highlightedCOABalancesRange == null && thisPeriod != null
|
|
22
18
|
? {
|
|
23
19
|
numberOfPeriods: highlightedNoOfPeriods,
|
|
@@ -69,7 +65,9 @@ const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.
|
|
|
69
65
|
thisPeriod: action.payload.highlightedCOABalancesRange != null
|
|
70
66
|
? action.payload.highlightedCOABalancesRange.thisPeriod
|
|
71
67
|
: thisPeriod,
|
|
72
|
-
numberOfPeriods:
|
|
68
|
+
numberOfPeriods: state$.value.reportUIOptionsState.isCompareModeOn === true
|
|
69
|
+
? 4
|
|
70
|
+
: financeStatementReducer_1.initialFinanceStatementState.maxNumOfPeriodsToHighlight,
|
|
73
71
|
orderBy,
|
|
74
72
|
}));
|
|
75
73
|
}));
|
|
@@ -79,7 +79,6 @@ const toTaskPayload = (state, task) => {
|
|
|
79
79
|
name: task.name,
|
|
80
80
|
assignees: task.assignees,
|
|
81
81
|
description: task.description,
|
|
82
|
-
group_assignees: task.groupAssignees,
|
|
83
82
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
84
83
|
priority: task.priority.code,
|
|
85
84
|
status: task.status.code,
|
|
@@ -8,7 +8,6 @@ import { UserState } from '../../../entity/user/userState';
|
|
|
8
8
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
9
9
|
import { RootState } from '../../../reducer';
|
|
10
10
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
11
|
-
import { UserGroupListSelectorView } from '../../userGroupListView/userGroupListViewSelector';
|
|
12
11
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
13
12
|
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
14
13
|
export interface TaskWithUserDetails extends Task {
|
|
@@ -31,7 +30,6 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
31
30
|
taskGroupUpdateStatus: FetchStateAndError;
|
|
32
31
|
uiState: TaskListUIState;
|
|
33
32
|
updateTasksFetchState: FetchStateAndError;
|
|
34
|
-
userGroupList: UserGroupListSelectorView;
|
|
35
33
|
userList: UserListSelectorView;
|
|
36
34
|
}
|
|
37
35
|
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
@@ -17,7 +17,6 @@ const taskGroupTemplateSelector_1 = require("../../../entity/taskGroupTemplate/t
|
|
|
17
17
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
18
18
|
const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
19
19
|
const spendManagementFilterHelpers_1 = require("../../spendManagement/spendManagementFilterHelpers");
|
|
20
|
-
const userGroupListViewSelector_1 = require("../../userGroupListView/userGroupListViewSelector");
|
|
21
20
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
22
21
|
const taskDetailSelector_1 = require("../taskDetailView/taskDetailSelector");
|
|
23
22
|
const taskList_1 = require("./taskList");
|
|
@@ -317,7 +316,7 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
317
316
|
tagState,
|
|
318
317
|
});
|
|
319
318
|
};
|
|
320
|
-
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (
|
|
319
|
+
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, isTaskTemplatesEnabled) => {
|
|
321
320
|
const { localData } = taskListState;
|
|
322
321
|
const taskGroupsWithTasksList = getTaskGroupsWithTaskList({
|
|
323
322
|
taskListState,
|
|
@@ -345,7 +344,6 @@ exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListSta
|
|
|
345
344
|
taskGroupTemplates,
|
|
346
345
|
fetchState: fetchState,
|
|
347
346
|
userList: (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'taskManagerCandidate'),
|
|
348
|
-
userGroupList: (0, userGroupListViewSelector_1.getUserGroupList)(userGroupsState, userGroupListViewState, 'taskManagerCandidate'),
|
|
349
347
|
error: error,
|
|
350
348
|
version: 0,
|
|
351
349
|
taskGroupsWithTasksList,
|
|
@@ -10,4 +10,4 @@ import { resendOtpCardHolder, sendOtpCardHolderFailure, sendOtpCardHolderSuccess
|
|
|
10
10
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
11
11
|
import { resendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
12
12
|
export type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof resendOtpCardHolder> | ReturnType<typeof sendOtpCardHolderSuccess> | ReturnType<typeof sendOtpCardHolderFailure> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
13
|
-
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>,
|
|
13
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -11,11 +11,20 @@ const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/card
|
|
|
11
11
|
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
12
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
13
13
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
14
|
-
const resendOtpEpic = (actions$,
|
|
14
|
+
const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const resendOtpActions = [];
|
|
16
16
|
const { otpChallenge, twoFASource, entityId } = action.payload;
|
|
17
|
+
const chargeCard = twoFASource === 'ChargeCardHolder' && entityId != null
|
|
18
|
+
? state$.value.chargeCardState.chargeCardByID[entityId]
|
|
19
|
+
: null;
|
|
17
20
|
const payload = {
|
|
18
21
|
otp_challenge: otpChallenge,
|
|
22
|
+
...(chargeCard != null
|
|
23
|
+
? {
|
|
24
|
+
provider_card_id: chargeCard.cardProviderID,
|
|
25
|
+
is_for_charge_cards: true,
|
|
26
|
+
}
|
|
27
|
+
: {}),
|
|
19
28
|
};
|
|
20
29
|
switch (twoFASource) {
|
|
21
30
|
case 'SpendManagementSetup':
|
|
@@ -33,6 +42,11 @@ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operator
|
|
|
33
42
|
case 'CardUserOnboarding':
|
|
34
43
|
resendOtpActions.push((0, cardUserOnboardingReducer_1.resendOtpCardUserOnboarding)());
|
|
35
44
|
break;
|
|
45
|
+
case 'ChargeCardHolder':
|
|
46
|
+
if (entityId != null) {
|
|
47
|
+
resendOtpActions.push((0, chargeCardDetailReducer_1.resendOtpCardHolder)({ chargeCardId: entityId }));
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
36
50
|
}
|
|
37
51
|
const resendOtp$ = zeniAPI
|
|
38
52
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { updateAddresses } from '../../entity/address/addressReducer';
|
|
3
3
|
import { updateAllUsers } from '../../entity/user/userReducer';
|
|
4
|
-
import { updateAllUserGroups } from '../../entity/userGroups/userGroupsReducer';
|
|
5
4
|
import { updateUserRoles } from '../../entity/userRole/userRoleReducer';
|
|
6
5
|
import { RootState } from '../../reducer';
|
|
7
6
|
import { ZeniAPI } from '../../zeniAPI';
|
|
8
7
|
import { updateChargeCardCount, updateDebitCardCount } from '../spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer';
|
|
9
|
-
import { updateUserGroupIds } from '../userGroupListView/userGroupListViewReducer';
|
|
10
8
|
import { fetchUserListByType, updateUserIds, updateUserListFetchFailure } from './userListViewReducer';
|
|
11
|
-
export type ActionType = ReturnType<typeof fetchUserListByType> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateUserIds> | ReturnType<typeof updateChargeCardCount> | ReturnType<typeof updateDebitCardCount> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateUserListFetchFailure
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchUserListByType> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateUserIds> | ReturnType<typeof updateChargeCardCount> | ReturnType<typeof updateDebitCardCount> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateUserListFetchFailure>;
|
|
12
10
|
export declare const fetchUserListByTypeEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -6,11 +6,9 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const addressReducer_1 = require("../../entity/address/addressReducer");
|
|
7
7
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
8
8
|
const userReducer_1 = require("../../entity/user/userReducer");
|
|
9
|
-
const userGroupsReducer_1 = require("../../entity/userGroups/userGroupsReducer");
|
|
10
9
|
const userRoleReducer_1 = require("../../entity/userRole/userRoleReducer");
|
|
11
10
|
const responsePayload_1 = require("../../responsePayload");
|
|
12
11
|
const issueChargeCardReducer_1 = require("../spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer");
|
|
13
|
-
const userGroupListViewReducer_1 = require("../userGroupListView/userGroupListViewReducer");
|
|
14
12
|
const userListViewReducer_1 = require("./userListViewReducer");
|
|
15
13
|
const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(userListViewReducer_1.fetchUserListByType.match), (0, operators_1.mergeMap)((action) => {
|
|
16
14
|
const { userType, cacheOverride } = action.payload;
|
|
@@ -34,15 +32,6 @@ const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
34
32
|
usersPayload: response.data?.users ?? [],
|
|
35
33
|
}),
|
|
36
34
|
];
|
|
37
|
-
if (response.data?.user_groups != null) {
|
|
38
|
-
userListAction.push((0, userGroupsReducer_1.updateAllUserGroups)({ userGroups: response.data.user_groups }));
|
|
39
|
-
if (userType === 'taskManagerCandidate') {
|
|
40
|
-
userListAction.push((0, userGroupListViewReducer_1.updateUserGroupIds)({
|
|
41
|
-
userGroupType: userType,
|
|
42
|
-
userGroupsPayload: response.data.user_groups,
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
35
|
if (userType === 'cardHolderCandidate') {
|
|
47
36
|
userListAction.push((0, issueChargeCardReducer_1.updateChargeCardCount)(response.data?.cards_count_by_user_id ?? []));
|
|
48
37
|
userListAction.push((0, issueChargeCardReducer_1.updateDebitCardCount)(response.data?.debit_cards_count_by_deposit_account_id ?? {}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { AddressPayload } from '../../entity/address/addressPayload';
|
|
3
3
|
import { UserPayload } from '../../entity/user/userPayload';
|
|
4
|
-
import { UserGroupPayload } from '../../entity/userGroups/userGroupsPayload';
|
|
5
4
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
6
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
7
6
|
interface UserListResponsePayload {
|
|
@@ -10,7 +9,6 @@ interface UserListResponsePayload {
|
|
|
10
9
|
addresses?: AddressPayload[];
|
|
11
10
|
cards_count_by_user_id?: ActiveChargeCardCountPayload[];
|
|
12
11
|
debit_cards_count_by_deposit_account_id?: Record<ID, ActiveDebitCardCountByUserIdPayload>;
|
|
13
|
-
user_groups?: UserGroupPayload[];
|
|
14
12
|
}
|
|
15
13
|
export interface ActiveChargeCardCountPayload {
|
|
16
14
|
business_physical_credit_card_count: number;
|
package/lib/zeniAPI.js
CHANGED
|
@@ -82,6 +82,8 @@ class ZeniAPIClient {
|
|
|
82
82
|
return (0, rxjs_1.from)(promise);
|
|
83
83
|
}
|
|
84
84
|
postFormData(restEndPoint, formData, signal) {
|
|
85
|
+
// Use apiHeaders for auth headers, then remove Content-Type
|
|
86
|
+
// so the browser sets multipart/form-data with the correct boundary
|
|
85
87
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
86
88
|
const { 'Content-Type': _contentType, ...headers } = this.apiHeaders();
|
|
87
89
|
const promise = (0, cross_fetch_1.fetch)(restEndPoint, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.6",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"dayjs": "^1.10.7",
|
|
92
92
|
"dayjs-business-time": "^1.0.4",
|
|
93
93
|
"js-base64": "^3.6.0",
|
|
94
|
-
"lodash": "^4.
|
|
94
|
+
"lodash": "^4.17.23",
|
|
95
95
|
"pusher-js": "^8.4.0",
|
|
96
96
|
"redux": "^4.0.5",
|
|
97
97
|
"redux-observable": "^1.2.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"clean": "rimraf lib",
|
|
108
|
-
"test:typecheck": "echo 'Typechecking test files...' &&
|
|
108
|
+
"test:typecheck": "echo 'Typechecking test files...' && time tsc -p tsconfig.typecheck.json",
|
|
109
109
|
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
110
110
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
111
111
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapUserGroupPayloadToUserGroup = mapUserGroupPayloadToUserGroup;
|
|
4
|
-
function mapUserGroupPayloadToUserGroup(payload) {
|
|
5
|
-
return {
|
|
6
|
-
userGroupId: payload.id,
|
|
7
|
-
name: payload.name,
|
|
8
|
-
userIds: payload.user_ids ?? [],
|
|
9
|
-
};
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UserGroupPayload } from './userGroupsPayload';
|
|
2
|
-
import { UserGroupsState } from './userGroupsState';
|
|
3
|
-
export declare const initialState: UserGroupsState;
|
|
4
|
-
export declare const updateAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
5
|
-
userGroups: UserGroupPayload[];
|
|
6
|
-
}, "userGroups/updateAllUserGroups">, removeUserGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userGroups/removeUserGroup">, clearAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroups/clearAllUserGroups">;
|
|
7
|
-
declare const _default: import("redux").Reducer<UserGroupsState>;
|
|
8
|
-
export default _default;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllUserGroups = exports.removeUserGroup = exports.updateAllUserGroups = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const userGroupsPayload_1 = require("./userGroupsPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
userGroupByUserGroupId: {},
|
|
9
|
-
};
|
|
10
|
-
const userGroups = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: 'userGroups',
|
|
12
|
-
initialState: exports.initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateAllUserGroups(draft, action) {
|
|
15
|
-
action.payload.userGroups.forEach((payload) => {
|
|
16
|
-
const userGroup = (0, userGroupsPayload_1.mapUserGroupPayloadToUserGroup)(payload);
|
|
17
|
-
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
removeUserGroup(draft, action) {
|
|
21
|
-
delete draft.userGroupByUserGroupId[action.payload];
|
|
22
|
-
},
|
|
23
|
-
clearAllUserGroups(draft) {
|
|
24
|
-
Object.assign(draft, exports.initialState);
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
_a = userGroups.actions, exports.updateAllUserGroups = _a.updateAllUserGroups, exports.removeUserGroup = _a.removeUserGroup, exports.clearAllUserGroups = _a.clearAllUserGroups;
|
|
29
|
-
exports.default = userGroups.reducer;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { UserGroup, UserGroupsState } from './userGroupsState';
|
|
3
|
-
export declare function getUserGroupsByUserGroupIds(userGroupsState: UserGroupsState, userGroupIds: ID[]): UserGroup[];
|
|
4
|
-
export declare function getUserGroupByUserGroupId(userGroupsState: UserGroupsState, userGroupId: ID): UserGroup | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserGroupsByUserGroupIds = getUserGroupsByUserGroupIds;
|
|
4
|
-
exports.getUserGroupByUserGroupId = getUserGroupByUserGroupId;
|
|
5
|
-
function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
6
|
-
return userGroupIds
|
|
7
|
-
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
8
|
-
.filter((value) => value != null);
|
|
9
|
-
}
|
|
10
|
-
function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
11
|
-
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { mapUserGroupPayloadToUserGroup, } from './userGroupsPayload';
|
|
3
|
-
export const initialState = {
|
|
4
|
-
userGroupByUserGroupId: {},
|
|
5
|
-
};
|
|
6
|
-
const userGroups = createSlice({
|
|
7
|
-
name: 'userGroups',
|
|
8
|
-
initialState,
|
|
9
|
-
reducers: {
|
|
10
|
-
updateAllUserGroups(draft, action) {
|
|
11
|
-
action.payload.userGroups.forEach((payload) => {
|
|
12
|
-
const userGroup = mapUserGroupPayloadToUserGroup(payload);
|
|
13
|
-
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
removeUserGroup(draft, action) {
|
|
17
|
-
delete draft.userGroupByUserGroupId[action.payload];
|
|
18
|
-
},
|
|
19
|
-
clearAllUserGroups(draft) {
|
|
20
|
-
Object.assign(draft, initialState);
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
export const { updateAllUserGroups, removeUserGroup, clearAllUserGroups } = userGroups.actions;
|
|
25
|
-
export default userGroups.reducer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
2
|
-
return userGroupIds
|
|
3
|
-
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
4
|
-
.filter((value) => value != null);
|
|
5
|
-
}
|
|
6
|
-
export function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
7
|
-
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
8
|
-
}
|