@zeniai/client-epic-state 5.0.77 → 5.0.78
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/coreEpics.js +1 -1
- package/lib/entity/account/accountSelector.d.ts +1 -27
- package/lib/entity/account/accountSelector.js +1 -47
- package/lib/entity/account/accountState.d.ts +1 -6
- package/lib/entity/account/accountState.js +4 -11
- package/lib/entity/account/subAccountSelector.d.ts +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
- package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
- package/lib/entity/class/classSelector.d.ts +0 -35
- package/lib/entity/class/classSelector.js +0 -50
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/entity/tenant/SessionManager.js +3 -6
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +2 -2
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/entity/tenant/tenantReducer.js +1 -6
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/epic.d.ts +10 -11
- package/lib/epic.js +11 -12
- package/lib/esm/coreEpics.js +1 -1
- package/lib/esm/entity/account/accountSelector.js +1 -46
- package/lib/esm/entity/account/accountState.js +1 -7
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +3 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +2 -1
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/entity/class/classSelector.js +0 -48
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
- package/lib/esm/entity/tenant/SessionManager.js +1 -4
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +2 -6
- package/lib/esm/entity/tenant/tenantReducer.js +1 -6
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +1 -3
- package/lib/esm/epic.js +11 -12
- package/lib/esm/index.js +20 -30
- package/lib/esm/reducer.js +2 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
- package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -21
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -147
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/esm/view/recommendation/recommendationHelper.js +0 -29
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -26
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -26
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +2 -4
- package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +6 -121
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +1 -29
- package/lib/index.d.ts +23 -30
- package/lib/index.js +58 -84
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.js +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +5 -2
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +1 -4
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
- package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
- package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +6 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +1 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -23
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -28
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -253
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -16
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -7
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -150
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -44
- package/lib/view/financeStatement/financeStatementSelector.js +1 -1
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
- package/lib/view/recommendation/recommendationHelper.d.ts +0 -9
- package/lib/view/recommendation/recommendationHelper.js +1 -31
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -20
- package/lib/view/recommendation/recommendationReducer.js +2 -27
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -27
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +3 -12
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +2 -4
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +1 -11
- package/lib/view/transactionDetail/transactionDetailReducer.js +7 -122
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +0 -2
- package/lib/view/transactionDetail/transactionDetailSelector.js +2 -31
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
- package/package.json +4 -9
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
- package/lib/commonStateTypes/filterPrimitives.d.ts +0 -23
- package/lib/commonStateTypes/filterPrimitives.js +0 -21
- package/lib/commonStateTypes/pusherActions.d.ts +0 -11
- package/lib/commonStateTypes/pusherActions.js +0 -6
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
- package/lib/esm/commonStateTypes/filterPrimitives.js +0 -20
- package/lib/esm/commonStateTypes/pusherActions.js +0 -3
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +0 -258
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -87
- package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +0 -66
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +0 -262
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +0 -9
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +0 -91
package/lib/coreEpics.js
CHANGED
|
@@ -23,8 +23,8 @@ const fetchSubscriptionSummaryForTenantEpic_1 = require("./entity/tenant/epic/fe
|
|
|
23
23
|
const resendVerifyDeviceOTPEpic_1 = require("./entity/tenant/epic/resendVerifyDeviceOTPEpic");
|
|
24
24
|
const saveExternalConnectionEpic_1 = require("./entity/tenant/epic/saveExternalConnectionEpic");
|
|
25
25
|
const sendEmailMagicLinkToUserEpic_1 = require("./entity/tenant/epic/sendEmailMagicLinkToUserEpic");
|
|
26
|
-
const sessionHeartbeatEpic_1 = require("./entity/tenant/epic/sessionHeartbeatEpic");
|
|
27
26
|
const signInUserEpic_1 = require("./entity/tenant/epic/signInUserEpic");
|
|
27
|
+
const sessionHeartbeatEpic_1 = require("./entity/tenant/epic/sessionHeartbeatEpic");
|
|
28
28
|
const signOutUserEpic_1 = require("./entity/tenant/epic/signOutUserEpic");
|
|
29
29
|
const verifyDeviceWithTwoFAEpic_1 = require("./entity/tenant/epic/verifyDeviceWithTwoFAEpic");
|
|
30
30
|
// ── Toast Notification Epic ──────────────────────────────────────────
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
3
4
|
import { AdditionalBalancesOptions } from '../../commonStateTypes/coaBalance/additionalBalances/getAdditionalBalances';
|
|
4
5
|
import { COABalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
|
|
5
6
|
import { ID } from '../../commonStateTypes/common';
|
|
6
|
-
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
7
7
|
import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
8
8
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
9
9
|
import { Account, AccountBase, AccountState, AccountType } from './accountState';
|
|
@@ -123,29 +123,3 @@ export declare const getAccountsOrdered: (filter: COABalancesFilter, accountStat
|
|
|
123
123
|
export declare const getAccountsByType: (accountState: AccountState, accountTypes: AccountType[]) => Partial<Record<AccountType, Account[]>>;
|
|
124
124
|
export declare const getAccountIdsForTypes: (accountState: AccountState, accountTypes: AccountType[]) => ID[];
|
|
125
125
|
export declare const getAccountIdsForLabels: (accountState: AccountState, labels: string[]) => ID[];
|
|
126
|
-
/**
|
|
127
|
-
* Returns all accounts currently in state (single pass over accountsByKey).
|
|
128
|
-
* Use for dropdowns that need account names and types; map to
|
|
129
|
-
* { accountId, accountName, accountType } as needed.
|
|
130
|
-
*/
|
|
131
|
-
export declare const getAllAccounts: (accountState: AccountState) => Account[];
|
|
132
|
-
export interface AccountFilterOption {
|
|
133
|
-
accountId: ID;
|
|
134
|
-
accountName: string;
|
|
135
|
-
accountType: AccountType;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
|
|
139
|
-
* all other account types → categoryOptions. Use for payment_account_name and category filter options.
|
|
140
|
-
*
|
|
141
|
-
* Memoised via `createSelector` so the composite `{categoryOptions,
|
|
142
|
-
* paymentAccountNames}` keeps a stable identity across Redux dispatches that
|
|
143
|
-
* don't change account data. Without this, every consumer using
|
|
144
|
-
* `useSelector(state => getTransactionFilterAccountOptions(state.accountState))`
|
|
145
|
-
* would re-render on every dispatch (the inline call returns a fresh outer
|
|
146
|
-
* object each time, defeating reference equality).
|
|
147
|
-
*/
|
|
148
|
-
export declare const getTransactionFilterAccountOptions: (accountState: AccountState) => {
|
|
149
|
-
categoryOptions: AccountFilterOption[];
|
|
150
|
-
paymentAccountNames: AccountFilterOption[];
|
|
151
|
-
};
|
|
@@ -3,10 +3,9 @@ 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.getAccountIdsForLabels = exports.getAccountIdsForTypes = exports.getAccountsByType = exports.getAccountsOrdered = exports.getAccountBase = void 0;
|
|
7
7
|
exports.getAccount = getAccount;
|
|
8
8
|
exports.getAccountWithBalance = getAccountWithBalance;
|
|
9
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
10
9
|
const flatMap_1 = __importDefault(require("lodash/flatMap"));
|
|
11
10
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
12
11
|
const sortBalancesByFreeRangeTotal_1 = require("../../commonStateTypes/coaBalance/sortBalancesByFreeRangeTotal");
|
|
@@ -193,48 +192,3 @@ const getAccountIdsForLabels = (accountState, labels) => {
|
|
|
193
192
|
return allAccountIdsForLabels;
|
|
194
193
|
};
|
|
195
194
|
exports.getAccountIdsForLabels = getAccountIdsForLabels;
|
|
196
|
-
/**
|
|
197
|
-
* Returns all accounts currently in state (single pass over accountsByKey).
|
|
198
|
-
* Use for dropdowns that need account names and types; map to
|
|
199
|
-
* { accountId, accountName, accountType } as needed.
|
|
200
|
-
*/
|
|
201
|
-
const getAllAccounts = (accountState) => Object.values(accountState.accountsByKey);
|
|
202
|
-
exports.getAllAccounts = getAllAccounts;
|
|
203
|
-
/**
|
|
204
|
-
* Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
|
|
205
|
-
* all other account types → categoryOptions. Use for payment_account_name and category filter options.
|
|
206
|
-
*
|
|
207
|
-
* Memoised via `createSelector` so the composite `{categoryOptions,
|
|
208
|
-
* paymentAccountNames}` keeps a stable identity across Redux dispatches that
|
|
209
|
-
* don't change account data. Without this, every consumer using
|
|
210
|
-
* `useSelector(state => getTransactionFilterAccountOptions(state.accountState))`
|
|
211
|
-
* would re-render on every dispatch (the inline call returns a fresh outer
|
|
212
|
-
* object each time, defeating reference equality).
|
|
213
|
-
*/
|
|
214
|
-
exports.getTransactionFilterAccountOptions = (0, toolkit_1.createSelector)(
|
|
215
|
-
// Key the memo on the underlying `accountsByKey` record rather than on
|
|
216
|
-
// `getAllAccounts` output: the latter returns a fresh `Object.values(...)`
|
|
217
|
-
// array on every call, which would defeat reselect's reference-equality
|
|
218
|
-
// check and re-run the projection on every dispatch.
|
|
219
|
-
[(accountState) => accountState.accountsByKey], (accountsByKey) => {
|
|
220
|
-
const accounts = Object.values(accountsByKey);
|
|
221
|
-
const paymentAccountNames = [];
|
|
222
|
-
const categoryOptions = [];
|
|
223
|
-
for (const account of accounts) {
|
|
224
|
-
if (account.accountType == null) {
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
const option = {
|
|
228
|
-
accountId: account.accountId,
|
|
229
|
-
accountName: account.accountName,
|
|
230
|
-
accountType: account.accountType,
|
|
231
|
-
};
|
|
232
|
-
if ((0, accountState_1.isPaymentAccountType)(account.accountType)) {
|
|
233
|
-
paymentAccountNames.push(option);
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
categoryOptions.push(option);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return { categoryOptions, paymentAccountNames };
|
|
240
|
-
});
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { Balance } from '../../commonStateTypes/balance';
|
|
3
3
|
import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
4
|
+
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
4
5
|
import { COABalanceGrouped, COABalanceGroupedByPeriod } from '../../commonStateTypes/coaBalance/coaBalance';
|
|
5
6
|
import { ID } from '../../commonStateTypes/common';
|
|
6
|
-
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
7
7
|
import { RecommendationBase } from '../../commonStateTypes/recommendationBase';
|
|
8
8
|
import { Status } from '../../commonStateTypes/status';
|
|
9
9
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
10
10
|
import { ZeniUrl } from '../../zeniUrl';
|
|
11
|
-
export declare const ALL_ACCOUNT_TYPES: readonly ["bank", "credit_card", "expenses", "cogs", "income", "cash_in", "cash_out", "cash_position", "other_income", "other_expense", "accounts_receivable", "other_current_assets", "fixed_assets", "other_assets", "accounts_payable", "other_current_liabilities", "long_term_liabilities", "equity", "current_liabilities", "current_assets"];
|
|
12
11
|
export declare const toAccountType: (v: string) => "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets";
|
|
13
12
|
export type AccountType = ReturnType<typeof toAccountType>;
|
|
14
13
|
export declare const toAccountTypeStrict: (v: string | null | undefined) => AccountType | undefined;
|
|
15
|
-
/** Account types used for payment-account filters (e.g. transaction filter "payment account name"). */
|
|
16
|
-
export declare const PAYMENT_ACCOUNT_TYPES: readonly ["bank", "credit_card"];
|
|
17
|
-
export type PaymentAccountType = (typeof PAYMENT_ACCOUNT_TYPES)[number];
|
|
18
|
-
export declare function isPaymentAccountType(accountType: AccountType | undefined): accountType is PaymentAccountType;
|
|
19
14
|
export type UncategorizedAccountTypes = 'expense' | 'income';
|
|
20
15
|
declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
|
|
21
16
|
export type AccountLabel = ReturnType<typeof toAccountLabel>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReconciliationAccountSourceStrict = exports.toReconciliationAccountSource = exports.toAccountLabelStrict = exports.
|
|
4
|
-
exports.isPaymentAccountType = isPaymentAccountType;
|
|
3
|
+
exports.toReconciliationAccountSourceStrict = exports.toReconciliationAccountSource = exports.toAccountLabelStrict = exports.toAccountTypeStrict = exports.toAccountType = void 0;
|
|
5
4
|
exports.getAccountKey = getAccountKey;
|
|
6
5
|
const nestedAccountID_1 = require("../../commonStateTypes/accountView/nestedAccountID");
|
|
7
6
|
const nestedClassID_1 = require("../../commonStateTypes/classesView/nestedClassID");
|
|
8
7
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
9
|
-
|
|
8
|
+
const ALL_ACCOUNT_TYPES = [
|
|
10
9
|
'bank',
|
|
11
10
|
'credit_card',
|
|
12
11
|
'expenses',
|
|
@@ -28,16 +27,10 @@ exports.ALL_ACCOUNT_TYPES = [
|
|
|
28
27
|
'current_liabilities',
|
|
29
28
|
'current_assets',
|
|
30
29
|
];
|
|
31
|
-
const toAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v,
|
|
30
|
+
const toAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_ACCOUNT_TYPES);
|
|
32
31
|
exports.toAccountType = toAccountType;
|
|
33
|
-
const toAccountTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '',
|
|
32
|
+
const toAccountTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_ACCOUNT_TYPES);
|
|
34
33
|
exports.toAccountTypeStrict = toAccountTypeStrict;
|
|
35
|
-
/** Account types used for payment-account filters (e.g. transaction filter "payment account name"). */
|
|
36
|
-
exports.PAYMENT_ACCOUNT_TYPES = ['bank', 'credit_card'];
|
|
37
|
-
function isPaymentAccountType(accountType) {
|
|
38
|
-
return (accountType != null &&
|
|
39
|
-
exports.PAYMENT_ACCOUNT_TYPES.includes(accountType));
|
|
40
|
-
}
|
|
41
34
|
const ALL_ACCOUNT_LABELS = [
|
|
42
35
|
'uncategorized_income',
|
|
43
36
|
'uncategorized_expense',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccountsViewParentID, NestedAccountID, NestedAccountIDHierarchy } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
3
4
|
import { AdditionalBalancesOptions } from '../../commonStateTypes/coaBalance/additionalBalances/getAdditionalBalances';
|
|
4
5
|
import { COABalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
|
|
5
|
-
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
6
6
|
import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
7
7
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
8
8
|
import { AccountReport } from './accountSelector';
|
|
@@ -22,7 +22,9 @@ const toAccuracyByModel = (accuracyPayload) => {
|
|
|
22
22
|
const toAiAccountantEnrollment = (payload) => ({
|
|
23
23
|
status: (0, aiAccountantCustomerState_1.toAiAccountantEnrollmentStatus)(payload.status),
|
|
24
24
|
accuracy: toAccuracyByModel(payload.accuracy),
|
|
25
|
-
latestTraining: payload.latest_training != null
|
|
25
|
+
latestTraining: payload.latest_training != null
|
|
26
|
+
? (0, zeniDayJS_1.date)(payload.latest_training)
|
|
27
|
+
: undefined,
|
|
26
28
|
latestTransactionSync: payload.latest_transaction_sync != null
|
|
27
29
|
? (0, zeniDayJS_1.date)(payload.latest_transaction_sync)
|
|
28
30
|
: undefined,
|
|
@@ -31,7 +31,8 @@ const aiAccountantCustomer = (0, toolkit_1.createSlice)({
|
|
|
31
31
|
const existing = draft.jobsByTenantId[action.payload.tenantId] ?? [];
|
|
32
32
|
const jobMap = new Map(existing.map((job) => [job.jobId, job]));
|
|
33
33
|
mappedJobs.forEach((job) => jobMap.set(job.jobId, job));
|
|
34
|
-
draft.jobsByTenantId[action.payload.tenantId] =
|
|
34
|
+
draft.jobsByTenantId[action.payload.tenantId] =
|
|
35
|
+
Array.from(jobMap.values());
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
37
38
|
draft.jobsByTenantId[action.payload.tenantId] = mappedJobs;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
2
|
import { User } from '../user/userState';
|
|
4
3
|
import { UserState } from '../user/userState';
|
|
4
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { AiAccountantCustomerState, AiAccountantEnrollmentStatus, AiAccountantJobStatus, AiAccountantOperationType } from './aiAccountantCustomerState';
|
|
6
6
|
export interface AiAccountantEnrollmentView {
|
|
7
7
|
status: AiAccountantEnrollmentStatus;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateType } from '../../commonStateTypes/common';
|
|
2
2
|
import { ChargeCardState } from './chargeCard';
|
|
3
3
|
import { ChargeCardPayload } from './chargeCardPayload';
|
|
4
4
|
export declare const initialState: ChargeCardState;
|
|
5
5
|
export declare const updateChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCards: ChargeCardPayload[], updateType?: UpdateType | undefined], ChargeCardPayload[], "chargeCard/updateChargeCards", never, {
|
|
6
6
|
updateType: UpdateType;
|
|
7
|
-
}>, updateChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPayload, "chargeCard/updateChargeCard">,
|
|
8
|
-
cardId: ID;
|
|
9
|
-
cardStatus: {
|
|
10
|
-
code: string;
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
isLockedByAdmin: boolean | undefined;
|
|
14
|
-
}, "chargeCard/updateChargeCardStatusFromPusher">, updateChargeCardSpendingFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
-
cardId: ID;
|
|
16
|
-
currencyCode: string;
|
|
17
|
-
currencySymbol: string;
|
|
18
|
-
balance?: number;
|
|
19
|
-
dailyPurchaseSpends?: number;
|
|
20
|
-
dailyWithdrawals?: number;
|
|
21
|
-
hold?: number;
|
|
22
|
-
monthlyPurchaseSpends?: number;
|
|
23
|
-
monthlyWithdrawals?: number;
|
|
24
|
-
}, "chargeCard/updateChargeCardSpendingFromPusher">, removeChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCard/removeChargeCard">, clearAllChargeCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCard/clearAllChargeCards">;
|
|
7
|
+
}>, updateChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPayload, "chargeCard/updateChargeCard">, removeChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCard/removeChargeCard">, clearAllChargeCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCard/clearAllChargeCards">;
|
|
25
8
|
declare const _default: import("redux").Reducer<ChargeCardState>;
|
|
26
9
|
export default _default;
|
|
@@ -4,11 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.clearAllChargeCards = exports.removeChargeCard = exports.
|
|
7
|
+
exports.clearAllChargeCards = exports.removeChargeCard = exports.updateChargeCard = exports.updateChargeCards = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
10
|
-
const amount_1 = require("../../commonStateTypes/amount");
|
|
11
|
-
const chargeCard_1 = require("./chargeCard");
|
|
12
10
|
const chargeCardPayload_1 = require("./chargeCardPayload");
|
|
13
11
|
exports.initialState = {
|
|
14
12
|
chargeCardByID: {},
|
|
@@ -44,37 +42,6 @@ const chargeCard = (0, toolkit_1.createSlice)({
|
|
|
44
42
|
const latestChargeCard = (0, chargeCardPayload_1.mapChargeCardPayloadToChargeCard)(action.payload);
|
|
45
43
|
draft.chargeCardByID[latestChargeCard.id] = latestChargeCard;
|
|
46
44
|
},
|
|
47
|
-
updateChargeCardStatusFromPusher(draft, action) {
|
|
48
|
-
const { cardId, cardStatus, isLockedByAdmin } = action.payload;
|
|
49
|
-
const card = draft.chargeCardByID[cardId];
|
|
50
|
-
if (card != null) {
|
|
51
|
-
card.status = {
|
|
52
|
-
code: (0, chargeCard_1.toCardStatusCodeType)(cardStatus.code),
|
|
53
|
-
name: cardStatus.name,
|
|
54
|
-
};
|
|
55
|
-
if (isLockedByAdmin !== undefined) {
|
|
56
|
-
card.isLockedByAdmin = isLockedByAdmin;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
updateChargeCardSpendingFromPusher(draft, action) {
|
|
61
|
-
const { cardId, currencyCode, currencySymbol } = action.payload;
|
|
62
|
-
const card = draft.chargeCardByID[cardId];
|
|
63
|
-
if (card == null) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const amt = (v) => v !== undefined ? (0, amount_1.toAmount)(v, currencyCode, currencySymbol) : undefined;
|
|
67
|
-
card.balance = amt(action.payload.balance) ?? card.balance;
|
|
68
|
-
card.hold = amt(action.payload.hold) ?? card.hold;
|
|
69
|
-
card.dailyPurchaseSpends =
|
|
70
|
-
amt(action.payload.dailyPurchaseSpends) ?? card.dailyPurchaseSpends;
|
|
71
|
-
card.monthlyPurchaseSpends =
|
|
72
|
-
amt(action.payload.monthlyPurchaseSpends) ?? card.monthlyPurchaseSpends;
|
|
73
|
-
card.dailyWithdrawals =
|
|
74
|
-
amt(action.payload.dailyWithdrawals) ?? card.dailyWithdrawals;
|
|
75
|
-
card.monthlyWithdrawals =
|
|
76
|
-
amt(action.payload.monthlyWithdrawals) ?? card.monthlyWithdrawals;
|
|
77
|
-
},
|
|
78
45
|
removeChargeCard(draft, action) {
|
|
79
46
|
delete draft.chargeCardByID[action.payload];
|
|
80
47
|
},
|
|
@@ -83,5 +50,5 @@ const chargeCard = (0, toolkit_1.createSlice)({
|
|
|
83
50
|
},
|
|
84
51
|
},
|
|
85
52
|
});
|
|
86
|
-
_a = chargeCard.actions, exports.updateChargeCards = _a.updateChargeCards, exports.updateChargeCard = _a.updateChargeCard, exports.
|
|
53
|
+
_a = chargeCard.actions, exports.updateChargeCards = _a.updateChargeCards, exports.updateChargeCard = _a.updateChargeCard, exports.removeChargeCard = _a.removeChargeCard, exports.clearAllChargeCards = _a.clearAllChargeCards;
|
|
87
54
|
exports.default = chargeCard.reducer;
|
|
@@ -5,20 +5,7 @@ export declare const initialState: ChargeCardTransactionState;
|
|
|
5
5
|
export declare const updateChargeCardTransactions: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardTransactionPayload[], "chargeCardTransaction/updateChargeCardTransactions">, updateChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardTransactionPayload, "chargeCardTransaction/updateChargeCardTransaction">, updateChargeCardTransactionAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
6
|
data: TransactionReceiptsPayload;
|
|
7
7
|
transactionId: ID;
|
|
8
|
-
}, "chargeCardTransaction/updateChargeCardTransactionAttachments">,
|
|
9
|
-
transactionId: ID;
|
|
10
|
-
transactionStatus: {
|
|
11
|
-
code: string;
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
}, "chargeCardTransaction/updateChargeCardTransactionStatusFromPusher">, updateChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
-
cardId: ID;
|
|
16
|
-
transaction: ChargeCardTransactionPayload;
|
|
17
|
-
}, "chargeCardTransaction/updateChargeCardTransactionFromPusher">, updateChargeCardTransactionReceiptFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
-
attachmentFilePaths: string[];
|
|
19
|
-
cardId: ID;
|
|
20
|
-
transactionId: ID;
|
|
21
|
-
}, "chargeCardTransaction/updateChargeCardTransactionReceiptFromPusher">, removeChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardTransaction/removeChargeCardTransaction">, removeChargeCardTransactionAttachmentByThirdPartyTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
}, "chargeCardTransaction/updateChargeCardTransactionAttachments">, removeChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardTransaction/removeChargeCardTransaction">, removeChargeCardTransactionAttachmentByThirdPartyTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
9
|
attachmentFileName: string;
|
|
23
10
|
thirdPartyTransactionId: ID;
|
|
24
11
|
}, "chargeCardTransaction/removeChargeCardTransactionAttachmentByThirdPartyTransactionId">, clearAllChargeCardTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardTransaction/clearAllChargeCardTransactions">;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllChargeCardTransactions = exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = exports.removeChargeCardTransaction = exports.
|
|
4
|
+
exports.clearAllChargeCardTransactions = exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = exports.removeChargeCardTransaction = exports.updateChargeCardTransactionAttachments = exports.updateChargeCardTransaction = exports.updateChargeCardTransactions = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const pusherActions_1 = require("../../commonStateTypes/pusherActions");
|
|
7
|
-
const chargeCardTransaction_1 = require("./chargeCardTransaction");
|
|
8
6
|
const chargeCardTransactionPayload_1 = require("./chargeCardTransactionPayload");
|
|
9
7
|
exports.initialState = {
|
|
10
8
|
chargeCardTransactionById: {},
|
|
@@ -52,42 +50,10 @@ const chargeCardTransaction = (0, toolkit_1.createSlice)({
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
},
|
|
55
|
-
updateChargeCardTransactionStatusFromPusher(draft, action) {
|
|
56
|
-
const { transactionId, transactionStatus } = action.payload;
|
|
57
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
58
|
-
if (transaction != null) {
|
|
59
|
-
transaction.transactionStatus = {
|
|
60
|
-
code: (0, chargeCardTransaction_1.toCardTransactionStatusCode)(transactionStatus.code),
|
|
61
|
-
name: transactionStatus.name,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
updateChargeCardTransactionFromPusher(draft, action) {
|
|
66
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
67
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
68
|
-
},
|
|
69
|
-
updateChargeCardTransactionReceiptFromPusher(draft, action) {
|
|
70
|
-
const { transactionId, attachmentFilePaths } = action.payload;
|
|
71
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
72
|
-
if (transaction != null) {
|
|
73
|
-
transaction.attachmentFilePaths = attachmentFilePaths;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
53
|
clearAllChargeCardTransactions(draft) {
|
|
77
54
|
draft.chargeCardTransactionById = {};
|
|
78
55
|
},
|
|
79
56
|
},
|
|
80
|
-
extraReducers: (builder) => {
|
|
81
|
-
builder
|
|
82
|
-
.addCase(pusherActions_1.addChargeCardTransactionFromPusher, (draft, action) => {
|
|
83
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
84
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
85
|
-
})
|
|
86
|
-
.addCase(pusherActions_1.addDeclinedChargeCardTransactionFromPusher, (draft, action) => {
|
|
87
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
88
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
57
|
});
|
|
92
|
-
_a = chargeCardTransaction.actions, exports.updateChargeCardTransactions = _a.updateChargeCardTransactions, exports.updateChargeCardTransaction = _a.updateChargeCardTransaction, exports.updateChargeCardTransactionAttachments = _a.updateChargeCardTransactionAttachments, exports.
|
|
58
|
+
_a = chargeCardTransaction.actions, exports.updateChargeCardTransactions = _a.updateChargeCardTransactions, exports.updateChargeCardTransaction = _a.updateChargeCardTransaction, exports.updateChargeCardTransactionAttachments = _a.updateChargeCardTransactionAttachments, exports.removeChargeCardTransaction = _a.removeChargeCardTransaction, exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = _a.removeChargeCardTransactionAttachmentByThirdPartyTransactionId, exports.clearAllChargeCardTransactions = _a.clearAllChargeCardTransactions;
|
|
93
59
|
exports.default = chargeCardTransaction.reducer;
|
|
@@ -5,16 +5,6 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
5
5
|
import { AccountState } from '../account/accountState';
|
|
6
6
|
import { ClassReport } from './classSelectorTypes';
|
|
7
7
|
import { Class, ClassState } from './classState';
|
|
8
|
-
/**
|
|
9
|
-
* Minimal class shape consumed by filter dropdowns. Only the identity and
|
|
10
|
-
* the display label are needed — payload size and prop-type breadth are
|
|
11
|
-
* kept small so consumers can't accidentally rely on `Class` fields that
|
|
12
|
-
* the projection does not carry.
|
|
13
|
-
*/
|
|
14
|
-
export interface ClassFilterOption {
|
|
15
|
-
classId: ID;
|
|
16
|
-
className: string;
|
|
17
|
-
}
|
|
18
8
|
export declare function getClassesByIds(classState: ClassState, id: {
|
|
19
9
|
classIds: ID[];
|
|
20
10
|
reportId: ReportID;
|
|
@@ -30,28 +20,3 @@ export declare function getClassReport(classState: ClassState, accountState: Acc
|
|
|
30
20
|
reportId: ReportID;
|
|
31
21
|
classesViewParentId?: ClassesViewParentID;
|
|
32
22
|
}, filter: COABalancesFilter): ClassReport | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Returns all classes currently in state (single pass over classesByKey).
|
|
35
|
-
* Use for dropdowns that need class names; map to { classId, className } as needed.
|
|
36
|
-
*/
|
|
37
|
-
export declare function getAllClasses(classState: ClassState): Class[];
|
|
38
|
-
/**
|
|
39
|
-
* Memoised projection of `getAllClasses` to the `{classId, className}` shape
|
|
40
|
-
* expected by filter dropdowns. Consumers should prefer this over inlining a
|
|
41
|
-
* `getAllClasses(...).map(...)` inside `useSelector`: the inline map allocates
|
|
42
|
-
* a fresh array on every Redux dispatch, breaking `useSelector`'s
|
|
43
|
-
* reference-equality optimisation and triggering re-renders on every state
|
|
44
|
-
* change unrelated to class data.
|
|
45
|
-
*
|
|
46
|
-
* Two cleanups happen here, intentionally inside the selector so every
|
|
47
|
-
* consumer benefits uniformly:
|
|
48
|
-
* 1. **Drop entries with a blank `className`.** Soft-deleted classes can
|
|
49
|
-
* retain their classId in state while the human name is blanked, which
|
|
50
|
-
* would otherwise render as an empty row in the filter dropdown.
|
|
51
|
-
* 2. **Dedupe by `classId`.** `classesByKey` is keyed by
|
|
52
|
-
* `${classId}-${reportId}` (see `getClassKey`), so a class loaded under
|
|
53
|
-
* multiple report contexts appears as multiple entries from
|
|
54
|
-
* `Object.values(classesByKey)`. The first non-blank entry per
|
|
55
|
-
* `classId` wins.
|
|
56
|
-
*/
|
|
57
|
-
export declare const getClassFilterOptions: (classState: ClassState) => ClassFilterOption[];
|
|
@@ -3,12 +3,9 @@ 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.getClassFilterOptions = void 0;
|
|
7
6
|
exports.getClassesByIds = getClassesByIds;
|
|
8
7
|
exports.getClassById = getClassById;
|
|
9
8
|
exports.getClassReport = getClassReport;
|
|
10
|
-
exports.getAllClasses = getAllClasses;
|
|
11
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
12
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
13
10
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
14
11
|
const accountSelector_1 = require("../account/accountSelector");
|
|
@@ -61,50 +58,3 @@ function getClassReport(classState, accountState, id, filter) {
|
|
|
61
58
|
accounts: accountReport,
|
|
62
59
|
};
|
|
63
60
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Returns all classes currently in state (single pass over classesByKey).
|
|
66
|
-
* Use for dropdowns that need class names; map to { classId, className } as needed.
|
|
67
|
-
*/
|
|
68
|
-
function getAllClasses(classState) {
|
|
69
|
-
return Object.values(classState.classesByKey);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Memoised projection of `getAllClasses` to the `{classId, className}` shape
|
|
73
|
-
* expected by filter dropdowns. Consumers should prefer this over inlining a
|
|
74
|
-
* `getAllClasses(...).map(...)` inside `useSelector`: the inline map allocates
|
|
75
|
-
* a fresh array on every Redux dispatch, breaking `useSelector`'s
|
|
76
|
-
* reference-equality optimisation and triggering re-renders on every state
|
|
77
|
-
* change unrelated to class data.
|
|
78
|
-
*
|
|
79
|
-
* Two cleanups happen here, intentionally inside the selector so every
|
|
80
|
-
* consumer benefits uniformly:
|
|
81
|
-
* 1. **Drop entries with a blank `className`.** Soft-deleted classes can
|
|
82
|
-
* retain their classId in state while the human name is blanked, which
|
|
83
|
-
* would otherwise render as an empty row in the filter dropdown.
|
|
84
|
-
* 2. **Dedupe by `classId`.** `classesByKey` is keyed by
|
|
85
|
-
* `${classId}-${reportId}` (see `getClassKey`), so a class loaded under
|
|
86
|
-
* multiple report contexts appears as multiple entries from
|
|
87
|
-
* `Object.values(classesByKey)`. The first non-blank entry per
|
|
88
|
-
* `classId` wins.
|
|
89
|
-
*/
|
|
90
|
-
exports.getClassFilterOptions = (0, toolkit_1.createSelector)(
|
|
91
|
-
// Key the memo on the underlying `classesByKey` record rather than on
|
|
92
|
-
// `getAllClasses` output: the latter returns a fresh `Object.values(...)`
|
|
93
|
-
// array on every call, which would defeat reselect's reference-equality
|
|
94
|
-
// check and re-run the projection on every dispatch.
|
|
95
|
-
[(classState) => classState.classesByKey], (classesByKey) => {
|
|
96
|
-
const classes = Object.values(classesByKey);
|
|
97
|
-
const seenClassIds = new Set();
|
|
98
|
-
const options = [];
|
|
99
|
-
for (const c of classes) {
|
|
100
|
-
if (c.classId == null || seenClassIds.has(c.classId)) {
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
if (c.className == null || c.className.trim() === '') {
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
seenClassIds.add(c.classId);
|
|
107
|
-
options.push({ classId: c.classId, className: c.className });
|
|
108
|
-
}
|
|
109
|
-
return options;
|
|
110
|
-
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CurrencyPayload } from '../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
2
|
-
import { SectionByProjectCOABalanceGroupedPayloadV2 } from '../../view/profitAndLossProjectView/profitAndLossProjectViewPayload';
|
|
3
2
|
import { AccountMetadataPayload } from '../account/accountPayload';
|
|
3
|
+
import { SectionByProjectCOABalanceGroupedPayloadV2 } from '../../view/profitAndLossProjectView/profitAndLossProjectViewPayload';
|
|
4
4
|
import { SectionProjectViewState } from './sectionProjectViewState';
|
|
5
5
|
export declare const initialState: SectionProjectViewState;
|
|
6
6
|
export declare const updateSectionProjectView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[timeframe: "month" | "year" | "quarter", sectionId: string, 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", sectionPayload: SectionByProjectCOABalanceGroupedPayloadV2, accountsMetadataPayload: AccountMetadataPayload[], currencyPayload: CurrencyPayload], {
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSectionProjectViewReport = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
9
8
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
9
|
+
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
10
10
|
const subAccountSelector_1 = require("../account/subAccountSelector");
|
|
11
11
|
const projectSelector_1 = require("../project/projectSelector");
|
|
12
12
|
const sectionProjectView_1 = require("./sectionProjectView");
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionManager = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* SessionManager — Central session lifecycle manager.
|
|
6
4
|
*
|
|
@@ -12,6 +10,8 @@ exports.SessionManager = void 0;
|
|
|
12
10
|
* 5. Sync activity across same-origin tabs via BroadcastChannel so one
|
|
13
11
|
* active tab keeps other tabs' sessions alive (no cascading logout).
|
|
14
12
|
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SessionManager = void 0;
|
|
15
15
|
const sessionTypes_1 = require("./sessionTypes");
|
|
16
16
|
/** Events that indicate user activity. */
|
|
17
17
|
const ACTIVITY_EVENTS = [
|
|
@@ -263,10 +263,7 @@ class SessionManager {
|
|
|
263
263
|
this.callbacks?.onHeartbeat();
|
|
264
264
|
// Let other tabs know we just fired a heartbeat — they can skip theirs
|
|
265
265
|
// this cycle to avoid N tabs all firing heartbeats.
|
|
266
|
-
this.broadcast({
|
|
267
|
-
type: 'heartbeat-fired',
|
|
268
|
-
timestamp: this.lastHeartbeatTime,
|
|
269
|
-
});
|
|
266
|
+
this.broadcast({ type: 'heartbeat-fired', timestamp: this.lastHeartbeatTime });
|
|
270
267
|
}
|
|
271
268
|
// ─── BroadcastChannel (cross-tab activity sync) ───────────
|
|
272
269
|
setupBroadcastChannel() {
|
|
@@ -2,13 +2,13 @@ import { ActionsObservable } from 'redux-observable';
|
|
|
2
2
|
import { clearAllAiAccountantCustomers } from '../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
3
3
|
import { clearAiCfo } from '../../entity/aiCfo/aiCfoReducer';
|
|
4
4
|
import { clearAllApprovalRules } from '../../entity/approvalRule/approvalRuleReducer';
|
|
5
|
-
import { clearAllCreditAgent } from '../../entity/creditAgent/creditAgentReducer';
|
|
6
5
|
import { clearAllEntityApprovalStatus } from '../../entity/entityApprovalStatus/entityApprovalStatusReducer';
|
|
7
6
|
import { clearAllMonthEndCloseChecks } from '../../entity/monthEndCloseChecks/monthEndCloseChecksReducer';
|
|
8
7
|
import { clearAllNotifications } from '../../entity/notification/notificationReducer';
|
|
9
8
|
import { clearAllSectionsClassesViewV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewReducer';
|
|
10
9
|
import { clearAllSectionsProjectView } from '../../entity/sectionProjectView/sectionProjectViewReducer';
|
|
11
10
|
import { clearAllTaskGroups } from '../../entity/taskGroup/taskGroupReducer';
|
|
11
|
+
import { clearCannedResponses } from '../../view/taskManager/cannedResponsesView/cannedResponsesReducer';
|
|
12
12
|
import { clearAllToastNotifications } from '../../entity/toastNotification/toastNotificationReducer';
|
|
13
13
|
import { clearAccountList } from '../../view/accountList/accountListReducer';
|
|
14
14
|
import { clearAccountMappingView } from '../../view/accountMappingView/accountMappingReducer';
|
|
@@ -39,6 +39,7 @@ import { clearCompanyHealthMetricView } from '../../view/companyHealthMetricView
|
|
|
39
39
|
import { clearCompanyMonthEndReportView } from '../../view/companyMonthEndReportView/companyMonthEndReportViewReducer';
|
|
40
40
|
import { clearCompanyTaskManagerView } from '../../view/companyTaskManagerView/companyTaskManagerViewReducer';
|
|
41
41
|
import { clearCompanyView } from '../../view/companyView/companyViewReducer';
|
|
42
|
+
import { clearAllCreditAgent } from '../../entity/creditAgent/creditAgentReducer';
|
|
42
43
|
import { clearCreditAgentView } from '../../view/creditAgentView/creditAgentViewReducer';
|
|
43
44
|
import { clearDashboard } from '../../view/dashboard/dashboardReducer';
|
|
44
45
|
import { clearDashboardLayout } from '../../view/dashboardLayout/dashboardLayoutReducer';
|
|
@@ -133,7 +134,6 @@ import { clearZeniAccountSetupView } from '../../view/spendManagement/zeniAccoun
|
|
|
133
134
|
import { clearZeniAccountsConfig } from '../../view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer';
|
|
134
135
|
import { clearSubscriptionView } from '../../view/subscriptionView/subscriptionViewReducer';
|
|
135
136
|
import { clearTagView } from '../../view/tagView/tagViewReducer';
|
|
136
|
-
import { clearCannedResponses } from '../../view/taskManager/cannedResponsesView/cannedResponsesReducer';
|
|
137
137
|
import { clearTaskDetail } from '../../view/taskManager/taskDetailView/taskDetailReducer';
|
|
138
138
|
import { clearTaskGroupTemplatesView } from '../../view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer';
|
|
139
139
|
import { clearTaskGroupView } from '../../view/taskManager/taskGroupView/taskGroupViewReducer';
|
|
@@ -6,13 +6,13 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const aiAccountantCustomerReducer_1 = require("../../entity/aiAccountantCustomer/aiAccountantCustomerReducer");
|
|
7
7
|
const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
|
|
8
8
|
const approvalRuleReducer_1 = require("../../entity/approvalRule/approvalRuleReducer");
|
|
9
|
-
const creditAgentReducer_1 = require("../../entity/creditAgent/creditAgentReducer");
|
|
10
9
|
const entityApprovalStatusReducer_1 = require("../../entity/entityApprovalStatus/entityApprovalStatusReducer");
|
|
11
10
|
const monthEndCloseChecksReducer_1 = require("../../entity/monthEndCloseChecks/monthEndCloseChecksReducer");
|
|
12
11
|
const notificationReducer_1 = require("../../entity/notification/notificationReducer");
|
|
13
12
|
const sectionClassesViewReducer_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewReducer");
|
|
14
13
|
const sectionProjectViewReducer_1 = require("../../entity/sectionProjectView/sectionProjectViewReducer");
|
|
15
14
|
const taskGroupReducer_1 = require("../../entity/taskGroup/taskGroupReducer");
|
|
15
|
+
const cannedResponsesReducer_1 = require("../../view/taskManager/cannedResponsesView/cannedResponsesReducer");
|
|
16
16
|
const toastNotificationReducer_1 = require("../../entity/toastNotification/toastNotificationReducer");
|
|
17
17
|
const accountListReducer_1 = require("../../view/accountList/accountListReducer");
|
|
18
18
|
const accountMappingReducer_1 = require("../../view/accountMappingView/accountMappingReducer");
|
|
@@ -43,6 +43,7 @@ const companyHealthMetricViewReducer_1 = require("../../view/companyHealthMetric
|
|
|
43
43
|
const companyMonthEndReportViewReducer_1 = require("../../view/companyMonthEndReportView/companyMonthEndReportViewReducer");
|
|
44
44
|
const companyTaskManagerViewReducer_1 = require("../../view/companyTaskManagerView/companyTaskManagerViewReducer");
|
|
45
45
|
const companyViewReducer_1 = require("../../view/companyView/companyViewReducer");
|
|
46
|
+
const creditAgentReducer_1 = require("../../entity/creditAgent/creditAgentReducer");
|
|
46
47
|
const creditAgentViewReducer_1 = require("../../view/creditAgentView/creditAgentViewReducer");
|
|
47
48
|
const dashboardReducer_1 = require("../../view/dashboard/dashboardReducer");
|
|
48
49
|
const dashboardLayoutReducer_1 = require("../../view/dashboardLayout/dashboardLayoutReducer");
|
|
@@ -137,7 +138,6 @@ const zeniAccountSetupViewReducer_1 = require("../../view/spendManagement/zeniAc
|
|
|
137
138
|
const zeniAccountsConfigReducer_1 = require("../../view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer");
|
|
138
139
|
const subscriptionViewReducer_1 = require("../../view/subscriptionView/subscriptionViewReducer");
|
|
139
140
|
const tagViewReducer_1 = require("../../view/tagView/tagViewReducer");
|
|
140
|
-
const cannedResponsesReducer_1 = require("../../view/taskManager/cannedResponsesView/cannedResponsesReducer");
|
|
141
141
|
const taskDetailReducer_1 = require("../../view/taskManager/taskDetailView/taskDetailReducer");
|
|
142
142
|
const taskGroupTemplateViewReducer_1 = require("../../view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer");
|
|
143
143
|
const taskGroupViewReducer_1 = require("../../view/taskManager/taskGroupView/taskGroupViewReducer");
|