@zeniai/client-epic-state 5.0.81-betaML3 → 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
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "department" | "accountType" | "owner" | "cardName" | "limit" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -54,7 +54,21 @@ export interface MyPendingActivationChargeCardListSelectorView extends SelectorV
|
|
|
54
54
|
export interface ChargeCardListWithShippingAddressSelectorView extends SelectorView {
|
|
55
55
|
cards: ChargeCardWithUserAndShippingAddress[];
|
|
56
56
|
}
|
|
57
|
+
export interface AllChargeCardsWithUserSelectorView extends SelectorView {
|
|
58
|
+
cards: ChargeCardWithUser[];
|
|
59
|
+
}
|
|
57
60
|
export declare const getChargeCardListView: (state: RootState, includeCreditAccountDebitSummaryAndCashbackInfo: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean) => ChargeCardListSelectorView;
|
|
61
|
+
/**
|
|
62
|
+
* Returns every enriched `ChargeCardWithUser` for the tenant, without
|
|
63
|
+
* applying the cards-list screen's `searchText` filter or its column
|
|
64
|
+
* `sortKey/sortOrder`. Used by surfaces that need the raw card universe
|
|
65
|
+
* decoupled from whatever the user has typed/sorted on the cards list
|
|
66
|
+
* (e.g. the Card Policy "Apply to Cards" picker, which owns its own
|
|
67
|
+
* search + sort UI). The list-screen's filter/sort state is intentionally
|
|
68
|
+
* left untouched so revisits to the cards list still restore the user's
|
|
69
|
+
* search.
|
|
70
|
+
*/
|
|
71
|
+
export declare const getAllChargeCardsWithUser: (state: RootState) => AllChargeCardsWithUserSelectorView;
|
|
58
72
|
export declare const getMyPendingActivationChargeCardListView: (state: RootState) => MyPendingActivationChargeCardListSelectorView;
|
|
59
73
|
export declare const getMyRequestOnHoldChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView;
|
|
60
74
|
/**
|
|
@@ -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.getChargeCardBulkActionView = exports.getChargeCardRowActionView = exports.getChargeCardRecurringExpensesByCardIds = exports.getDebitCardSummary = exports.getDebitCardList = exports.getDepositAccountListWithDebitCardIssued = exports.getCreditAccountDetails = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getChargeCardListView = void 0;
|
|
6
|
+
exports.getChargeCardBulkActionView = exports.getChargeCardRowActionView = exports.getChargeCardRecurringExpensesByCardIds = exports.getDebitCardSummary = exports.getDebitCardList = exports.getDepositAccountListWithDebitCardIssued = exports.getCreditAccountDetails = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getAllChargeCardsWithUser = exports.getChargeCardListView = void 0;
|
|
7
7
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
9
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
@@ -94,6 +94,32 @@ const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbac
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
exports.getChargeCardListView = getChargeCardListView;
|
|
97
|
+
/**
|
|
98
|
+
* Returns every enriched `ChargeCardWithUser` for the tenant, without
|
|
99
|
+
* applying the cards-list screen's `searchText` filter or its column
|
|
100
|
+
* `sortKey/sortOrder`. Used by surfaces that need the raw card universe
|
|
101
|
+
* decoupled from whatever the user has typed/sorted on the cards list
|
|
102
|
+
* (e.g. the Card Policy "Apply to Cards" picker, which owns its own
|
|
103
|
+
* search + sort UI). The list-screen's filter/sort state is intentionally
|
|
104
|
+
* left untouched so revisits to the cards list still restore the user's
|
|
105
|
+
* search.
|
|
106
|
+
*/
|
|
107
|
+
const getAllChargeCardsWithUser = (state) => {
|
|
108
|
+
const { chargeCardListState, chargeCardState, chargeCardConfigState } = state;
|
|
109
|
+
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
110
|
+
const chargeCardsWithUser = getChargeCardsWithUser(cards, state);
|
|
111
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
112
|
+
chargeCardListState,
|
|
113
|
+
chargeCardConfigState,
|
|
114
|
+
]).fetchState;
|
|
115
|
+
return {
|
|
116
|
+
fetchState,
|
|
117
|
+
error: chargeCardListState.error,
|
|
118
|
+
cards: chargeCardsWithUser,
|
|
119
|
+
version: '1.0',
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
exports.getAllChargeCardsWithUser = getAllChargeCardsWithUser;
|
|
97
123
|
const getMyPendingActivationChargeCardListView = (state) => {
|
|
98
124
|
const { tenantState, chargeCardListState, chargeCardState } = state;
|
|
99
125
|
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
@@ -8,6 +8,6 @@ import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
|
8
8
|
import { RootState } from '../../../../reducer';
|
|
9
9
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
10
10
|
import { updateChargeCardList } from '../chargeCardList/chargeCardListReducer';
|
|
11
|
-
import { issueChargeCardSuccessOrFailure, issueChargeCards, updateChargeCardCount, updateDebitCardCount, updateLastSelfIssuedDebitCardId } from './issueChargeCardReducer';
|
|
12
|
-
export type ActionType = ReturnType<typeof issueChargeCards> | ReturnType<typeof updateChargeCards> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardList> | ReturnType<typeof updateChargeCardCount> | ReturnType<typeof updateDebitCardCount> | ReturnType<typeof updateLastSelfIssuedDebitCardId> | ReturnType<typeof issueChargeCardSuccessOrFailure> | ReturnType<typeof updateAddresses>;
|
|
11
|
+
import { issueChargeCardSuccessOrFailure, issueChargeCards, updateChargeCardCount, updateDebitCardCount, updateLastIssuedCardIds, updateLastSelfIssuedDebitCardId } from './issueChargeCardReducer';
|
|
12
|
+
export type ActionType = ReturnType<typeof issueChargeCards> | ReturnType<typeof updateChargeCards> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardList> | ReturnType<typeof updateChargeCardCount> | ReturnType<typeof updateDebitCardCount> | ReturnType<typeof updateLastSelfIssuedDebitCardId> | ReturnType<typeof updateLastIssuedCardIds> | ReturnType<typeof issueChargeCardSuccessOrFailure> | ReturnType<typeof updateAddresses>;
|
|
13
13
|
export declare const issueChargeCardEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -90,7 +90,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
90
90
|
actions.push((0, chargeCardReducer_1.updateChargeCards)(issuedCards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({
|
|
91
91
|
chargeCardListPayload: response.data,
|
|
92
92
|
keepExistingListItems: true,
|
|
93
|
-
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, issueChargeCardReducer_1.updateChargeCardCount)(response.data?.cards_count_by_user_id ?? []), (0, issueChargeCardReducer_1.updateDebitCardCount)(response.data?.debit_cards_count_by_deposit_account_id ?? {}), (0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
93
|
+
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, issueChargeCardReducer_1.updateChargeCardCount)(response.data?.cards_count_by_user_id ?? []), (0, issueChargeCardReducer_1.updateDebitCardCount)(response.data?.debit_cards_count_by_deposit_account_id ?? {}), (0, issueChargeCardReducer_1.updateLastIssuedCardIds)(issuedCards.map((card) => card.card_id)), (0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
94
94
|
if (issuedCards.length === 1 &&
|
|
95
95
|
(issuedCards[0].card_type.code ===
|
|
96
96
|
'business_virtual_debit_card' ||
|
|
@@ -5,7 +5,11 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
5
5
|
import { ActiveChargeCardCountPayload, ActiveDebitCardCountByUserIdPayload } from '../../../userListView/userListViewPayload';
|
|
6
6
|
import { IssueChargeCardLocalData, IssueChargeCardState } from './issueChargeCardState';
|
|
7
7
|
export declare const initialState: IssueChargeCardState;
|
|
8
|
-
export declare const issueChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
8
|
+
export declare const issueChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
9
|
+
sourceChatSessionId?: ID;
|
|
10
|
+
} | undefined], {
|
|
11
|
+
sourceChatSessionId?: ID;
|
|
12
|
+
}, "issueChargeCard/issueChargeCards", never, never>, updateChargeCardsLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<IssueChargeCardLocalData[], "issueChargeCard/updateChargeCardsLocalStore">, updateLastSelfIssuedDebitCardId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issueChargeCard/updateLastSelfIssuedDebitCardId">, updateLastIssuedCardIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issueChargeCard/updateLastIssuedCardIds">, issueChargeCardSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
13
|
fetchState: FetchState;
|
|
10
14
|
error?: ZeniAPIStatus;
|
|
11
15
|
}, "issueChargeCard/issueChargeCardSuccessOrFailure">, resetIssueChargeCardForm: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issueChargeCard/resetIssueChargeCardForm">, updateCustomAddressId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearIssueChargeCard = exports.updateDepositAccountListForCardsFetchStatus = exports.fetchDepositAccountListForCards = exports.updateDepositAccountsInCards = exports.fetchIssueCardPage = exports.updateDebitCardCount = exports.updateChargeCardCount = exports.updateCustomAddressId = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateLastSelfIssuedDebitCardId = exports.updateChargeCardsLocalStore = exports.issueChargeCards = exports.initialState = void 0;
|
|
4
|
+
exports.clearIssueChargeCard = exports.updateDepositAccountListForCardsFetchStatus = exports.fetchDepositAccountListForCards = exports.updateDepositAccountsInCards = exports.fetchIssueCardPage = exports.updateDebitCardCount = exports.updateChargeCardCount = exports.updateCustomAddressId = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateLastIssuedCardIds = exports.updateLastSelfIssuedDebitCardId = exports.updateChargeCardsLocalStore = exports.issueChargeCards = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialState = {
|
|
7
7
|
depositAccountIds: [],
|
|
@@ -18,6 +18,7 @@ exports.initialState = {
|
|
|
18
18
|
},
|
|
19
19
|
activeChargeCardCount: {},
|
|
20
20
|
activeDebitCardCountByDepositAccountId: {},
|
|
21
|
+
lastIssuedCardIds: [],
|
|
21
22
|
};
|
|
22
23
|
const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
23
24
|
name: 'issueChargeCard',
|
|
@@ -38,14 +39,23 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
issueChargeCards: {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
// `sourceChatSessionId`, when provided, records which AI CFO chat
|
|
43
|
+
// session triggered this bulk create so the cards list and AI CFO
|
|
44
|
+
// drawer can correlate an in-flight create back to its conversation.
|
|
45
|
+
// The field is not sent to the backend.
|
|
46
|
+
prepare(payload) {
|
|
47
|
+
return { payload: payload ?? {} };
|
|
43
48
|
},
|
|
44
|
-
reducer(draft) {
|
|
49
|
+
reducer(draft, action) {
|
|
45
50
|
draft.saveStatus.fetchState = 'In-Progress';
|
|
46
51
|
draft.saveStatus.error = undefined;
|
|
52
|
+
draft.lastIssueSourceChatSessionId = action.payload.sourceChatSessionId;
|
|
53
|
+
draft.lastIssuedCardIds = [];
|
|
47
54
|
},
|
|
48
55
|
},
|
|
56
|
+
updateLastIssuedCardIds(draft, action) {
|
|
57
|
+
draft.lastIssuedCardIds = action.payload;
|
|
58
|
+
},
|
|
49
59
|
updateChargeCardsLocalStore(draft, action) {
|
|
50
60
|
draft.localData = action.payload;
|
|
51
61
|
},
|
|
@@ -53,6 +63,8 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
53
63
|
draft.localData = [...exports.initialState.localData];
|
|
54
64
|
draft.saveStatus = exports.initialState.saveStatus;
|
|
55
65
|
draft.lastSelfIssuedDebitCardId = undefined;
|
|
66
|
+
draft.lastIssueSourceChatSessionId = undefined;
|
|
67
|
+
draft.lastIssuedCardIds = [];
|
|
56
68
|
},
|
|
57
69
|
updateLastSelfIssuedDebitCardId(draft, action) {
|
|
58
70
|
draft.lastSelfIssuedDebitCardId = action.payload;
|
|
@@ -133,5 +145,5 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
133
145
|
},
|
|
134
146
|
},
|
|
135
147
|
});
|
|
136
|
-
_a = issueChargeCard.actions, exports.issueChargeCards = _a.issueChargeCards, exports.updateChargeCardsLocalStore = _a.updateChargeCardsLocalStore, exports.updateLastSelfIssuedDebitCardId = _a.updateLastSelfIssuedDebitCardId, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateCustomAddressId = _a.updateCustomAddressId, exports.updateChargeCardCount = _a.updateChargeCardCount, exports.updateDebitCardCount = _a.updateDebitCardCount, exports.fetchIssueCardPage = _a.fetchIssueCardPage, exports.updateDepositAccountsInCards = _a.updateDepositAccountsInCards, exports.fetchDepositAccountListForCards = _a.fetchDepositAccountListForCards, exports.updateDepositAccountListForCardsFetchStatus = _a.updateDepositAccountListForCardsFetchStatus, exports.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
148
|
+
_a = issueChargeCard.actions, exports.issueChargeCards = _a.issueChargeCards, exports.updateChargeCardsLocalStore = _a.updateChargeCardsLocalStore, exports.updateLastSelfIssuedDebitCardId = _a.updateLastSelfIssuedDebitCardId, exports.updateLastIssuedCardIds = _a.updateLastIssuedCardIds, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateCustomAddressId = _a.updateCustomAddressId, exports.updateChargeCardCount = _a.updateChargeCardCount, exports.updateDebitCardCount = _a.updateDebitCardCount, exports.fetchIssueCardPage = _a.fetchIssueCardPage, exports.updateDepositAccountsInCards = _a.updateDepositAccountsInCards, exports.fetchDepositAccountListForCards = _a.fetchDepositAccountListForCards, exports.updateDepositAccountListForCardsFetchStatus = _a.updateDepositAccountListForCardsFetchStatus, exports.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
137
149
|
exports.default = issueChargeCard.reducer;
|
|
@@ -25,3 +25,30 @@ export interface IssueChargeCardSelectorView extends SelectorView {
|
|
|
25
25
|
lastSelfIssuedDebitCardId?: ID;
|
|
26
26
|
}
|
|
27
27
|
export declare const getIssueChargeCardView: (state: RootState, isCreditCardEnabled: boolean, isDebitCardEnabled: boolean) => IssueChargeCardSelectorView;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the AI CFO chat session id that triggered the most recent
|
|
30
|
+
* `issueChargeCards` dispatch (if any). Used by the cards list screen to
|
|
31
|
+
* decide whether the in-flight bulk-create originated from an AI CFO
|
|
32
|
+
* interactive form submission and should therefore render a pending
|
|
33
|
+
* placeholder + synthetic AI CFO drawer bubble.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getLastIssueChargeCardsSourceChatSessionId: (state: RootState) => ID | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the ids of the cards created by the most recent successful
|
|
38
|
+
* `issueChargeCards` call. Used by the AI CFO drawer's "Created" success
|
|
39
|
+
* bubble to map back to the actual created entities.
|
|
40
|
+
*/
|
|
41
|
+
export declare const getLastIssuedChargeCardIds: (state: RootState) => ID[];
|
|
42
|
+
/**
|
|
43
|
+
* Returns the save-status fetch state for the most recent `issueChargeCards`
|
|
44
|
+
* dispatch. Useful for gating pending placeholder rows on `In-Progress` /
|
|
45
|
+
* swapping them out on `Completed`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getIssueChargeCardsSaveStatus: (state: RootState) => FetchStateAndError;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the number of card rows currently being bulk-issued via the most
|
|
50
|
+
* recent `issueChargeCards` dispatch. Mirrors `localData.length` while the
|
|
51
|
+
* call is in flight so the cards list screen can render N skeleton rows at
|
|
52
|
+
* the top of the table.
|
|
53
|
+
*/
|
|
54
|
+
export declare const getInFlightIssueChargeCardsCount: (state: RootState) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIssueChargeCardView = void 0;
|
|
3
|
+
exports.getInFlightIssueChargeCardsCount = exports.getIssueChargeCardsSaveStatus = exports.getLastIssuedChargeCardIds = exports.getLastIssueChargeCardsSourceChatSessionId = exports.getIssueChargeCardView = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
6
6
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
@@ -97,3 +97,45 @@ const getIssueChargeCardView = (state, isCreditCardEnabled, isDebitCardEnabled)
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
exports.getIssueChargeCardView = getIssueChargeCardView;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the AI CFO chat session id that triggered the most recent
|
|
102
|
+
* `issueChargeCards` dispatch (if any). Used by the cards list screen to
|
|
103
|
+
* decide whether the in-flight bulk-create originated from an AI CFO
|
|
104
|
+
* interactive form submission and should therefore render a pending
|
|
105
|
+
* placeholder + synthetic AI CFO drawer bubble.
|
|
106
|
+
*/
|
|
107
|
+
const getLastIssueChargeCardsSourceChatSessionId = (state) => {
|
|
108
|
+
return state.issueChargeCardState.lastIssueSourceChatSessionId;
|
|
109
|
+
};
|
|
110
|
+
exports.getLastIssueChargeCardsSourceChatSessionId = getLastIssueChargeCardsSourceChatSessionId;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the ids of the cards created by the most recent successful
|
|
113
|
+
* `issueChargeCards` call. Used by the AI CFO drawer's "Created" success
|
|
114
|
+
* bubble to map back to the actual created entities.
|
|
115
|
+
*/
|
|
116
|
+
const getLastIssuedChargeCardIds = (state) => {
|
|
117
|
+
return state.issueChargeCardState.lastIssuedCardIds;
|
|
118
|
+
};
|
|
119
|
+
exports.getLastIssuedChargeCardIds = getLastIssuedChargeCardIds;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the save-status fetch state for the most recent `issueChargeCards`
|
|
122
|
+
* dispatch. Useful for gating pending placeholder rows on `In-Progress` /
|
|
123
|
+
* swapping them out on `Completed`.
|
|
124
|
+
*/
|
|
125
|
+
const getIssueChargeCardsSaveStatus = (state) => {
|
|
126
|
+
return state.issueChargeCardState.saveStatus;
|
|
127
|
+
};
|
|
128
|
+
exports.getIssueChargeCardsSaveStatus = getIssueChargeCardsSaveStatus;
|
|
129
|
+
/**
|
|
130
|
+
* Returns the number of card rows currently being bulk-issued via the most
|
|
131
|
+
* recent `issueChargeCards` dispatch. Mirrors `localData.length` while the
|
|
132
|
+
* call is in flight so the cards list screen can render N skeleton rows at
|
|
133
|
+
* the top of the table.
|
|
134
|
+
*/
|
|
135
|
+
const getInFlightIssueChargeCardsCount = (state) => {
|
|
136
|
+
if (state.issueChargeCardState.saveStatus.fetchState !== 'In-Progress') {
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
return state.issueChargeCardState.localData.length;
|
|
140
|
+
};
|
|
141
|
+
exports.getInFlightIssueChargeCardsCount = getInFlightIssueChargeCardsCount;
|
|
@@ -6,8 +6,10 @@ export interface IssueChargeCardState extends FetchedState {
|
|
|
6
6
|
activeDebitCardCountByDepositAccountId: Record<ID, ActiveDebitCardCountByUserId>;
|
|
7
7
|
depositAccountIds: ID[];
|
|
8
8
|
depositAccountsFetchState: FetchStateAndError;
|
|
9
|
+
lastIssuedCardIds: ID[];
|
|
9
10
|
localData: IssueChargeCardLocalData[];
|
|
10
11
|
saveStatus: FetchStateAndError;
|
|
12
|
+
lastIssueSourceChatSessionId?: ID;
|
|
11
13
|
lastSelfIssuedDebitCardId?: ID;
|
|
12
14
|
}
|
|
13
15
|
export interface ActiveChargeCardCount {
|
|
@@ -14,7 +14,7 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
14
14
|
archived?: TaskPayload[];
|
|
15
15
|
deleted?: TaskPayload[];
|
|
16
16
|
snoozed?: TaskPayload[];
|
|
17
|
-
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "
|
|
17
|
+
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "archived" | "live" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
18
|
fetchState: FetchState;
|
|
19
19
|
error?: ZeniAPIStatus;
|
|
20
20
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "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
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "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
|
+
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";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
|
@@ -3,7 +3,7 @@ import { TransactionPayload } from '../../entity/transaction/payloadTypes/transa
|
|
|
3
3
|
import { SupportedTransactionPayload } from '../../entity/transaction/transactionState';
|
|
4
4
|
import { VendorPayload } from '../../entity/vendor/vendorPayload';
|
|
5
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
6
|
-
|
|
6
|
+
interface TransactionDetailPayload {
|
|
7
7
|
query: {
|
|
8
8
|
transaction_id: string;
|
|
9
9
|
transaction_type: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { NestedClassHierarchyForReport } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import {
|
|
3
|
+
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
4
4
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
-
import { AccountBase } from '../../entity/account/accountState';
|
|
6
5
|
import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
7
6
|
import { SupportedTransactionWithCOT } from '../../entity/transaction/transactionState';
|
|
8
7
|
import { Vendor } from '../../entity/vendor/vendorState';
|
|
@@ -18,9 +17,6 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
18
17
|
allVendors: Vendor[];
|
|
19
18
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
20
19
|
classList: ClassListSelectorView;
|
|
21
|
-
createTransferEntryStatus: FetchState;
|
|
22
|
-
/** Resolved credit-card pool for credit_card_payment transfer drawer. */
|
|
23
|
-
creditCardTransferAccountsList: AccountBase[];
|
|
24
20
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
25
21
|
hasInFlightCategoryClassRecommendations: boolean;
|
|
26
22
|
isAccountingClassesEnabled: boolean;
|
|
@@ -29,7 +25,6 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
29
25
|
projectList: ProjectListSelectorView;
|
|
30
26
|
transactionDetailLocalData: TransactionDetailLocalData;
|
|
31
27
|
transactionDetailUpdateStatus: FetchStateAndError;
|
|
32
|
-
transferAccounts: AccountBase[];
|
|
33
28
|
isUpdateNotAllowed?: boolean;
|
|
34
29
|
transaction?: SupportedTransactionWithCOT;
|
|
35
30
|
}
|
|
@@ -15,7 +15,6 @@ const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
|
|
|
15
15
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
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 transactionDetailState_1 = require("./transactionDetailState");
|
|
21
20
|
// "Any line on this transaction is fetching category/class recommendations?"
|
|
@@ -40,7 +39,7 @@ const getDetailInFlightRecommendations = (state, transactionId) => {
|
|
|
40
39
|
};
|
|
41
40
|
exports.getDetailInFlightRecommendations = getDetailInFlightRecommendations;
|
|
42
41
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
43
|
-
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState,
|
|
42
|
+
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
44
43
|
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
45
44
|
const transactionDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, detailKey);
|
|
46
45
|
let fetchState = {
|
|
@@ -107,7 +106,6 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
107
106
|
: [];
|
|
108
107
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
109
108
|
const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
|
|
110
|
-
const { transferAccountsList, creditCardTransferAccountsList } = (0, createTransferEntrySelector_1.getResolvedTransferAccounts)(state);
|
|
111
109
|
const hasInFlightCategoryClassRecommendations = (0, exports.getDetailInFlightRecommendations)(state, transactionId);
|
|
112
110
|
return {
|
|
113
111
|
reportId: 'transaction_detail',
|
|
@@ -126,9 +124,6 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
126
124
|
classList: classList,
|
|
127
125
|
hasInFlightCategoryClassRecommendations,
|
|
128
126
|
isAccountingClassesEnabled,
|
|
129
|
-
createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
|
|
130
|
-
creditCardTransferAccountsList,
|
|
131
|
-
transferAccounts: transferAccountsList,
|
|
132
127
|
isAccountingProjectsEnabled,
|
|
133
128
|
projectList,
|
|
134
129
|
isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.81-
|
|
3
|
+
"version": "5.0.81-betaRR0",
|
|
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",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { initialCreateTransferEntryState, } from './createTransferEntryState';
|
|
3
|
-
export const initialState = initialCreateTransferEntryState;
|
|
4
|
-
const createTransferEntrySlice = createSlice({
|
|
5
|
-
name: 'createTransferEntry',
|
|
6
|
-
initialState,
|
|
7
|
-
reducers: {
|
|
8
|
-
fetchAccountsForTransferFlow(draft, action) {
|
|
9
|
-
const slice = draft.transferAccountsByType[action.payload.kind];
|
|
10
|
-
// Idempotent: a duplicate dispatch must not briefly downgrade
|
|
11
|
-
// 'Completed' back to 'In-Progress' (would clear loaded data from a
|
|
12
|
-
// consumer's perspective) nor restart the in-flight epic stream.
|
|
13
|
-
// The hook (`useFetchTransferAccountsForFlow`) is the sole caller and
|
|
14
|
-
// already dedupes via `store.getState()`; this guard is defense in
|
|
15
|
-
// depth for any future caller.
|
|
16
|
-
if (slice.fetchState === 'In-Progress' ||
|
|
17
|
-
slice.fetchState === 'Completed') {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
slice.fetchState = 'In-Progress';
|
|
21
|
-
},
|
|
22
|
-
updateAccountsForTransferFlow(draft, action) {
|
|
23
|
-
const slice = draft.transferAccountsByType[action.payload.kind];
|
|
24
|
-
slice.fetchState = 'Completed';
|
|
25
|
-
slice.accountIds = action.payload.accountIds;
|
|
26
|
-
},
|
|
27
|
-
updateAccountsForTransferFlowFailure(draft, action) {
|
|
28
|
-
draft.transferAccountsByType[action.payload.kind].fetchState = 'Error';
|
|
29
|
-
},
|
|
30
|
-
createTransferEntry: {
|
|
31
|
-
prepare(payload) {
|
|
32
|
-
return { payload };
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* Defense-in-depth: clear any stale `lastTransferEntryReplacement` on a
|
|
36
|
-
* fresh dispatch so a second `createTransferEntry` never inherits the
|
|
37
|
-
* previous run's replacement signal (e.g. if the prior `timer(0)` cleanup
|
|
38
|
-
* never fired). Mirrors the host hook's `consumedReplacementRef` guard
|
|
39
|
-
* (see `useTransferEntryRouteReplacement` in zeni-web-app-ui).
|
|
40
|
-
*/
|
|
41
|
-
reducer(draft) {
|
|
42
|
-
draft.createTransferEntryStatus = 'In-Progress';
|
|
43
|
-
draft.lastTransferEntryReplacement = undefined;
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
createTransferEntrySuccess(draft) {
|
|
47
|
-
draft.createTransferEntryStatus = 'Completed';
|
|
48
|
-
},
|
|
49
|
-
createTransferEntryFailure(draft) {
|
|
50
|
-
draft.createTransferEntryStatus = 'Error';
|
|
51
|
-
},
|
|
52
|
-
resetCreateTransferEntryStatus(draft) {
|
|
53
|
-
draft.createTransferEntryStatus = 'Not-Started';
|
|
54
|
-
},
|
|
55
|
-
createTransferEntryReplacedTransaction: {
|
|
56
|
-
prepare(previousTransactionId, newTransactionId) {
|
|
57
|
-
return { payload: { newTransactionId, previousTransactionId } };
|
|
58
|
-
},
|
|
59
|
-
reducer(draft, action) {
|
|
60
|
-
draft.lastTransferEntryReplacement = action.payload;
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* One-shot acknowledgement: the host has consumed the route-replacement
|
|
65
|
-
* signal and navigated to the new transaction url, so we can drop the
|
|
66
|
-
* record. Re-dispatching is idempotent.
|
|
67
|
-
*/
|
|
68
|
-
clearTransferEntryRouteReplacement(draft) {
|
|
69
|
-
draft.lastTransferEntryReplacement = undefined;
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Full slice reset. Dispatched from `clearAllEpic` on tenant switch so
|
|
73
|
-
* stale per-tenant state (account-id pools, status, replacement signal)
|
|
74
|
-
* doesn't bleed across tenants.
|
|
75
|
-
*/
|
|
76
|
-
clearCreateTransferEntry(draft) {
|
|
77
|
-
Object.assign(draft, initialState);
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
export const { fetchAccountsForTransferFlow, updateAccountsForTransferFlow, updateAccountsForTransferFlowFailure, createTransferEntry, createTransferEntrySuccess, createTransferEntryFailure, resetCreateTransferEntryStatus, createTransferEntryReplacedTransaction, clearTransferEntryRouteReplacement, clearCreateTransferEntry, } = createTransferEntrySlice.actions;
|
|
82
|
-
export default createTransferEntrySlice.reducer;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createSelector } from '@reduxjs/toolkit';
|
|
2
|
-
import { getAccountBase, getAccountBaseForCreditCardTransferAccounts, getAccountBaseForTransferAccounts, } from '../../entity/account/accountSelector';
|
|
3
|
-
import { getAccountList } from '../accountList/accountListSelector';
|
|
4
|
-
export function getCreateTransferEntryStatus(state) {
|
|
5
|
-
return state.createTransferEntryState.createTransferEntryStatus;
|
|
6
|
-
}
|
|
7
|
-
export function getLastTransferEntryReplacement(state) {
|
|
8
|
-
return state.createTransferEntryState.lastTransferEntryReplacement;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Shared resolver for the credit/debit dropdowns in the transfer drawer.
|
|
12
|
-
*
|
|
13
|
-
* Resolution policy (intentional):
|
|
14
|
-
* 1. Prefer the dedicated API fetch results (`transferEntryEligible` for the
|
|
15
|
-
* debit pool, `creditCardOnlyEligible` for the credit-card-payment credit
|
|
16
|
-
* pool).
|
|
17
|
-
* 2. If the dedicated fetch returns an empty list while the COA is loaded,
|
|
18
|
-
* fall back to the COA: the full account list for `transferEntryEligible`,
|
|
19
|
-
* and COA accounts filtered to `credit_card` for `creditCardOnlyEligible`.
|
|
20
|
-
* This keeps the dropdown populated for older tenants where the dedicated
|
|
21
|
-
* endpoints haven't been backfilled yet.
|
|
22
|
-
*
|
|
23
|
-
* Intent — what this selector deliberately does NOT do:
|
|
24
|
-
* - Does NOT distinguish "fetch in-flight" / "fetch errored" / "fetch returned
|
|
25
|
-
* empty" — all three collapse to the COA fallback. The product preference
|
|
26
|
-
* is "always show something selectable" over "show a spinner that may never
|
|
27
|
-
* resolve". Loading/error UI belongs in the view layer; if you need a
|
|
28
|
-
* spinner, observe the `fetchState` on `transferAccountsByType[kind]`
|
|
29
|
-
* separately rather than changing the resolution policy here.
|
|
30
|
-
* - Does NOT enforce "API result is authoritative even if empty" — a tenant
|
|
31
|
-
* whose dedicated endpoint is correctly returning `[]` (e.g. no eligible
|
|
32
|
-
* transfer destinations) will still see the COA. That trade-off is
|
|
33
|
-
* accepted because the alternative blocks the user from picking anything;
|
|
34
|
-
* the backend distinguishes "no result" from "endpoint not implemented" by
|
|
35
|
-
* surfacing an error response, which the view layer handles separately.
|
|
36
|
-
*
|
|
37
|
-
* Memoized with reselect so consuming view-models don't recompute on every
|
|
38
|
-
* unrelated state change.
|
|
39
|
-
*/
|
|
40
|
-
export const getResolvedTransferAccounts = createSelector([
|
|
41
|
-
(state) => state.accountState,
|
|
42
|
-
(state) => state.accountListState,
|
|
43
|
-
(state) => state.createTransferEntryState.transferAccountsByType
|
|
44
|
-
.transferEntryEligible.accountIds,
|
|
45
|
-
(state) => state.createTransferEntryState.transferAccountsByType
|
|
46
|
-
.creditCardOnlyEligible.accountIds,
|
|
47
|
-
], (accountState, accountListState, transferEligibleIds, creditCardOnlyIds) => {
|
|
48
|
-
const accountList = getAccountList(accountState, accountListState, 'accountList');
|
|
49
|
-
const transferEligibleFromApi = transferEligibleIds
|
|
50
|
-
.map((id) => getAccountBaseForTransferAccounts(accountState, id))
|
|
51
|
-
.filter((account) => account != null);
|
|
52
|
-
const coaFallbackAllAccounts = accountList.accounts
|
|
53
|
-
.map((a) => getAccountBase(accountState, a.accountId, 'account_list'))
|
|
54
|
-
.filter((account) => account != null);
|
|
55
|
-
const transferAccountsList = transferEligibleFromApi.length > 0
|
|
56
|
-
? transferEligibleFromApi
|
|
57
|
-
: coaFallbackAllAccounts;
|
|
58
|
-
const creditCardFromApi = creditCardOnlyIds
|
|
59
|
-
.map((id) => getAccountBaseForCreditCardTransferAccounts(accountState, id))
|
|
60
|
-
.filter((account) => account != null);
|
|
61
|
-
const coaFallbackCreditCards = coaFallbackAllAccounts.filter((a) => a.accountType === 'credit_card');
|
|
62
|
-
const creditCardTransferAccountsList = creditCardFromApi.length > 0 ? creditCardFromApi : coaFallbackCreditCards;
|
|
63
|
-
return { creditCardTransferAccountsList, transferAccountsList };
|
|
64
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Which pool `fetchAccountsForTransferFlow` / transfer-flow epic should load. */
|
|
2
|
-
export const TRANSFER_ACCOUNTS_FETCH_TYPE = [
|
|
3
|
-
'transferEntryEligible',
|
|
4
|
-
'creditCardOnlyEligible',
|
|
5
|
-
];
|
|
6
|
-
const initialTransferAccountsState = {
|
|
7
|
-
accountIds: [],
|
|
8
|
-
fetchState: 'Not-Started',
|
|
9
|
-
};
|
|
10
|
-
export const initialCreateTransferEntryState = {
|
|
11
|
-
createTransferEntryStatus: 'Not-Started',
|
|
12
|
-
lastTransferEntryReplacement: undefined,
|
|
13
|
-
transferAccountsByType: {
|
|
14
|
-
transferEntryEligible: initialTransferAccountsState,
|
|
15
|
-
creditCardOnlyEligible: initialTransferAccountsState,
|
|
16
|
-
},
|
|
17
|
-
};
|