@zeniai/client-epic-state 5.0.88 → 5.0.89
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/entity/transaction/stateTypes/transactionLine.d.ts +2 -1
- package/lib/entity/transaction/stateTypes/transactionLine.js +2 -1
- package/lib/esm/entity/transaction/stateTypes/transactionLine.js +1 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/view/transactionDetail/journalEntryLinesViewModel.js +149 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +22 -14
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +102 -0
- package/lib/view/transactionDetail/journalEntryLinesViewModel.js +160 -0
- package/package.json +1 -1
|
@@ -62,7 +62,8 @@ export type Line = TransactionWithProductOrServiceLine | JournalEntryTransaction
|
|
|
62
62
|
export type LineWithCOTTracking = Line & {
|
|
63
63
|
cotViewingFlags?: COTLineItemTracking;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export declare const LINE_TYPE_LINKED: "linked_transaction_line";
|
|
66
|
+
export type LineType = typeof LINE_TYPE_LINKED | 'transaction_with_account_and_class_line' | 'transaction_with_product_or_service_line' | 'journal_entry_transaction_line' | 'transaction_info_line' | 'transaction_line_base';
|
|
66
67
|
export default Line;
|
|
67
68
|
export interface ProductOrService {
|
|
68
69
|
itemId: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCategorizationStatusType = exports.CATEGORIZATION_STATUSES = exports.toPlatformLineDetailType = void 0;
|
|
3
|
+
exports.toCategorizationStatusType = exports.CATEGORIZATION_STATUSES = exports.toPlatformLineDetailType = exports.LINE_TYPE_LINKED = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
exports.LINE_TYPE_LINKED = 'linked_transaction_line';
|
|
5
6
|
const PLATFORM_LINE_DETAIL_TYPES = [
|
|
6
7
|
'sales_item_line_detail',
|
|
7
8
|
'account_based_expense_line_detail',
|
package/lib/esm/index.js
CHANGED
|
@@ -385,6 +385,7 @@ import { getAllTopExpenses, getTop6Expenses, getTopExpenses, } from './view/topE
|
|
|
385
385
|
import { TOP_EX_TIME_PERIODS, } from './view/topEx/topExState';
|
|
386
386
|
import { getAccountingProviderAttachment, } from './view/transactionDetail/getAccountingProviderAttachmentSelector';
|
|
387
387
|
import { getChangedLineItemCountFromLocalData, isAccountUncategorized, } from './view/transactionDetail/transactionDetailLocalDataHelper';
|
|
388
|
+
import { JOURNAL_ENTRY_SORT_KEYS, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey, } from './view/transactionDetail/journalEntryLinesViewModel';
|
|
388
389
|
import { clearTransactionDetailSaveStatus, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess, } from './view/transactionDetail/transactionDetailReducer';
|
|
389
390
|
import { getInitialUpdatablePeriodsForTransactionRecommendations, getTransactionDetail, getTransactionDetailForTransaction, } from './view/transactionDetail/transactionDetailSelector';
|
|
390
391
|
import { getThirdPartyIdFromTransactionId, } from './view/transactionDetail/transactionDetailState';
|
|
@@ -583,6 +584,7 @@ export { getNextNthWorkingDay, getPreviousNthWorkingDay, isHolidayToday, filterD
|
|
|
583
584
|
export { fetchCompanyOnboardingView, fetchQBOConnectionPool, updateQBOConnectionPoolExternalConnection, fetchOnboardingCompletedCompanies, saveOnboardingCustomerCompletedStatus, toProductType, toProductTypeStrict, getOnboardingCockpitView, getNewOnboardingCustomerView, getOnboardingEmailGroup, initializeOnboardingCustomerViewUpdateData, clearOnboardingCustomerViewUpdateData, saveOnboardingCustomerViewUpdateData, updateOnboardingCustomerListUIState, updateCustomerCreationStatus, updateStatusAfterOnboardingCompleted, saveOnboardingCustomerViewUpdates, saveOnboardingCustomerNotes, saveOnboardingCustomerDataInLocalStore, updateOnboardingCustomerDataInLocalStore, resetNewOnboardedCustomerId, sendOnboardingCustomerViewInvite, retryBankAccountConnectionForOnboarding, };
|
|
584
585
|
export { getTransactionsListByCategoryType, getTransactionListUIStateByCategoryType, };
|
|
585
586
|
export { getChangedLineItemCountFromLocalData, isAccountUncategorized };
|
|
587
|
+
export { JOURNAL_ENTRY_SORT_KEYS, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey, };
|
|
586
588
|
export { openSnackbar, closeSnackbar, getSnackbar, };
|
|
587
589
|
export { getSpendManagementEffectiveListPeriod, getSelectedCompanyOfficer, showBillPayPromoPage, showReimbursementPromoPage, getActualPaymentDate, isVerifiedStatusCode, isVerifiedPaymentAccountProviderStatusCode, isBulkProcessing, getBillListUniqueType, getRemiListUniqueType, getBulkOperationSuffix, toAccountsPromoConfig, toSameDayAchDisablementConfig, isPaymentMethodOutsideZeni, isAwaitingMarkAsPaid, checkIfLowBalance, };
|
|
588
590
|
export { canSendMonthEndEmailReport, shouldEnableCalendarPickerForLastReportSent, };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import orderBy from 'lodash/orderBy';
|
|
2
|
+
import { stringToUnion } from '../../commonStateTypes/stringToUnion';
|
|
3
|
+
import { LINE_TYPE_LINKED, } from '../../entity/transaction/stateTypes/transactionLine';
|
|
4
|
+
/**
|
|
5
|
+
* View-model helpers for the new Journal Entry table view (see
|
|
6
|
+
* web-components `journalEntryTable`). Keeps presentation-agnostic
|
|
7
|
+
* logic — totals, sort, line-filter — colocated in epic-state so it
|
|
8
|
+
* is testable and reusable.
|
|
9
|
+
*/
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Sort keys
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
export const JOURNAL_ENTRY_SORT_KEYS = [
|
|
14
|
+
'description',
|
|
15
|
+
'name',
|
|
16
|
+
'category',
|
|
17
|
+
'class',
|
|
18
|
+
'debit',
|
|
19
|
+
'credit',
|
|
20
|
+
];
|
|
21
|
+
export const toJournalEntrySortKey = (v) => stringToUnion(v, JOURNAL_ENTRY_SORT_KEYS);
|
|
22
|
+
export const journalEntryDefaultSortConfig = {
|
|
23
|
+
sortKey: 'description',
|
|
24
|
+
sortOrder: 'ascending',
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Sums the `amount.amount` field of every line and returns an `Amount`
|
|
28
|
+
* whose currencyCode/currencySymbol are taken from the first line.
|
|
29
|
+
* Returns `undefined` for an empty list, and also when the first line
|
|
30
|
+
* has no currency to carry — a stray bare number with no symbol is
|
|
31
|
+
* worse to render than nothing, so the caller is forced to handle the
|
|
32
|
+
* absence.
|
|
33
|
+
*
|
|
34
|
+
* **Precondition:** all input lines must share a currency. Journal
|
|
35
|
+
* entry lines on the same transaction always do, which is the only
|
|
36
|
+
* caller today. Mixed-currency input is summed numerically (no FX
|
|
37
|
+
* conversion) and tagged with the first line's currency, which will
|
|
38
|
+
* silently produce a wrong total — if this helper is ever reused for
|
|
39
|
+
* a cross-currency aggregate (e.g. a multi-transaction report), the
|
|
40
|
+
* caller must pre-group by currency before calling.
|
|
41
|
+
*
|
|
42
|
+
* Mirrors legacy `calculateTotal` in
|
|
43
|
+
* `web-components/src/components/transactionDetail/items/TransactionLinesJournalEntry.tsx`
|
|
44
|
+
* but without the `Object.assign` ceremony and with stable currency carry-over.
|
|
45
|
+
*/
|
|
46
|
+
export const sumJournalEntryAmounts = (lines) => {
|
|
47
|
+
if (lines.length === 0) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const first = lines[0].amount;
|
|
51
|
+
if (first?.currencyCode == null || first?.currencySymbol == null) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
let total = 0;
|
|
55
|
+
for (const line of lines) {
|
|
56
|
+
total += line.amount?.amount ?? 0;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
amount: total,
|
|
60
|
+
currencyCode: first.currencyCode,
|
|
61
|
+
currencySymbol: first.currencySymbol,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Splits `lines` by `postingType` into a single debit total and a
|
|
66
|
+
* single credit total — the shape the new flat-table totals row
|
|
67
|
+
* (`JournalEntryTotalsRow` in `web-components`, Figma frame
|
|
68
|
+
* `5177:12750`) needs.
|
|
69
|
+
*
|
|
70
|
+
* The legacy `TransactionLinesJournalEntry` grouped lines into six
|
|
71
|
+
* `JournalEntryItemType` buckets (`debit` / `uncategorizedDebit` /
|
|
72
|
+
* `miscategorizedDebit` plus the credit triplet) for *visual banner
|
|
73
|
+
* headers* in the line list; its bottom totals row was already two
|
|
74
|
+
* combined numbers. The new flat table folds those banners away by
|
|
75
|
+
* design, so we don't surface a per-status breakdown here. If the
|
|
76
|
+
* design ever asks for sub-totals per status, that's a richer shape
|
|
77
|
+
* (`{debit: {total, uncategorized, miscategorized}, credit: {…}}`)
|
|
78
|
+
* and a follow-up — not a v1 of this helper.
|
|
79
|
+
*
|
|
80
|
+
* As a side effect, the legacy `calculateCombinedTotalAmount`
|
|
81
|
+
* `??`/`+` precedence bug (`totalAmount?.amount ?? 0 + (uncat ?? 0) +
|
|
82
|
+
* (miscat ?? 0)` parses as `totalAmount?.amount ?? (0 + uncat +
|
|
83
|
+
* miscat)`, silently dropping the uncat/miscat pieces whenever
|
|
84
|
+
* `totalAmount` was non-nullish) is gone by construction here: there
|
|
85
|
+
* is no separate combine step, just one pass over the lines.
|
|
86
|
+
*/
|
|
87
|
+
export const journalEntryTotalsByPostingSide = (lines) => {
|
|
88
|
+
const debitLines = [];
|
|
89
|
+
const creditLines = [];
|
|
90
|
+
for (const line of lines) {
|
|
91
|
+
if (line.postingType === 'debit') {
|
|
92
|
+
debitLines.push(line);
|
|
93
|
+
}
|
|
94
|
+
else if (line.postingType === 'credit') {
|
|
95
|
+
creditLines.push(line);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
debitTotal: sumJournalEntryAmounts(debitLines),
|
|
100
|
+
creditTotal: sumJournalEntryAmounts(creditLines),
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Filter
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* Drops `linked_transaction_line` entries — equivalent to legacy
|
|
108
|
+
* `filterOutLinkedTransactionLine` in `transactionDetail.helpers.ts`.
|
|
109
|
+
*
|
|
110
|
+
* The literal lives in `LINE_TYPE_LINKED` next to `LineType` so the
|
|
111
|
+
* filter discriminant stays bound to the union at the type level.
|
|
112
|
+
* Other sites still inlining the literal (see `transactionDetailLocalDataHelper`,
|
|
113
|
+
* `transactionDetailState`, `transactionCategorizationLocalDataHelper`,
|
|
114
|
+
* `transactionLinePayload`, and the mocks) are a known follow-up.
|
|
115
|
+
*/
|
|
116
|
+
export const filterJournalEntryLinesExcludingLinked = (lines) => lines?.filter((line) => line.type !== LINE_TYPE_LINKED) ?? [];
|
|
117
|
+
const sortOrderToLodash = (sortOrder) => sortOrder === 'descending' ? 'desc' : 'asc';
|
|
118
|
+
/**
|
|
119
|
+
* Stable, accessor-driven sort over arbitrary line shapes. Lines that
|
|
120
|
+
* resolve to the same key value preserve their original relative order
|
|
121
|
+
* thanks to lodash's stable `orderBy`.
|
|
122
|
+
*
|
|
123
|
+
* Strings are lower-cased before comparison so the order is predictable
|
|
124
|
+
* across mixed-case data. Numbers (debit/credit) compare directly.
|
|
125
|
+
*/
|
|
126
|
+
export const sortJournalEntryLines = (lines, config, accessors) => {
|
|
127
|
+
const accessor = (line) => {
|
|
128
|
+
switch (config.sortKey) {
|
|
129
|
+
case 'description':
|
|
130
|
+
return accessors.description(line).toLowerCase();
|
|
131
|
+
case 'name':
|
|
132
|
+
return accessors.name(line).toLowerCase();
|
|
133
|
+
case 'category':
|
|
134
|
+
return accessors.category(line).toLowerCase();
|
|
135
|
+
case 'class':
|
|
136
|
+
return accessors.class(line).toLowerCase();
|
|
137
|
+
case 'debit':
|
|
138
|
+
return accessors.debit(line);
|
|
139
|
+
case 'credit':
|
|
140
|
+
return accessors.credit(line);
|
|
141
|
+
default:
|
|
142
|
+
// stringToUnion narrows permissively (returns `s as StringUnion` for
|
|
143
|
+
// non-member input, see commonStateTypes/stringToUnion.ts), so this
|
|
144
|
+
// branch is reachable at runtime — keep it as a description fallback.
|
|
145
|
+
return accessors.description(line).toLowerCase();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
return orderBy([...lines], [accessor], [sortOrderToLodash(config.sortOrder)]);
|
|
149
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -571,6 +571,7 @@ import { TopExAccount, TopExReport, TopExTimePeriodWithMetaData, TopExpenses } f
|
|
|
571
571
|
import { TOP_EX_TIME_PERIODS, TopExTimePeriod, TopExpense } from './view/topEx/topExState';
|
|
572
572
|
import { AccountingProviderAttachmentSelector, getAccountingProviderAttachment } from './view/transactionDetail/getAccountingProviderAttachmentSelector';
|
|
573
573
|
import { getChangedLineItemCountFromLocalData, isAccountUncategorized } from './view/transactionDetail/transactionDetailLocalDataHelper';
|
|
574
|
+
import { JOURNAL_ENTRY_SORT_KEYS, JournalEntryRowSortConfig, JournalEntrySortAccessors, JournalEntrySortKey, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey } from './view/transactionDetail/journalEntryLinesViewModel';
|
|
574
575
|
import { clearTransactionDetailSaveStatus, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess } from './view/transactionDetail/transactionDetailReducer';
|
|
575
576
|
import { TransactionDetailReport, VendorDetailsView, getInitialUpdatablePeriodsForTransactionRecommendations, getTransactionDetail, getTransactionDetailForTransaction } from './view/transactionDetail/transactionDetailSelector';
|
|
576
577
|
import { TransactionUpdates, getThirdPartyIdFromTransactionId } from './view/transactionDetail/transactionDetailState';
|
|
@@ -830,6 +831,8 @@ export { fetchCompanyOnboardingView, fetchQBOConnectionPool, updateQBOConnection
|
|
|
830
831
|
export { TransactionListByCategoryType, getTransactionsListByCategoryType, getTransactionListUIStateByCategoryType, TransactionCategoryType, };
|
|
831
832
|
export { TransactionDetailLocalData, TransactionDetailLineItemData, TransactionVendorUpdates, };
|
|
832
833
|
export { getChangedLineItemCountFromLocalData, isAccountUncategorized };
|
|
834
|
+
export { JOURNAL_ENTRY_SORT_KEYS, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey, };
|
|
835
|
+
export type { JournalEntryRowSortConfig, JournalEntrySortAccessors, JournalEntrySortKey, };
|
|
833
836
|
export { openSnackbar, closeSnackbar, getSnackbar, SnackbarMessageType, SnackbarMessageSections, SnackbarMessageSectionTexts, SnackbarMessageConfig, };
|
|
834
837
|
export { getSpendManagementEffectiveListPeriod, getSelectedCompanyOfficer, showBillPayPromoPage, showReimbursementPromoPage, getActualPaymentDate, isVerifiedStatusCode, isVerifiedPaymentAccountProviderStatusCode, isBulkProcessing, getBillListUniqueType, getRemiListUniqueType, BulkOperationType, BulkOperationFinishedType, getBulkOperationSuffix, ZeniAccountsPromoConfig, toAccountsPromoConfig, SameDayAchDisablementConfig, toSameDayAchDisablementConfig, isPaymentMethodOutsideZeni, isAwaitingMarkAsPaid, checkIfLowBalance, };
|
|
835
838
|
export { FilterCategoryValueType, canSendMonthEndEmailReport, shouldEnableCalendarPickerForLastReportSent, };
|
package/lib/index.js
CHANGED
|
@@ -58,20 +58,20 @@ exports.cancelAndDeleteBill = exports.deleteBill = exports.updateApprovalStatusO
|
|
|
58
58
|
exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccount = exports.updateBusinessVerificationDetails = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.getPlaidLinkToken = exports.getPaymentAccounts = exports.enableSetup = exports.fetchZeniAccountSetupView = exports.fetchBillPaySetupView = exports.applyTransactionFilters = exports.TRANSACTION_FILTER_CATEGORIES = exports.hideCreatedByFilter = exports.updateShouldReplaceBillData = exports.replaceBillFileInLocalStore = exports.removeBillFileFromLocalStore = exports.updateWithdrawFromAccountId = exports.markBillForRetry = exports.fetchVendorAndUpdateBillLocalData = exports.convertAmountToHomeCurrency = exports.toPaymentToOption = exports.updateVendorContact = exports.verifyUser = exports.fetchUserDetails = exports.updateBillListSearchResult = exports.updateBillUploadFetchState = exports.updateContactsInVendorTabDetailLocalData = exports.updateVendorTabDetailUIState = exports.updateContactsInVendorDetailLocalData = exports.resetVendorSaveStatus = exports.resetVendorDetailLocalData = exports.updateVendorDetailLocalData = exports.BILL_PAY_FILTER_CATEGORIES = exports.updateBillListUIState = exports.saveVendorSuccessOrFailure = exports.updateShowAutofill = exports.fetchBillAndInitializeLocalStore = exports.getReviewPageBillDetail = exports.getEditBillDetail = exports.clearBillPayReview = exports.fetchDuplicateBill = exports.fetchAndUpdateVendorRecommendations = exports.fetchEditBillDetailPage = exports.fetchBillDetail = exports.getBillTransactionDetailKey = exports.checkApproveRejectBtnShowForBill = exports.getBillDetailView = exports.getBillDownloadList = exports.getBillList = exports.retryOrRefundBill = void 0;
|
|
59
59
|
exports.getBillPaySetupApproverView = exports.toRoleTypeStrict = exports.toAttributeOrRoleTypeStrict = exports.toAttributeTypeStrict = exports.isAccessDeniedError = exports.isInvalidSessionError = exports.isSuccessResponse = exports.VERIFIED_PAYMENT_ACCOUNT_PROVIDER_VERIFICATION_STATUS = exports.getRemiBusinessVerificationDetails = exports.getRemiSetupViewDetails = exports.clearRemiSetupView = exports.acceptEmployeeRemiTerms = exports.acceptRemiTerms = exports.saveRemiSetupViewDataInLocalStore = exports.updateMileageDetails = exports.fetchRemiSetupView = exports.getUserFinancialAccount = exports.fetchUserFinancialAccount = exports.getIntegrationsView = exports.getBankConnectionsSetupViewDetails = exports.getApprovalRuleViewDetails = exports.getTwoFactorAuthenticationViewForChargeCardHolder = exports.getTwoFactorAuthenticationViewForCardUserOnboarding = exports.getTwoFactorAuthenticationView = exports.getCommonSetupViewDetails = exports.getTreasuryBusinessVerificationDetails = exports.getZeniAccountBusinessVerificationDetails = exports.getBillPayBusinessVerificationDetails = exports.getBusinessVerificationDetails = exports.getZeniAccountSetupViewDetails = exports.getPlaidAccountDetails = exports.getBillPaySetupViewDetails = exports.verifyOtp = exports.resendOtp = exports.sendOtp = exports.clearZeniAccountSetupView = exports.clearBillPaySetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.acceptBillPayUpdatedTerms = exports.acceptZeniAccountTerms = exports.acceptBillPayTerms = exports.updatePrimaryFundingAccount = exports.updateMappedCashAccount = exports.establishPlaidConnection = exports.updatePaymentAccountStatus = void 0;
|
|
60
60
|
exports.updateUploadFetchState = exports.updateAddRemiAutoFields = exports.clearEditRemiViewDetail = exports.parseReceiptsToRemi = exports.saveRemiSuccessOrFailure = exports.saveRemiDetail = exports.removeFileFromRemiUpdatesInLocalStore = exports.discardRemiUpdatesInLocalStore = exports.fetchCurrencyConversionValue = exports.saveRemiUpdatesToLocalStore = exports.initializeRemiToLocalStore = exports.fetchRemiAndInitializeLocalStore = exports.fetchRecommendationsAndUpdateMerchantRecommendations = exports.fetchEditRemiDetailPage = exports.getEditRemiDetail = exports.removeDuplicateReimbursementByLineId = exports.clearDuplicateReimbursementDetail = exports.fetchDuplicateReimbursement = exports.clearRemiDetailView = exports.approveOrRejectRemi = exports.cancelAndDeleteRemi = exports.fetchRemiDetail = exports.deleteRemi = exports.updateIsEditModeRealTimeApprovals = exports.saveRealTimeApproval = exports.checkApproveRejectBtnShowForRemi = exports.getRemiDetailView = exports.clearRemiSetupApproverView = exports.clearRemiSetupApproverViewUpdateData = exports.setRemiSetupApproverViewListeningToPusherEvent = exports.initializeRemiSetupApproverViewUpdateData = exports.saveRemiSetupApproverViewUpdates = exports.saveRemiSetupApproverViewUpdateData = exports.deleteRemiApprovalRule = exports.fetchRemiApproversDetails = exports.fetchRemiApproversList = exports.fetchRemiSetupApproverView = exports.getRemiSetupApproverUpdateDataView = exports.getRemiSetupApproverView = exports.clearBillPaySetupApproverView = exports.clearBillPaySetupApproverViewUpdateData = exports.initializeBillPaySetupApproverViewUpdateData = exports.setBillsSetupApproverViewListeningToPusherEvent = exports.saveBillPaySetupApproverViewUpdates = exports.saveBillPaySetupApproverViewUpdateData = exports.deleteBillPayApprovalRule = exports.fetchBillPayApproversList = exports.fetchBillPayApproversDetails = exports.fetchBillPaySetupApproverView = exports.getBillPaySetupApproverUpdateDataView = void 0;
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
65
|
-
exports.
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
71
|
-
exports.
|
|
72
|
-
exports.
|
|
73
|
-
exports.
|
|
74
|
-
exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = void 0;
|
|
61
|
+
exports.JOURNAL_ENTRY_SORT_KEYS = exports.isAccountUncategorized = exports.getChangedLineItemCountFromLocalData = exports.getTransactionListUIStateByCategoryType = exports.getTransactionsListByCategoryType = exports.retryBankAccountConnectionForOnboarding = exports.sendOnboardingCustomerViewInvite = exports.resetNewOnboardedCustomerId = exports.updateOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerNotes = exports.saveOnboardingCustomerViewUpdates = exports.updateStatusAfterOnboardingCompleted = exports.updateCustomerCreationStatus = exports.updateOnboardingCustomerListUIState = exports.saveOnboardingCustomerViewUpdateData = exports.clearOnboardingCustomerViewUpdateData = exports.initializeOnboardingCustomerViewUpdateData = exports.getOnboardingEmailGroup = exports.getNewOnboardingCustomerView = exports.getOnboardingCockpitView = exports.toProductTypeStrict = exports.toProductType = exports.saveOnboardingCustomerCompletedStatus = exports.fetchOnboardingCompletedCompanies = exports.updateQBOConnectionPoolExternalConnection = exports.fetchQBOConnectionPool = exports.fetchCompanyOnboardingView = exports.PAYMENT_BUSINESS_DAYS = exports.holidaysFormatted = exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.toFileTypeStrict = exports.ALL_FILE_TYPES = exports.isAllFetchCompleted = exports.isAnyFetchInProgress = exports.reduceAnyCompletedFetchState = exports.reduceAllFetchState = exports.reduceAnyFetchState = exports.reduceFetchStateParallelTimeframes = exports.reduceFetchState = exports.clearAddRemiAutoFields = exports.updateHomeCurrencyConversion = exports.updateReimbursementType = exports.clearTentativeMerchantName = exports.updateTentativeMerchantNames = void 0;
|
|
62
|
+
exports.fetchAccountList = exports.fetchZeniAccountList = exports.getZeniAccountList = exports.getZeniAccountsConfigDetail = exports.fetchOwnerList = exports.fetchRecommendationByEntityName = exports.fetchRecommendationByEntityId = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.fetchVendorsFiling1099Download = exports.getVendorFiling1099List = exports.toVendorReportIDType = exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.updateYTDSelectionUIState = exports.updatePageToken = exports.updateSortUiState = exports.getVendorList = exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.getInternationalSubConfigCodeKey = exports.shouldEnableCalendarPickerForLastReportSent = exports.canSendMonthEndEmailReport = exports.checkIfLowBalance = exports.isAwaitingMarkAsPaid = exports.isPaymentMethodOutsideZeni = exports.toSameDayAchDisablementConfig = exports.toAccountsPromoConfig = exports.getBulkOperationSuffix = exports.getRemiListUniqueType = exports.getBillListUniqueType = exports.isBulkProcessing = exports.isVerifiedPaymentAccountProviderStatusCode = exports.isVerifiedStatusCode = exports.getActualPaymentDate = exports.showReimbursementPromoPage = exports.showBillPayPromoPage = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getSnackbar = exports.closeSnackbar = exports.openSnackbar = exports.toJournalEntrySortKey = exports.sumJournalEntryAmounts = exports.sortJournalEntryLines = exports.journalEntryTotalsByPostingSide = exports.journalEntryDefaultSortConfig = exports.filterJournalEntryLinesExcludingLinked = void 0;
|
|
63
|
+
exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerView = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingCustomerViewDashboardLoaded = exports.updateOnboardingCustomerViewCompleteStatus = exports.updateOnboardingCustomerViewAccountDetails = exports.establishOnboardingPlaidConnection = exports.getOnboardingPlaidLinkToken = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.isZeniClearingAccount = exports.ZENI_CLEARING_ACCOUNT = exports.isZeniClearingAccountReport = exports.getCompanyConfig = exports.fetchCompanyConfig = exports.clearTransactionVendorSaveStatus = exports.resetTransactionVendorLocalData = exports.updateTransactionVendorLocalData = exports.saveTransactionVendorSuccessOrFailure = exports.saveTransactionVendor = exports.getTransactionVendorView = exports.getDepositAccountTransactionList = exports.fetchDepositAccountTransactionList = exports.getZeniAccStatements = exports.fetchZeniAccStatementPage = exports.fetchDepositAccountHistoryFailure = exports.fetchDepositAccountHistorySuccess = exports.updateDepositAccount = exports.getCheckDepositDetail = exports.clearCheckDeposit = exports.updateCheckDepositLocalData = exports.depositCheck = exports.fetchDepositAccountDetail = exports.fetchReviewTransferDetail = exports.clearReviewTransferDetail = exports.clearTransferDetail = exports.getTransferDetail = exports.transferMoney = exports.updateDepositToLocalData = exports.updateTransferToLocalData = exports.updateTransferMoneyLocalData = exports.fetchZeniAccountsConfig = exports.fetchDepositAccount = exports.getDepositAccountDetailForPDF = exports.getAllDepositAccounts = exports.getDepositAccountDetail = exports.unlinkPaymentAccount = exports.fetchPaymentAccountList = exports.createCheckingAccount = void 0;
|
|
64
|
+
exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.fetchCompanyHealthMetricConfig = exports.getCompanyHealthMetricConfig = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getProductSettingsString = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLocalStore = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.updateOnboardingCustomerViewUIState = exports.updateCurrentStep = void 0;
|
|
65
|
+
exports.getDebitCardSetPinView = exports.getChargeCardTransactionAttachmentView = exports.getDepositAccountLimitFetchStateByDepositAccountId = exports.getChargeCardControlDetailView = exports.getChargeCardDetailView = exports.fetchDepositAccountLimit = exports.fetchChargeCardTransactionStatistics = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.getCreditAccountDetails = exports.PAYMENT_HISTORY_FILTER_CATEGORIES = exports.getPaymentStatusDisplayText = exports.getPaymentHistorySourceAccountName = exports.getChargeCardPaymentHistoryView = exports.getChargeCardPaymentHistoryDownloadReport = exports.updatePaymentHistoryUIState = exports.updatePaymentHistorySearchText = exports.updatePaymentHistoryFilters = exports.updatePaymentHistoryDownloadUIState = exports.fetchChargeCardPaymentHistory = exports.fetchChargeCardPaymentPage = exports.getChargeCardRepaymentDetail = exports.updateChargeCardRepaymentLocalStore = exports.initiateChargeCardRepayment = exports.fetchChargeCardRepaymentDetail = exports.clearChargeCardRepaymentDetail = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getChargeCardListView = exports.fetchCreditAccountRepayment = exports.fetchCreditAccount = exports.fetchChargeCardConfig = exports.fetchChargeCardListPage = exports.fetchChargeCardList = exports.fetchDebitCardSummary = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.attachmentFilePathToAttachment = exports.addDeclinedChargeCardTransactionFromPusher = exports.addChargeCardTransactionFromPusher = exports.updateCreditAccountBalanceFromPusher = exports.updateChargeCardTransactionReceiptFromPusher = exports.updateChargeCardTransactionFromPusher = exports.updateChargeCardTransactionStatusFromPusher = exports.updateChargeCardSpendingFromPusher = exports.updateChargeCardStatusFromPusher = exports.updateChargeCardTransactionAttachments = void 0;
|
|
66
|
+
exports.updateDebitCardPinAttempt = exports.startDebitCardSetPinWait = exports.completeDebitCardSetPinWait = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.saveCardOnboardingUserDetails = exports.updateCardUserOnboardingLocalData = exports.initializeCardUserOnboardingLocalData = exports.getCardUserOnboardingView = exports.updateChargeCardName = exports.closeChargeCard = exports.unlockChargeCard = exports.lockChargeCard = exports.updatePhysicalChargeCardAttempt = exports.updateChargeCardDetail = exports.updateCashbackDetailUIState = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.updateBulkActionCardIds = exports.resetIssueChargeCardForm = exports.updateChargeCardsLocalStore = exports.updateCustomAddressId = exports.getDebitCardSummary = exports.getDebitCardList = exports.fetchDepositAccountListForCards = exports.fetchIssueCardPage = exports.issueChargeCards = exports.toCardType = exports.toShippingAddressType = exports.toCardAddressType = exports.getDepositAccountLimitForChargeCardByDepositAccountId = exports.expressInterestInChargeCard = exports.acceptChargeCardTerms = exports.enableChargeCardAutoPay = exports.fetchChargeCardSetupView = exports.getChargeCardStatements = exports.fetchChargeCardStatementList = exports.getChargeCardSetupViewDetails = exports.getIssueChargeCardView = exports.getDepositAccountListWithDebitCardIssued = exports.toCreditLimitFrequencyCodeType = exports.getZeniDateFromPeriod = exports.getCashbackDetail = exports.toChargeCardSortKeyType = exports.fetchCashbackDetail = exports.fetchChargeCardTransactionList = exports.getChargeCardCVVActivateView = exports.getChargeCardBulkActionView = exports.getChargeCardRowActionView = exports.getChargeCardRecurringExpensesView = exports.getChargeCardRecurringExpensesByCardIds = void 0;
|
|
67
|
+
exports.fetchScheduleAccruedDetailsPage = exports.fetchScheduleAccruedDetails = exports.cancelScheduleAccruedJournalEntry = exports.deleteScheduleAccruedDetail = exports.createNewSchedulesAccrued = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateExpenseAutomationJESchedulesUIState = exports.retryExpenseAutomationJESchedule = exports.removeJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeJeAccountSettingsView = exports.ignoreExpenseAutomationJESchedule = exports.fetchExpenseAutomationJESchedulesPage = exports.clearExpenseAutomationJESchedulesView = exports.clearExpenseAutomationJEScheduleLocalData = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.aggregatedReportView = exports.fetchAggregatedReport = exports.toTimeSeriesDuration = exports.convertToTimeSeriesSelectionRange = exports.TIME_SERIES_DURATIONS = exports.anyCardOnHold = exports.getChargeCardById = exports.setCurrentDisplayedCardId = exports.setFirstViewCompleteAfterActivation = exports.setFirstViewAfterActivation = exports.completeCardUserOnboardingActivationWait = exports.startCardUserOnboardingActivationWait = exports.fetchChargeCardsRecurringExpenses = exports.updateChargeCardsSpendLimit = exports.closeChargeCards = exports.unlockChargeCards = exports.lockChargeCards = exports.revokeChargeCardsInvite = exports.updateRowActionCardId = exports.revokeCardInvite = exports.resendCardInvite = exports.updateChargeCardSpendLimitSuccessOrFailure = exports.updateChargeCardSpendLimit = exports.startCVVActivationWait = exports.completeCVVActivationWait = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = void 0;
|
|
68
|
+
exports.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateAccruedJEScheduleAccruedByListKey = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getAccruedScheduleDetailsView = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchAccruedScheduleList = exports.fetchScheduleList = exports.getAccruedScheduleListReport = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = exports.resetAccruedDetailNewScheduleState = exports.resetSelectedJEAccruedScheduleKey = exports.updateSelectedJEAccruedScheduleKey = exports.updateScheduleAccruedDetailsLocalData = exports.updateLinkBillExpenseLocalData = exports.clearSelectedJELinkRowIndex = exports.fetchRecommendedTransactionRowIndex = exports.updatedJELinkInLocalDataAccruedExpenses = exports.updatedJEAccruedLinkWithRecommendedLocalData = exports.updateAmountsInScheduleAccruedDetail = exports.saveScheduleAccruedDetails = exports.resetJEAccruedLinkInLocalData = void 0;
|
|
69
|
+
exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.getTaskGroupById = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.updateArAgingNodeCollapseState = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.updateVendorGlobalReviewViewLocalData = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.getVendorDetailSelectorView = exports.saveVendorDetailsView = exports.updateReviewVendorDetailLocalData = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewAttachments = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewAttachmentView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getVendorTabView = exports.updateVendorTabViewTab = exports.fetchVendorTabView = exports.resetMarkAsCompleteStatus = exports.markAsCompleteScheduleDetail = void 0;
|
|
70
|
+
exports.fetchPaymentSources = exports.addCardPaymentSource = exports.confirmCardSetupIntent = exports.createCardSetupIntent = exports.getAllCardsAndBankPaymentMethods = exports.deleteTag = exports.createTag = exports.fetchTagList = exports.getAllTags = exports.ALL_TASK_LIST_TABS = exports.initialTaskDetailLocalData = exports.convertHHMMStrToMinutes = exports.unsnoozeTask = exports.snoozeTask = exports.removeTaskFromList = exports.updateTaskListTab = exports.updateTaskFromListView = exports.toDueDateGroupKeyType = exports.toTaskStatusCodeType = exports.toPriorityCodeType = exports.getDueDateValueFromDueDateGroupId = exports.initialTaskDetail = exports.fetchAllTaskGroups = exports.getTaskUpdates = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.updateTaskGroupName = exports.dragNDropTasks = exports.updateTaskListLocalData = exports.deleteTaskGroup = exports.initiateTaskListLocalData = exports.createNewTaskGroup = exports.bulkUpdateTaskList = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.getCannedResponsesView = exports.deleteCannedResponse = exports.saveCannedResponse = exports.fetchCannedResponses = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = void 0;
|
|
71
|
+
exports.getInviteFormView = exports.getReferralListView = exports.getNotifications = exports.getLastNotificationTime = exports.pushToastNotification = exports.isFeatureInterestRegistered = exports.getRegisteredInterestsByFeature = exports.getRegisteredInterests = exports.getFeatureNotificationView = exports.notifyMeForFeature = exports.fetchRegisteredInterests = exports.clearFeatureNotificationView = exports.getNotificationsForSelectedSubTab = exports.getExternalNotificationsForSelectedSubTab = exports.getNotificationView = exports.updateNotificationViewUIState = exports.updateNotificationViewSubTab = exports.updateNotificationViewCurrentTabAndSubTab = exports.updateNotificationViewTabState = exports.updateNotificationViewNotificationStatus = exports.updateNotificationViewAllNotificationsStatus = exports.fetchNotificationUnreadCountSuccess = exports.fetchNotificationUnreadCount = exports.fetchNotificationView = exports.toNotificationTabTypeStrict = exports.toNotificationSubTabTypeStrict = exports.updateCommentsNotificationsStatuses = exports.updateCommentsNotifications = exports.toNotificationModeStrict = exports.parseOAuthParams = exports.getZeniOAuthApproveRedirectUrl = exports.getZeniOAuthApproveFetchState = exports.getZeniOAuthApproveError = exports.clearZeniOAuthView = exports.approveOAuthConsentSuccess = exports.approveOAuthConsentFailure = exports.approveOAuthConsent = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.saveReasonForAuditRule = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getUserFromAllUsers = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.clearCardPaymentView = exports.resetCardPaymentErrorStatuses = void 0;
|
|
72
|
+
exports.toAiAccountantJob = exports.toAiAccountantEnrollment = exports.toAiAccountantCustomer = exports.toAiAccountantOperationType = exports.toAiAccountantJobStatus = exports.toAiAccountantEnrollmentStatus = exports.getAllowedOperationsForStatus = exports.getTreasuryFundsMaximumYield = exports.getTreasurySetupViewDetails = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = exports.submitInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.createTaskFromTaskGroupTemplate = exports.getCompanyTaskManagerView = exports.fetchTaskManagerMetrics = exports.fetchCompanyTaskManagerView = exports.toRecurringFrequency = exports.toDayOfWeek = exports.getRecurringEndDateFromCount = exports.getMinAllowedEndDate = exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = exports.ALL_WEEK_DAYS = exports.updateReferViewed = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = void 0;
|
|
73
|
+
exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setSessions = exports.setNewSession = exports.getSuggestedQuestionsForPageContext = exports.getAiCfoView = exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateResponseState = exports.deleteChatSession = exports.acceptMasterTOS = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearLastContextMessage = exports.clearDeleteChatSessionStatus = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCotCollapsedState = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = exports.fetchChatSessionsForUser = exports.getAiAccountantCockpitView = exports.updateAiAccountantUIState = exports.triggerAiAccountantJob = exports.setSelectedTenantIdsForJobTrigger = exports.fetchAiAccountantJobs = exports.fetchAiAccountantCustomers = exports.clearAiAccountantView = exports.cancelAiAccountantOnboarding = exports.getAiAccountantJobsByTenantId = exports.getAiAccountantCustomers = exports.updateAiAccountantJobs = exports.updateAiAccountantCustomer = exports.updateAiAccountantCustomers = exports.clearAllAiAccountantCustomers = void 0;
|
|
74
|
+
exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = void 0;
|
|
75
75
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
76
76
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
77
77
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -1942,6 +1942,14 @@ Object.defineProperty(exports, "getAccountingProviderAttachment", { enumerable:
|
|
|
1942
1942
|
const transactionDetailLocalDataHelper_1 = require("./view/transactionDetail/transactionDetailLocalDataHelper");
|
|
1943
1943
|
Object.defineProperty(exports, "getChangedLineItemCountFromLocalData", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.getChangedLineItemCountFromLocalData; } });
|
|
1944
1944
|
Object.defineProperty(exports, "isAccountUncategorized", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.isAccountUncategorized; } });
|
|
1945
|
+
const journalEntryLinesViewModel_1 = require("./view/transactionDetail/journalEntryLinesViewModel");
|
|
1946
|
+
Object.defineProperty(exports, "JOURNAL_ENTRY_SORT_KEYS", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.JOURNAL_ENTRY_SORT_KEYS; } });
|
|
1947
|
+
Object.defineProperty(exports, "filterJournalEntryLinesExcludingLinked", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.filterJournalEntryLinesExcludingLinked; } });
|
|
1948
|
+
Object.defineProperty(exports, "journalEntryDefaultSortConfig", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.journalEntryDefaultSortConfig; } });
|
|
1949
|
+
Object.defineProperty(exports, "journalEntryTotalsByPostingSide", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.journalEntryTotalsByPostingSide; } });
|
|
1950
|
+
Object.defineProperty(exports, "sortJournalEntryLines", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.sortJournalEntryLines; } });
|
|
1951
|
+
Object.defineProperty(exports, "sumJournalEntryAmounts", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.sumJournalEntryAmounts; } });
|
|
1952
|
+
Object.defineProperty(exports, "toJournalEntrySortKey", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.toJournalEntrySortKey; } });
|
|
1945
1953
|
const transactionDetailReducer_1 = require("./view/transactionDetail/transactionDetailReducer");
|
|
1946
1954
|
Object.defineProperty(exports, "clearTransactionDetailSaveStatus", { enumerable: true, get: function () { return transactionDetailReducer_1.clearTransactionDetailSaveStatus; } });
|
|
1947
1955
|
Object.defineProperty(exports, "deleteTransactionAttachment", { enumerable: true, get: function () { return transactionDetailReducer_1.deleteTransactionAttachment; } });
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Amount } from '../../commonStateTypes/amount';
|
|
2
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
|
+
import { JournalEntryTransactionLine, Line, TransactionLineBase } from '../../entity/transaction/stateTypes/transactionLine';
|
|
4
|
+
/**
|
|
5
|
+
* View-model helpers for the new Journal Entry table view (see
|
|
6
|
+
* web-components `journalEntryTable`). Keeps presentation-agnostic
|
|
7
|
+
* logic — totals, sort, line-filter — colocated in epic-state so it
|
|
8
|
+
* is testable and reusable.
|
|
9
|
+
*/
|
|
10
|
+
export declare const JOURNAL_ENTRY_SORT_KEYS: readonly ["description", "name", "category", "class", "debit", "credit"];
|
|
11
|
+
export declare const toJournalEntrySortKey: (v: string) => "name" | "description" | "category" | "class" | "credit" | "debit";
|
|
12
|
+
export type JournalEntrySortKey = ReturnType<typeof toJournalEntrySortKey>;
|
|
13
|
+
export interface JournalEntryRowSortConfig {
|
|
14
|
+
sortKey: JournalEntrySortKey;
|
|
15
|
+
sortOrder: SortOrder;
|
|
16
|
+
}
|
|
17
|
+
export declare const journalEntryDefaultSortConfig: JournalEntryRowSortConfig;
|
|
18
|
+
type AmountBearer = Pick<TransactionLineBase, 'amount'>;
|
|
19
|
+
/**
|
|
20
|
+
* Sums the `amount.amount` field of every line and returns an `Amount`
|
|
21
|
+
* whose currencyCode/currencySymbol are taken from the first line.
|
|
22
|
+
* Returns `undefined` for an empty list, and also when the first line
|
|
23
|
+
* has no currency to carry — a stray bare number with no symbol is
|
|
24
|
+
* worse to render than nothing, so the caller is forced to handle the
|
|
25
|
+
* absence.
|
|
26
|
+
*
|
|
27
|
+
* **Precondition:** all input lines must share a currency. Journal
|
|
28
|
+
* entry lines on the same transaction always do, which is the only
|
|
29
|
+
* caller today. Mixed-currency input is summed numerically (no FX
|
|
30
|
+
* conversion) and tagged with the first line's currency, which will
|
|
31
|
+
* silently produce a wrong total — if this helper is ever reused for
|
|
32
|
+
* a cross-currency aggregate (e.g. a multi-transaction report), the
|
|
33
|
+
* caller must pre-group by currency before calling.
|
|
34
|
+
*
|
|
35
|
+
* Mirrors legacy `calculateTotal` in
|
|
36
|
+
* `web-components/src/components/transactionDetail/items/TransactionLinesJournalEntry.tsx`
|
|
37
|
+
* but without the `Object.assign` ceremony and with stable currency carry-over.
|
|
38
|
+
*/
|
|
39
|
+
export declare const sumJournalEntryAmounts: (lines: ReadonlyArray<AmountBearer>) => Amount | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Splits `lines` by `postingType` into a single debit total and a
|
|
42
|
+
* single credit total — the shape the new flat-table totals row
|
|
43
|
+
* (`JournalEntryTotalsRow` in `web-components`, Figma frame
|
|
44
|
+
* `5177:12750`) needs.
|
|
45
|
+
*
|
|
46
|
+
* The legacy `TransactionLinesJournalEntry` grouped lines into six
|
|
47
|
+
* `JournalEntryItemType` buckets (`debit` / `uncategorizedDebit` /
|
|
48
|
+
* `miscategorizedDebit` plus the credit triplet) for *visual banner
|
|
49
|
+
* headers* in the line list; its bottom totals row was already two
|
|
50
|
+
* combined numbers. The new flat table folds those banners away by
|
|
51
|
+
* design, so we don't surface a per-status breakdown here. If the
|
|
52
|
+
* design ever asks for sub-totals per status, that's a richer shape
|
|
53
|
+
* (`{debit: {total, uncategorized, miscategorized}, credit: {…}}`)
|
|
54
|
+
* and a follow-up — not a v1 of this helper.
|
|
55
|
+
*
|
|
56
|
+
* As a side effect, the legacy `calculateCombinedTotalAmount`
|
|
57
|
+
* `??`/`+` precedence bug (`totalAmount?.amount ?? 0 + (uncat ?? 0) +
|
|
58
|
+
* (miscat ?? 0)` parses as `totalAmount?.amount ?? (0 + uncat +
|
|
59
|
+
* miscat)`, silently dropping the uncat/miscat pieces whenever
|
|
60
|
+
* `totalAmount` was non-nullish) is gone by construction here: there
|
|
61
|
+
* is no separate combine step, just one pass over the lines.
|
|
62
|
+
*/
|
|
63
|
+
export declare const journalEntryTotalsByPostingSide: (lines: ReadonlyArray<Pick<JournalEntryTransactionLine, "amount" | "postingType">>) => {
|
|
64
|
+
creditTotal?: Amount;
|
|
65
|
+
debitTotal?: Amount;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Drops `linked_transaction_line` entries — equivalent to legacy
|
|
69
|
+
* `filterOutLinkedTransactionLine` in `transactionDetail.helpers.ts`.
|
|
70
|
+
*
|
|
71
|
+
* The literal lives in `LINE_TYPE_LINKED` next to `LineType` so the
|
|
72
|
+
* filter discriminant stays bound to the union at the type level.
|
|
73
|
+
* Other sites still inlining the literal (see `transactionDetailLocalDataHelper`,
|
|
74
|
+
* `transactionDetailState`, `transactionCategorizationLocalDataHelper`,
|
|
75
|
+
* `transactionLinePayload`, and the mocks) are a known follow-up.
|
|
76
|
+
*/
|
|
77
|
+
export declare const filterJournalEntryLinesExcludingLinked: <T extends Pick<Line, "type">>(lines?: ReadonlyArray<T>) => T[];
|
|
78
|
+
/**
|
|
79
|
+
* Accessor functions resolve the sort value for each column from a
|
|
80
|
+
* line. The new table reads display-formatted values from the form
|
|
81
|
+
* (selected option label, entity name, etc.), so callers pass in
|
|
82
|
+
* accessors that match their `LineInfo` shape rather than baking the
|
|
83
|
+
* column-to-form-field mapping into epic-state.
|
|
84
|
+
*/
|
|
85
|
+
export interface JournalEntrySortAccessors<T> {
|
|
86
|
+
category: (line: T) => string;
|
|
87
|
+
class: (line: T) => string;
|
|
88
|
+
credit: (line: T) => number;
|
|
89
|
+
debit: (line: T) => number;
|
|
90
|
+
description: (line: T) => string;
|
|
91
|
+
name: (line: T) => string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Stable, accessor-driven sort over arbitrary line shapes. Lines that
|
|
95
|
+
* resolve to the same key value preserve their original relative order
|
|
96
|
+
* thanks to lodash's stable `orderBy`.
|
|
97
|
+
*
|
|
98
|
+
* Strings are lower-cased before comparison so the order is predictable
|
|
99
|
+
* across mixed-case data. Numbers (debit/credit) compare directly.
|
|
100
|
+
*/
|
|
101
|
+
export declare const sortJournalEntryLines: <T>(lines: ReadonlyArray<T>, config: JournalEntryRowSortConfig, accessors: JournalEntrySortAccessors<T>) => T[];
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sortJournalEntryLines = exports.filterJournalEntryLinesExcludingLinked = exports.journalEntryTotalsByPostingSide = exports.sumJournalEntryAmounts = exports.journalEntryDefaultSortConfig = exports.toJournalEntrySortKey = exports.JOURNAL_ENTRY_SORT_KEYS = void 0;
|
|
7
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
9
|
+
const transactionLine_1 = require("../../entity/transaction/stateTypes/transactionLine");
|
|
10
|
+
/**
|
|
11
|
+
* View-model helpers for the new Journal Entry table view (see
|
|
12
|
+
* web-components `journalEntryTable`). Keeps presentation-agnostic
|
|
13
|
+
* logic — totals, sort, line-filter — colocated in epic-state so it
|
|
14
|
+
* is testable and reusable.
|
|
15
|
+
*/
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Sort keys
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
exports.JOURNAL_ENTRY_SORT_KEYS = [
|
|
20
|
+
'description',
|
|
21
|
+
'name',
|
|
22
|
+
'category',
|
|
23
|
+
'class',
|
|
24
|
+
'debit',
|
|
25
|
+
'credit',
|
|
26
|
+
];
|
|
27
|
+
const toJournalEntrySortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.JOURNAL_ENTRY_SORT_KEYS);
|
|
28
|
+
exports.toJournalEntrySortKey = toJournalEntrySortKey;
|
|
29
|
+
exports.journalEntryDefaultSortConfig = {
|
|
30
|
+
sortKey: 'description',
|
|
31
|
+
sortOrder: 'ascending',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Sums the `amount.amount` field of every line and returns an `Amount`
|
|
35
|
+
* whose currencyCode/currencySymbol are taken from the first line.
|
|
36
|
+
* Returns `undefined` for an empty list, and also when the first line
|
|
37
|
+
* has no currency to carry — a stray bare number with no symbol is
|
|
38
|
+
* worse to render than nothing, so the caller is forced to handle the
|
|
39
|
+
* absence.
|
|
40
|
+
*
|
|
41
|
+
* **Precondition:** all input lines must share a currency. Journal
|
|
42
|
+
* entry lines on the same transaction always do, which is the only
|
|
43
|
+
* caller today. Mixed-currency input is summed numerically (no FX
|
|
44
|
+
* conversion) and tagged with the first line's currency, which will
|
|
45
|
+
* silently produce a wrong total — if this helper is ever reused for
|
|
46
|
+
* a cross-currency aggregate (e.g. a multi-transaction report), the
|
|
47
|
+
* caller must pre-group by currency before calling.
|
|
48
|
+
*
|
|
49
|
+
* Mirrors legacy `calculateTotal` in
|
|
50
|
+
* `web-components/src/components/transactionDetail/items/TransactionLinesJournalEntry.tsx`
|
|
51
|
+
* but without the `Object.assign` ceremony and with stable currency carry-over.
|
|
52
|
+
*/
|
|
53
|
+
const sumJournalEntryAmounts = (lines) => {
|
|
54
|
+
if (lines.length === 0) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
const first = lines[0].amount;
|
|
58
|
+
if (first?.currencyCode == null || first?.currencySymbol == null) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
let total = 0;
|
|
62
|
+
for (const line of lines) {
|
|
63
|
+
total += line.amount?.amount ?? 0;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
amount: total,
|
|
67
|
+
currencyCode: first.currencyCode,
|
|
68
|
+
currencySymbol: first.currencySymbol,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
exports.sumJournalEntryAmounts = sumJournalEntryAmounts;
|
|
72
|
+
/**
|
|
73
|
+
* Splits `lines` by `postingType` into a single debit total and a
|
|
74
|
+
* single credit total — the shape the new flat-table totals row
|
|
75
|
+
* (`JournalEntryTotalsRow` in `web-components`, Figma frame
|
|
76
|
+
* `5177:12750`) needs.
|
|
77
|
+
*
|
|
78
|
+
* The legacy `TransactionLinesJournalEntry` grouped lines into six
|
|
79
|
+
* `JournalEntryItemType` buckets (`debit` / `uncategorizedDebit` /
|
|
80
|
+
* `miscategorizedDebit` plus the credit triplet) for *visual banner
|
|
81
|
+
* headers* in the line list; its bottom totals row was already two
|
|
82
|
+
* combined numbers. The new flat table folds those banners away by
|
|
83
|
+
* design, so we don't surface a per-status breakdown here. If the
|
|
84
|
+
* design ever asks for sub-totals per status, that's a richer shape
|
|
85
|
+
* (`{debit: {total, uncategorized, miscategorized}, credit: {…}}`)
|
|
86
|
+
* and a follow-up — not a v1 of this helper.
|
|
87
|
+
*
|
|
88
|
+
* As a side effect, the legacy `calculateCombinedTotalAmount`
|
|
89
|
+
* `??`/`+` precedence bug (`totalAmount?.amount ?? 0 + (uncat ?? 0) +
|
|
90
|
+
* (miscat ?? 0)` parses as `totalAmount?.amount ?? (0 + uncat +
|
|
91
|
+
* miscat)`, silently dropping the uncat/miscat pieces whenever
|
|
92
|
+
* `totalAmount` was non-nullish) is gone by construction here: there
|
|
93
|
+
* is no separate combine step, just one pass over the lines.
|
|
94
|
+
*/
|
|
95
|
+
const journalEntryTotalsByPostingSide = (lines) => {
|
|
96
|
+
const debitLines = [];
|
|
97
|
+
const creditLines = [];
|
|
98
|
+
for (const line of lines) {
|
|
99
|
+
if (line.postingType === 'debit') {
|
|
100
|
+
debitLines.push(line);
|
|
101
|
+
}
|
|
102
|
+
else if (line.postingType === 'credit') {
|
|
103
|
+
creditLines.push(line);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
debitTotal: (0, exports.sumJournalEntryAmounts)(debitLines),
|
|
108
|
+
creditTotal: (0, exports.sumJournalEntryAmounts)(creditLines),
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
exports.journalEntryTotalsByPostingSide = journalEntryTotalsByPostingSide;
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Filter
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
/**
|
|
116
|
+
* Drops `linked_transaction_line` entries — equivalent to legacy
|
|
117
|
+
* `filterOutLinkedTransactionLine` in `transactionDetail.helpers.ts`.
|
|
118
|
+
*
|
|
119
|
+
* The literal lives in `LINE_TYPE_LINKED` next to `LineType` so the
|
|
120
|
+
* filter discriminant stays bound to the union at the type level.
|
|
121
|
+
* Other sites still inlining the literal (see `transactionDetailLocalDataHelper`,
|
|
122
|
+
* `transactionDetailState`, `transactionCategorizationLocalDataHelper`,
|
|
123
|
+
* `transactionLinePayload`, and the mocks) are a known follow-up.
|
|
124
|
+
*/
|
|
125
|
+
const filterJournalEntryLinesExcludingLinked = (lines) => lines?.filter((line) => line.type !== transactionLine_1.LINE_TYPE_LINKED) ?? [];
|
|
126
|
+
exports.filterJournalEntryLinesExcludingLinked = filterJournalEntryLinesExcludingLinked;
|
|
127
|
+
const sortOrderToLodash = (sortOrder) => sortOrder === 'descending' ? 'desc' : 'asc';
|
|
128
|
+
/**
|
|
129
|
+
* Stable, accessor-driven sort over arbitrary line shapes. Lines that
|
|
130
|
+
* resolve to the same key value preserve their original relative order
|
|
131
|
+
* thanks to lodash's stable `orderBy`.
|
|
132
|
+
*
|
|
133
|
+
* Strings are lower-cased before comparison so the order is predictable
|
|
134
|
+
* across mixed-case data. Numbers (debit/credit) compare directly.
|
|
135
|
+
*/
|
|
136
|
+
const sortJournalEntryLines = (lines, config, accessors) => {
|
|
137
|
+
const accessor = (line) => {
|
|
138
|
+
switch (config.sortKey) {
|
|
139
|
+
case 'description':
|
|
140
|
+
return accessors.description(line).toLowerCase();
|
|
141
|
+
case 'name':
|
|
142
|
+
return accessors.name(line).toLowerCase();
|
|
143
|
+
case 'category':
|
|
144
|
+
return accessors.category(line).toLowerCase();
|
|
145
|
+
case 'class':
|
|
146
|
+
return accessors.class(line).toLowerCase();
|
|
147
|
+
case 'debit':
|
|
148
|
+
return accessors.debit(line);
|
|
149
|
+
case 'credit':
|
|
150
|
+
return accessors.credit(line);
|
|
151
|
+
default:
|
|
152
|
+
// stringToUnion narrows permissively (returns `s as StringUnion` for
|
|
153
|
+
// non-member input, see commonStateTypes/stringToUnion.ts), so this
|
|
154
|
+
// branch is reachable at runtime — keep it as a description fallback.
|
|
155
|
+
return accessors.description(line).toLowerCase();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
return (0, orderBy_1.default)([...lines], [accessor], [sortOrderToLodash(config.sortOrder)]);
|
|
159
|
+
};
|
|
160
|
+
exports.sortJournalEntryLines = sortJournalEntryLines;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.89",
|
|
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",
|