@zeniai/client-epic-state 5.0.81-betaML5 → 5.0.81-betaRR0
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/entity/account/accountSelector.d.ts +0 -9
- package/lib/entity/account/accountSelector.js +1 -14
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +171 -1
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +22 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +291 -4
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +3 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +11 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +186 -4
- package/lib/entity/aiCfo/aiCfoState.js +23 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +256 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +103 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +54 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +23 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +92 -0
- 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/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -3
- package/lib/entity/tenant/clearAllEpic.js +8 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -4
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +10 -18
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
- package/lib/epic.d.ts +11 -3
- package/lib/epic.js +11 -3
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/esm/entity/account/accountSelector.js +0 -11
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +291 -4
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +10 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +20 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +252 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +79 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +50 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +88 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -1
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -2
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +10 -18
- package/lib/esm/epic.js +11 -3
- package/lib/esm/index.js +26 -12
- package/lib/esm/reducer.js +12 -3
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -13
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -9
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +70 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +49 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +42 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +72 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +62 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +16 -4
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +38 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -6
- package/lib/index.d.ts +24 -12
- package/lib/index.js +147 -43
- package/lib/reducer.d.ts +12 -3
- package/lib/reducer.js +12 -3
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -14
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +74 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +53 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +16 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +76 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +66 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +32 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +45 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +57 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +29 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +5 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +17 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +27 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +43 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -6
- package/lib/view/transactionDetail/transactionDetailSelector.js +1 -6
- package/package.json +1 -1
- package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +0 -82
- package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +0 -64
- package/lib/esm/view/createTransferEntry/createTransferEntryState.js +0 -17
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +0 -130
- package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +0 -37
- package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +0 -32
- package/lib/view/createTransferEntry/createTransferEntryReducer.js +0 -86
- package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +0 -39
- package/lib/view/createTransferEntry/createTransferEntrySelector.js +0 -69
- package/lib/view/createTransferEntry/createTransferEntryState.d.ts +0 -30
- package/lib/view/createTransferEntry/createTransferEntryState.js +0 -20
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +0 -11
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +0 -134
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +0 -14
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +0 -41
|
@@ -6,5 +6,4 @@ import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSel
|
|
|
6
6
|
export declare const getCategorizationInFlightRecommendationsByTransactionId: (state: RootState) => Record<ID, boolean>;
|
|
7
7
|
export declare const getCategorizationHasInFlightRecommendations: (state: RootState) => boolean;
|
|
8
8
|
export declare const toTransactionView: (transaction: TransactionWithCOT, transactionLocalData?: TransactionReviewLocalDataSelectorView) => TransactionView;
|
|
9
|
-
export { getLastTransferEntryReplacement } from '../../createTransferEntry/createTransferEntrySelector';
|
|
10
9
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.toTransactionView = exports.getCategorizationHasInFlightRecommendations = exports.getCategorizationInFlightRecommendationsByTransactionId = void 0;
|
|
7
7
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
@@ -15,7 +15,6 @@ const transactionSelector_1 = require("../../../entity/transaction/transactionSe
|
|
|
15
15
|
const transactionFilterHelpers_1 = require("../transactionFilterHelpers");
|
|
16
16
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
17
17
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
18
|
-
const createTransferEntrySelector_1 = require("../../createTransferEntry/createTransferEntrySelector");
|
|
19
18
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
20
19
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
21
20
|
// Walks the tab's transactionReviewLocalDataById map and returns
|
|
@@ -91,12 +90,8 @@ const toTransactionView = (transaction, transactionLocalData) => {
|
|
|
91
90
|
};
|
|
92
91
|
};
|
|
93
92
|
exports.toTransactionView = toTransactionView;
|
|
94
|
-
// Re-exported here for back-compat. New code should import from
|
|
95
|
-
// `view/createTransferEntry/createTransferEntrySelector`.
|
|
96
|
-
var createTransferEntrySelector_2 = require("../../createTransferEntry/createTransferEntrySelector");
|
|
97
|
-
Object.defineProperty(exports, "getLastTransferEntryReplacement", { enumerable: true, get: function () { return createTransferEntrySelector_2.getLastTransferEntryReplacement; } });
|
|
98
93
|
function getExpenseAutomationTransactionView(state) {
|
|
99
|
-
const { accountState, classState, classListState, accountListState,
|
|
94
|
+
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
100
95
|
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
101
96
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, filters, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
102
97
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
@@ -228,7 +223,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
228
223
|
: [];
|
|
229
224
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
230
225
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
231
|
-
const { transferAccountsList, creditCardTransferAccountsList } = (0, createTransferEntrySelector_1.getResolvedTransferAccounts)(state);
|
|
232
226
|
const inFlightCategoryClassRecommendationsByTransactionId = (0, exports.getCategorizationInFlightRecommendationsByTransactionId)(state);
|
|
233
227
|
const hasInFlightCategoryClassRecommendations = (0, exports.getCategorizationHasInFlightRecommendations)(state);
|
|
234
228
|
return {
|
|
@@ -253,7 +247,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
253
247
|
refreshStatus,
|
|
254
248
|
saveStatus,
|
|
255
249
|
markAsNotMiscategorizedStatus,
|
|
256
|
-
createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
|
|
257
250
|
completionStatus,
|
|
258
251
|
totalCountByTab,
|
|
259
252
|
parentTabTotalCountByTab,
|
|
@@ -261,8 +254,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
261
254
|
uploadReceiptStatusById,
|
|
262
255
|
selectedTransactionId,
|
|
263
256
|
selectedTransactionLineId,
|
|
264
|
-
creditCardTransferAccountsList,
|
|
265
|
-
transferAccounts: transferAccountsList,
|
|
266
257
|
selectedTransactionCategorizationCompletedSubTab,
|
|
267
258
|
};
|
|
268
259
|
}
|
|
@@ -6,7 +6,7 @@ import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
|
6
6
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
7
7
|
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
|
-
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "
|
|
9
|
+
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "class" | "category" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
|
|
10
10
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
11
11
|
export declare const toJEScheduleMainTab: (v: string) => "completed" | "pending_review" | "ongoing";
|
|
12
12
|
export type JEScheduleMainTab = ReturnType<typeof toJEScheduleMainTab>;
|
|
@@ -2,7 +2,7 @@ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { CompletedSubTab } from './completedSubTab';
|
|
5
|
-
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "
|
|
5
|
+
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "class" | "category";
|
|
6
6
|
export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
|
|
7
7
|
export interface MissingReceiptsViewUIState {
|
|
8
8
|
scrollPosition: {
|
|
@@ -34,7 +34,7 @@ export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatch
|
|
|
34
34
|
export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
|
|
35
35
|
export declare const toMatchSource: (v: string) => "manual" | "ai";
|
|
36
36
|
export type MatchSource = ReturnType<typeof toMatchSource>;
|
|
37
|
-
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "
|
|
37
|
+
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "class" | "category";
|
|
38
38
|
export type BulkUploadSortKey = ReturnType<typeof toBulkUploadSortKey>;
|
|
39
39
|
export interface CandidateRef {
|
|
40
40
|
matchScore: number;
|
|
@@ -20,7 +20,7 @@ export interface SaveReconciliationDetailFailurePayload {
|
|
|
20
20
|
error: ZeniAPIStatus;
|
|
21
21
|
fetchStateByAction: SaveReconcileDetailActionPayload;
|
|
22
22
|
}
|
|
23
|
-
export declare const toReconciliationTabsType: (v: string) => "
|
|
23
|
+
export declare const toReconciliationTabsType: (v: string) => "review" | "reconcile";
|
|
24
24
|
export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
|
|
25
25
|
declare const toReconReconcileSortKeysType: (v: string) => "date" | "amount" | "type" | "account" | "memo" | "clearedDate" | "payee" | "transactionDirection" | "recommended";
|
|
26
26
|
export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
|
|
@@ -19,7 +19,7 @@ import { EntityRecommendationKey } from '../../recommendation/recommendationStat
|
|
|
19
19
|
import { TransactionFilters } from '../transactionFilterHelpers';
|
|
20
20
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
21
21
|
import { CompletedSubTab } from './completedSubTab';
|
|
22
|
-
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "
|
|
22
|
+
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "class" | "category" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
23
23
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
24
24
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
25
25
|
export declare const toTransactionsTabKey: (v: string) => "review" | "autoCategorized";
|
|
@@ -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" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation"
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation" |
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation" |
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "department" | "name" | "role" | "manager" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation"
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -2,8 +2,8 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
2
2
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
3
|
import { ReportsResyncState } from './reportsResyncState';
|
|
4
4
|
export declare const initialReportsResyncState: ReportsResyncState;
|
|
5
|
-
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "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" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation"
|
|
6
|
-
reportIdToResync: "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" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation"
|
|
5
|
+
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "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" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation"], {
|
|
6
|
+
reportIdToResync: "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" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "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" | "other_connection" | "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" | "excluded_account_reconciliation";
|
|
7
7
|
}, "initiateReportsResync/initiateReportsResync", never, never>, initiateReportsClassViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
8
|
reportIdToResync: ReportID;
|
|
9
9
|
}, "initiateReportsResync/initiateReportsClassViewRefetching">, reportsResyncSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "class" | "user" | "createTime" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FetchState } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../../../../responsePayload';
|
|
4
|
+
import { CardPolicyDetailState } from './cardPolicyDetailState';
|
|
5
|
+
export declare const initialState: CardPolicyDetailState;
|
|
6
|
+
export declare const fetchCardPolicyDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyDetail/fetchCardPolicyDetail", never, never>, updateCardPolicyDetailFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
fetchState: FetchState;
|
|
8
|
+
error?: ZeniAPIStatus;
|
|
9
|
+
}, "cardPolicyDetail/updateCardPolicyDetailFetchStatus">, updateCardPolicyFormDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreateCardPolicyTemplateRequest, "cardPolicyDetail/updateCardPolicyFormDraft">, updateCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyDetail/updateCardPolicy", never, never>, updateCardPolicyFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
fetchState: FetchState;
|
|
11
|
+
error?: ZeniAPIStatus;
|
|
12
|
+
}, "cardPolicyDetail/updateCardPolicyFetchStatus">, clearCardPolicyDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicyDetail/clearCardPolicyDetail">;
|
|
13
|
+
declare const _default: import("redux").Reducer<CardPolicyDetailState>;
|
|
14
|
+
export default _default;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearCardPolicyDetail = exports.updateCardPolicyFetchStatus = exports.updateCardPolicy = exports.updateCardPolicyFormDraft = exports.updateCardPolicyDetailFetchStatus = exports.fetchCardPolicyDetail = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
detailTemplateId: undefined,
|
|
8
|
+
detailFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
9
|
+
updateFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
10
|
+
formDraft: undefined,
|
|
11
|
+
};
|
|
12
|
+
const cardPolicyDetail = (0, toolkit_1.createSlice)({
|
|
13
|
+
name: 'cardPolicyDetail',
|
|
14
|
+
initialState: exports.initialState,
|
|
15
|
+
reducers: {
|
|
16
|
+
/**
|
|
17
|
+
* Kick off the `GET /cards/1.0/policy-templates/{id}` request. The
|
|
18
|
+
* accompanying epic dispatches `updateCreatedCardPolicyTemplate` on
|
|
19
|
+
* the entity slice + `updateCardPolicyFormDraft` (seeded from the
|
|
20
|
+
* template) + `updateCardPolicyDetailFetchStatus` here.
|
|
21
|
+
*/
|
|
22
|
+
fetchCardPolicyDetail: {
|
|
23
|
+
reducer(draft, action) {
|
|
24
|
+
draft.detailTemplateId = action.payload;
|
|
25
|
+
draft.detailFetchState.fetchState = 'In-Progress';
|
|
26
|
+
draft.detailFetchState.error = undefined;
|
|
27
|
+
// Reset the draft so a stale form from a previous template
|
|
28
|
+
// doesn't leak into the new edit session.
|
|
29
|
+
draft.formDraft = undefined;
|
|
30
|
+
},
|
|
31
|
+
prepare(templateId) {
|
|
32
|
+
return { payload: templateId };
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
updateCardPolicyDetailFetchStatus(draft, action) {
|
|
36
|
+
draft.detailFetchState.fetchState = action.payload.fetchState;
|
|
37
|
+
draft.detailFetchState.error = action.payload.error;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Replace (or seed) the local edit-form draft. Dispatched by the
|
|
41
|
+
* detail-fetch epic with the camelCased values pulled from the
|
|
42
|
+
* fetched template, and by the edit page itself as the user types.
|
|
43
|
+
*/
|
|
44
|
+
updateCardPolicyFormDraft(draft, action) {
|
|
45
|
+
draft.formDraft = action.payload;
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Kick off the `PUT /cards/1.0/policy-templates/{id}` save. The
|
|
49
|
+
* epic reads the current `formDraft` from state, posts the wire
|
|
50
|
+
* body, then dispatches `updateCreatedCardPolicyTemplate` (entity)
|
|
51
|
+
* + `updateCardPolicyFetchStatus({fetchState: 'Completed'})` here.
|
|
52
|
+
*/
|
|
53
|
+
updateCardPolicy: {
|
|
54
|
+
reducer(draft,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
_action) {
|
|
57
|
+
draft.updateFetchState.fetchState = 'In-Progress';
|
|
58
|
+
draft.updateFetchState.error = undefined;
|
|
59
|
+
},
|
|
60
|
+
prepare(templateId) {
|
|
61
|
+
return { payload: templateId };
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
updateCardPolicyFetchStatus(draft, action) {
|
|
65
|
+
draft.updateFetchState.fetchState = action.payload.fetchState;
|
|
66
|
+
draft.updateFetchState.error = action.payload.error;
|
|
67
|
+
},
|
|
68
|
+
clearCardPolicyDetail(draft) {
|
|
69
|
+
Object.assign(draft, exports.initialState);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
_a = cardPolicyDetail.actions, exports.fetchCardPolicyDetail = _a.fetchCardPolicyDetail, exports.updateCardPolicyDetailFetchStatus = _a.updateCardPolicyDetailFetchStatus, exports.updateCardPolicyFormDraft = _a.updateCardPolicyFormDraft, exports.updateCardPolicy = _a.updateCardPolicy, exports.updateCardPolicyFetchStatus = _a.updateCardPolicyFetchStatus, exports.clearCardPolicyDetail = _a.clearCardPolicyDetail;
|
|
74
|
+
exports.default = cardPolicyDetail.reducer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
import { CardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyState';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
/**
|
|
6
|
+
* Composite view returned by `getCardPolicyDetailView` — the only
|
|
7
|
+
* public shape the Card Policy edit page should consume. Mirrors how
|
|
8
|
+
* `chargeCardDetailSelector` joins the view-side lifecycle slots with
|
|
9
|
+
* the entity-store template.
|
|
10
|
+
*/
|
|
11
|
+
export interface CardPolicyDetailSelectorView {
|
|
12
|
+
detailFetchState: FetchStateAndError;
|
|
13
|
+
updateFetchState: FetchStateAndError;
|
|
14
|
+
formDraft?: CreateCardPolicyTemplateRequest;
|
|
15
|
+
template?: CardPolicyTemplate;
|
|
16
|
+
templateId?: ID;
|
|
17
|
+
}
|
|
18
|
+
export declare function getCardPolicyDetailView(state: RootState): CardPolicyDetailSelectorView;
|
|
19
|
+
export declare function getCardPolicyFormDraft(state: RootState): CreateCardPolicyTemplateRequest | undefined;
|
|
20
|
+
export declare function getCardPolicyDetailFetchState(state: RootState): FetchStateAndError;
|
|
21
|
+
export declare function getUpdateCardPolicyFetchState(state: RootState): FetchStateAndError;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCardPolicyDetailView = getCardPolicyDetailView;
|
|
4
|
+
exports.getCardPolicyFormDraft = getCardPolicyFormDraft;
|
|
5
|
+
exports.getCardPolicyDetailFetchState = getCardPolicyDetailFetchState;
|
|
6
|
+
exports.getUpdateCardPolicyFetchState = getUpdateCardPolicyFetchState;
|
|
7
|
+
const cardPolicySelector_1 = require("../../../../../entity/cardPolicy/cardPolicySelector");
|
|
8
|
+
function getCardPolicyDetailView(state) {
|
|
9
|
+
const { cardPolicyDetailState, cardPolicyState } = state;
|
|
10
|
+
return {
|
|
11
|
+
templateId: cardPolicyDetailState.detailTemplateId,
|
|
12
|
+
template: cardPolicyDetailState.detailTemplateId != null
|
|
13
|
+
? (0, cardPolicySelector_1.getCardPolicyTemplateById)(cardPolicyState, cardPolicyDetailState.detailTemplateId)
|
|
14
|
+
: undefined,
|
|
15
|
+
formDraft: cardPolicyDetailState.formDraft,
|
|
16
|
+
detailFetchState: cardPolicyDetailState.detailFetchState,
|
|
17
|
+
updateFetchState: cardPolicyDetailState.updateFetchState,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getCardPolicyFormDraft(state) {
|
|
21
|
+
return state.cardPolicyDetailState.formDraft;
|
|
22
|
+
}
|
|
23
|
+
function getCardPolicyDetailFetchState(state) {
|
|
24
|
+
return state.cardPolicyDetailState.detailFetchState;
|
|
25
|
+
}
|
|
26
|
+
function getUpdateCardPolicyFetchState(state) {
|
|
27
|
+
return state.cardPolicyDetailState.updateFetchState;
|
|
28
|
+
}
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
/**
|
|
4
|
+
* View-side state for the Card Policy edit page.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `issueChargeCard` (a single page that owns a local form
|
|
7
|
+
* draft + commits on save). There is no separate read-only "detail"
|
|
8
|
+
* surface today — the same page loads the existing template and offers
|
|
9
|
+
* inline edits. The saved template itself lives on the entity slice;
|
|
10
|
+
* the page joins via `getCardPolicyDetailView`.
|
|
11
|
+
*/
|
|
12
|
+
export interface CardPolicyDetailState {
|
|
13
|
+
/** Lifecycle for the initial `GET /policy-templates/{id}` request. */
|
|
14
|
+
detailFetchState: FetchStateAndError;
|
|
15
|
+
/** Lifecycle for the `PUT /policy-templates/{id}` save. */
|
|
16
|
+
updateFetchState: FetchStateAndError;
|
|
17
|
+
/** Template currently being edited; cleared when the page unmounts. */
|
|
18
|
+
detailTemplateId?: ID;
|
|
19
|
+
/**
|
|
20
|
+
* Local form draft seeded from the entity template on fetch success
|
|
21
|
+
* and mutated as the user edits. `undefined` until the detail fetch
|
|
22
|
+
* lands so the page can render a skeleton until then.
|
|
23
|
+
*/
|
|
24
|
+
formDraft?: CreateCardPolicyTemplateRequest;
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCreatedCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { fetchCardPolicyDetail, updateCardPolicyDetailFetchStatus, updateCardPolicyFormDraft } from './cardPolicyDetailReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchCardPolicyDetail> | ReturnType<typeof updateCreatedCardPolicyTemplate> | ReturnType<typeof updateCardPolicyFormDraft> | ReturnType<typeof updateCardPolicyDetailFetchStatus>;
|
|
8
|
+
/**
|
|
9
|
+
* `GET /cards/1.0/policy-templates/{id}`. Response is the same
|
|
10
|
+
* `{cards_applied, template}` envelope the create endpoint returns.
|
|
11
|
+
* We:
|
|
12
|
+
*
|
|
13
|
+
* 1. Cache the template on the entity slice (so the list page picks
|
|
14
|
+
* up any drift from the server).
|
|
15
|
+
* 2. Seed the local edit-form draft from the camelCased template so
|
|
16
|
+
* the page can render with the existing values pre-populated.
|
|
17
|
+
* 3. Flip the view lifecycle to `Completed` / `Error`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const fetchCardPolicyDetailEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCardPolicyDetailEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const cardPolicyPayload_1 = require("../../../../../entity/cardPolicy/cardPolicyPayload");
|
|
7
|
+
const cardPolicyReducer_1 = require("../../../../../entity/cardPolicy/cardPolicyReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
+
const cardPolicyDetailReducer_1 = require("./cardPolicyDetailReducer");
|
|
10
|
+
/**
|
|
11
|
+
* `GET /cards/1.0/policy-templates/{id}`. Response is the same
|
|
12
|
+
* `{cards_applied, template}` envelope the create endpoint returns.
|
|
13
|
+
* We:
|
|
14
|
+
*
|
|
15
|
+
* 1. Cache the template on the entity slice (so the list page picks
|
|
16
|
+
* up any drift from the server).
|
|
17
|
+
* 2. Seed the local edit-form draft from the camelCased template so
|
|
18
|
+
* the page can render with the existing values pre-populated.
|
|
19
|
+
* 3. Flip the view lifecycle to `Completed` / `Error`.
|
|
20
|
+
*/
|
|
21
|
+
const fetchCardPolicyDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cardPolicyDetailReducer_1.fetchCardPolicyDetail.match),
|
|
22
|
+
// `exhaustMap` (rather than `mergeMap`) so a duplicate
|
|
23
|
+
// `fetchCardPolicyDetail` dispatched while the previous one is
|
|
24
|
+
// still in flight is dropped instead of producing a second HTTP
|
|
25
|
+
// request. The edit screen dispatches this on mount, and React 18
|
|
26
|
+
// StrictMode invokes its mount effect twice with a stale
|
|
27
|
+
// `detailFetchState` closure — without `exhaustMap` that yields
|
|
28
|
+
// two `/policy-templates/{id}` calls. (The screen also dedupes
|
|
29
|
+
// list→edit navigations via the entity-cached template, so the
|
|
30
|
+
// detail GET is only emitted on direct landings — there's no
|
|
31
|
+
// realistic cross-templateId scenario that needs cancel-and-retry
|
|
32
|
+
// semantics here.)
|
|
33
|
+
(0, operators_1.exhaustMap)((action) => {
|
|
34
|
+
const templateId = action.payload;
|
|
35
|
+
return zeniAPI
|
|
36
|
+
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/policy-templates/${templateId}`)
|
|
37
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
38
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
39
|
+
const { template } = response.data;
|
|
40
|
+
const formDraft = (0, cardPolicyPayload_1.toCardPolicyEditFormDraft)((0, cardPolicyPayload_1.toCardPolicyTemplate)(template));
|
|
41
|
+
const actions = [
|
|
42
|
+
(0, cardPolicyReducer_1.updateCreatedCardPolicyTemplate)(template),
|
|
43
|
+
(0, cardPolicyDetailReducer_1.updateCardPolicyFormDraft)(formDraft),
|
|
44
|
+
(0, cardPolicyDetailReducer_1.updateCardPolicyDetailFetchStatus)({ fetchState: 'Completed' }),
|
|
45
|
+
];
|
|
46
|
+
return (0, rxjs_1.from)(actions);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return (0, rxjs_1.of)((0, cardPolicyDetailReducer_1.updateCardPolicyDetailFetchStatus)({
|
|
50
|
+
fetchState: 'Error',
|
|
51
|
+
error: response.status,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cardPolicyDetailReducer_1.updateCardPolicyDetailFetchStatus)({
|
|
55
|
+
fetchState: 'Error',
|
|
56
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch card-policy detail REST API call errored out' +
|
|
57
|
+
JSON.stringify(error)),
|
|
58
|
+
}))));
|
|
59
|
+
}));
|
|
60
|
+
exports.fetchCardPolicyDetailEpic = fetchCardPolicyDetailEpic;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCreatedCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { updateCardPolicy, updateCardPolicyFetchStatus } from './cardPolicyDetailReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof updateCardPolicy> | ReturnType<typeof updateCreatedCardPolicyTemplate> | ReturnType<typeof updateCardPolicyFetchStatus>;
|
|
8
|
+
/**
|
|
9
|
+
* `PUT /cards/1.0/policy-templates/{id}`. Reads the current `formDraft`
|
|
10
|
+
* off the `cardPolicyDetail` slice, converts it to the snake_case wire
|
|
11
|
+
* body (same shape as create), and submits. On success the entity
|
|
12
|
+
* slice picks up the refreshed template and the view lifecycle flips
|
|
13
|
+
* to `Completed`.
|
|
14
|
+
*
|
|
15
|
+
* If the action fires before a draft is seeded (e.g. user clicks save
|
|
16
|
+
* before the detail fetch lands), we short-circuit with an Error.
|
|
17
|
+
*/
|
|
18
|
+
export declare const updateCardPolicyEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCardPolicyEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const cardPolicyPayload_1 = require("../../../../../entity/cardPolicy/cardPolicyPayload");
|
|
7
|
+
const cardPolicyReducer_1 = require("../../../../../entity/cardPolicy/cardPolicyReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
+
const cardPolicyDetailReducer_1 = require("./cardPolicyDetailReducer");
|
|
10
|
+
/**
|
|
11
|
+
* `PUT /cards/1.0/policy-templates/{id}`. Reads the current `formDraft`
|
|
12
|
+
* off the `cardPolicyDetail` slice, converts it to the snake_case wire
|
|
13
|
+
* body (same shape as create), and submits. On success the entity
|
|
14
|
+
* slice picks up the refreshed template and the view lifecycle flips
|
|
15
|
+
* to `Completed`.
|
|
16
|
+
*
|
|
17
|
+
* If the action fires before a draft is seeded (e.g. user clicks save
|
|
18
|
+
* before the detail fetch lands), we short-circuit with an Error.
|
|
19
|
+
*/
|
|
20
|
+
const updateCardPolicyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cardPolicyDetailReducer_1.updateCardPolicy.match), (0, operators_1.mergeMap)((action) => {
|
|
21
|
+
const templateId = action.payload;
|
|
22
|
+
const formDraft = state$.value.cardPolicyDetailState.formDraft;
|
|
23
|
+
if (formDraft == null) {
|
|
24
|
+
return (0, rxjs_1.of)((0, cardPolicyDetailReducer_1.updateCardPolicyFetchStatus)({
|
|
25
|
+
fetchState: 'Error',
|
|
26
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Missing form draft', `Cannot update card-policy ${templateId} — no formDraft is loaded.`),
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
const body = (0, cardPolicyPayload_1.toUpdateCardPolicyTemplateRequestBody)(formDraft);
|
|
30
|
+
return zeniAPI
|
|
31
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/policy-templates/${templateId}`, body)
|
|
32
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
33
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
34
|
+
const { template } = response.data;
|
|
35
|
+
const actions = [
|
|
36
|
+
(0, cardPolicyReducer_1.updateCreatedCardPolicyTemplate)(template),
|
|
37
|
+
(0, cardPolicyDetailReducer_1.updateCardPolicyFetchStatus)({ fetchState: 'Completed' }),
|
|
38
|
+
];
|
|
39
|
+
return (0, rxjs_1.from)(actions);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return (0, rxjs_1.of)((0, cardPolicyDetailReducer_1.updateCardPolicyFetchStatus)({
|
|
43
|
+
fetchState: 'Error',
|
|
44
|
+
error: response.status,
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cardPolicyDetailReducer_1.updateCardPolicyFetchStatus)({
|
|
48
|
+
fetchState: 'Error',
|
|
49
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update card-policy REST API call errored out' +
|
|
50
|
+
JSON.stringify(error)),
|
|
51
|
+
}))));
|
|
52
|
+
}));
|
|
53
|
+
exports.updateCardPolicyEpic = updateCardPolicyEpic;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { removeCardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { archiveCardPolicy, updateArchiveCardPolicyFetchStatus } from './cardPolicyListReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof archiveCardPolicy> | ReturnType<typeof removeCardPolicyTemplate> | ReturnType<typeof updateArchiveCardPolicyFetchStatus>;
|
|
8
|
+
/**
|
|
9
|
+
* `DELETE /cards/1.0/policy-templates/{id}`. Modeled like
|
|
10
|
+
* `deleteBillEpic`: typed as bare `ZeniAPIResponse` (no `data` body
|
|
11
|
+
* expected) with `isSuccessStatus` driving the success branch. On
|
|
12
|
+
* success the entity slice drops the template via
|
|
13
|
+
* `removeCardPolicyTemplate(templateId)` and the view slice records
|
|
14
|
+
* `Completed` (also pruning the ID from `templateIds`).
|
|
15
|
+
*/
|
|
16
|
+
export declare const archiveCardPolicyEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|