@zeniai/client-epic-state 5.2.7-betaAK2 → 5.2.7-betaRD2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +11 -0
- package/lib/entity/invoicing/coupon/couponConstants.js +29 -0
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -22
- package/lib/entity/invoicing/invoicingCommonPayload.js +5 -22
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +79 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
- package/lib/epic.d.ts +9 -1
- package/lib/epic.js +16 -0
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +26 -0
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +5 -22
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/esm/epic.js +16 -0
- package/lib/esm/index.js +16 -9
- package/lib/esm/view/accountList/accountListReducer.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +99 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +139 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +106 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +306 -29
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +56 -11
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
- package/lib/esm/view/expenseAutomationView/types/transactionGroup.js +21 -0
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +1 -2
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -2
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +5 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +25 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +3 -27
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +3 -7
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +18 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +16 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +1 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +60 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +12 -0
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +1 -0
- package/lib/index.d.ts +19 -13
- package/lib/index.js +97 -48
- package/lib/view/accountList/accountListReducer.js +1 -0
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +20 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +103 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +146 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +110 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +1 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +11 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +308 -29
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +6 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +57 -12
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +302 -21
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +82 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionGroup.d.ts +21 -0
- package/lib/view/expenseAutomationView/types/transactionGroup.js +25 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +11 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +0 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +0 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -2
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +5 -10
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +29 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -9
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +4 -30
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +4 -11
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +3 -7
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +22 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +13 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +20 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +11 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +2 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +7 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +64 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +12 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +15 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +9 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +2 -0
- package/package.json +1 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InvoicingFormOption } from '../invoicingCommonPayload';
|
|
2
|
+
import { InvoicingCouponApplyOn, InvoicingCouponDurationType, InvoicingCouponPeriodUnit, InvoicingDiscountType } from './couponPayload';
|
|
3
|
+
/**
|
|
4
|
+
* Coupon form select options. Single source of truth (CES-owned) for the value
|
|
5
|
+
* sets that back the coupon's string-union domain fields; surfaced to the form
|
|
6
|
+
* via `getInvoicingCouponFormView` so web-components need not hardcode them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const INVOICING_DISCOUNT_TYPE_OPTIONS: readonly InvoicingFormOption<InvoicingDiscountType>[];
|
|
9
|
+
export declare const INVOICING_COUPON_DURATION_TYPE_OPTIONS: readonly InvoicingFormOption<InvoicingCouponDurationType>[];
|
|
10
|
+
export declare const INVOICING_COUPON_PERIOD_UNIT_OPTIONS: readonly InvoicingFormOption<InvoicingCouponPeriodUnit>[];
|
|
11
|
+
export declare const INVOICING_COUPON_APPLY_ON_OPTIONS: readonly InvoicingFormOption<InvoicingCouponApplyOn>[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INVOICING_COUPON_APPLY_ON_OPTIONS = exports.INVOICING_COUPON_PERIOD_UNIT_OPTIONS = exports.INVOICING_COUPON_DURATION_TYPE_OPTIONS = exports.INVOICING_DISCOUNT_TYPE_OPTIONS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Coupon form select options. Single source of truth (CES-owned) for the value
|
|
6
|
+
* sets that back the coupon's string-union domain fields; surfaced to the form
|
|
7
|
+
* via `getInvoicingCouponFormView` so web-components need not hardcode them.
|
|
8
|
+
*/
|
|
9
|
+
exports.INVOICING_DISCOUNT_TYPE_OPTIONS = [
|
|
10
|
+
{ label: 'Percentage', value: 'percentage' },
|
|
11
|
+
{ label: 'Fixed amount', value: 'fixed_amount' },
|
|
12
|
+
{ label: 'Offer quantity', value: 'offer_quantity' },
|
|
13
|
+
];
|
|
14
|
+
exports.INVOICING_COUPON_DURATION_TYPE_OPTIONS = [
|
|
15
|
+
{ label: 'One time', value: 'one_time' },
|
|
16
|
+
{ label: 'Forever', value: 'forever' },
|
|
17
|
+
{ label: 'Limited period', value: 'limited_period' },
|
|
18
|
+
];
|
|
19
|
+
exports.INVOICING_COUPON_PERIOD_UNIT_OPTIONS = [
|
|
20
|
+
{ label: 'Day', value: 'day' },
|
|
21
|
+
{ label: 'Week', value: 'week' },
|
|
22
|
+
{ label: 'Month', value: 'month' },
|
|
23
|
+
{ label: 'Year', value: 'year' },
|
|
24
|
+
];
|
|
25
|
+
exports.INVOICING_COUPON_APPLY_ON_OPTIONS = [
|
|
26
|
+
{ label: 'Invoice amount', value: 'invoice_amount' },
|
|
27
|
+
{ label: 'Each specified item', value: 'each_specified_item' },
|
|
28
|
+
{ label: 'Specified items total', value: 'specified_items_total' },
|
|
29
|
+
];
|
|
@@ -88,34 +88,12 @@ export interface InvoicingStripeAccountPayload {
|
|
|
88
88
|
export declare const INVOICING_QBO_CUSTOMER_MATCHING_MODES: readonly ["link_existing", "always_create"];
|
|
89
89
|
export type InvoicingQboCustomerMatchingMode = (typeof INVOICING_QBO_CUSTOMER_MATCHING_MODES)[number];
|
|
90
90
|
export declare function toInvoicingQboCustomerMatchingMode(value: string): InvoicingQboCustomerMatchingMode;
|
|
91
|
-
/**
|
|
92
|
-
* A mapped account as the newer settings payload returns it: the platform id,
|
|
93
|
-
* plus hydrated fields the client only displays.
|
|
94
|
-
*/
|
|
95
|
-
export interface InvoicingQboMappedAccountPayload {
|
|
96
|
-
account_id?: string | null;
|
|
97
|
-
account_name?: string | null;
|
|
98
|
-
fully_qualified_name?: string | null;
|
|
99
|
-
qbo_id?: string | null;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Account mappings arrive in two shapes. The original sends a bare id per slot
|
|
103
|
-
* (`deposit_account_id`); the newer one sends an object holding the platform id
|
|
104
|
-
* (`deposit_account: {account_id}`). Both are declared because a tenant can be
|
|
105
|
-
* served either depending on when its backend rolled, and a page that understands
|
|
106
|
-
* only one renders an empty picker over data that exists.
|
|
107
|
-
*/
|
|
108
91
|
export interface InvoicingQboAccountMappingsPayload {
|
|
109
|
-
default_income_account?: InvoicingQboMappedAccountPayload | null;
|
|
110
92
|
default_income_account_id?: string | null;
|
|
111
|
-
deposit_account?: InvoicingQboMappedAccountPayload | null;
|
|
112
93
|
deposit_account_id?: string | null;
|
|
113
94
|
deposit_account_overrides?: Record<string, string> | null;
|
|
114
|
-
discounts_account?: InvoicingQboMappedAccountPayload | null;
|
|
115
95
|
discounts_account_id?: string | null;
|
|
116
|
-
rounding_account?: InvoicingQboMappedAccountPayload | null;
|
|
117
96
|
rounding_account_id?: string | null;
|
|
118
|
-
write_off_account?: InvoicingQboMappedAccountPayload | null;
|
|
119
97
|
write_off_account_id?: string | null;
|
|
120
98
|
}
|
|
121
99
|
/**
|
|
@@ -153,23 +153,6 @@ function toInvoicingQboCustomerMatchingMode(value) {
|
|
|
153
153
|
throw new Error(`Unknown InvoicingQboCustomerMatchingMode: ${value}`);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
/**
|
|
157
|
-
* The id for one mapping slot, from whichever shape the backend sent. The object
|
|
158
|
-
* form wins when present; a blank id in either is treated as unset so the picker
|
|
159
|
-
* shows its placeholder rather than selecting nothing.
|
|
160
|
-
*/
|
|
161
|
-
function readInvoicingQboMappedAccountId(mappedAccount, legacyAccountId) {
|
|
162
|
-
// `qbo_id` first: the pickers key their options on the QuickBooks id, so an
|
|
163
|
-
// internal `account_id` would not select anything even when it is the same
|
|
164
|
-
// account. Both are read because the mapping arrives either way depending on
|
|
165
|
-
// how it was saved.
|
|
166
|
-
const candidates = [
|
|
167
|
-
mappedAccount?.qbo_id,
|
|
168
|
-
mappedAccount?.account_id,
|
|
169
|
-
legacyAccountId,
|
|
170
|
-
];
|
|
171
|
-
return candidates.find((candidate) => candidate != null && candidate !== '');
|
|
172
|
-
}
|
|
173
156
|
/**
|
|
174
157
|
* Read one account-mapping dropdown value by its config `code` (the codes in
|
|
175
158
|
* `qbo_account_mapping_kind_options` match the `account_mappings` field names).
|
|
@@ -177,15 +160,15 @@ function readInvoicingQboMappedAccountId(mappedAccount, legacyAccountId) {
|
|
|
177
160
|
function getInvoicingQboAccountMappingId(accountMappings, code) {
|
|
178
161
|
switch (code) {
|
|
179
162
|
case 'deposit_account_id':
|
|
180
|
-
return
|
|
163
|
+
return accountMappings?.deposit_account_id ?? undefined;
|
|
181
164
|
case 'default_income_account_id':
|
|
182
|
-
return
|
|
165
|
+
return accountMappings?.default_income_account_id ?? undefined;
|
|
183
166
|
case 'discounts_account_id':
|
|
184
|
-
return
|
|
167
|
+
return accountMappings?.discounts_account_id ?? undefined;
|
|
185
168
|
case 'rounding_account_id':
|
|
186
|
-
return
|
|
169
|
+
return accountMappings?.rounding_account_id ?? undefined;
|
|
187
170
|
case 'write_off_account_id':
|
|
188
|
-
return
|
|
171
|
+
return accountMappings?.write_off_account_id ?? undefined;
|
|
189
172
|
default:
|
|
190
173
|
return undefined;
|
|
191
174
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateJEScheduleKey = generateJEScheduleKey;
|
|
4
|
+
exports.generateJEOneTimeAccrualKey = generateJEOneTimeAccrualKey;
|
|
4
5
|
function generateJEScheduleKey(jeScheduleId, jeScheduleType) {
|
|
5
6
|
return `${jeScheduleId}_${jeScheduleType}`;
|
|
6
7
|
}
|
|
8
|
+
// Suffixed rather than using the bare Mongo _id so the key is a distinct type from
|
|
9
|
+
// JEScheduleKey / JEScheduleTransactionKey and the three cannot be passed interchangeably.
|
|
10
|
+
// The unsuffixed id stays on the entity as `accrualId` for callers that need it.
|
|
11
|
+
function generateJEOneTimeAccrualKey(accrualId) {
|
|
12
|
+
return `${accrualId}_one_time_accrual`;
|
|
13
|
+
}
|
|
@@ -7,7 +7,7 @@ import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDP
|
|
|
7
7
|
import { TransactionCategory } from '../transaction/stateTypes/transactionType';
|
|
8
8
|
import { UserPayload } from '../user/userPayload';
|
|
9
9
|
import { VendorPayload } from '../vendor/vendorPayload';
|
|
10
|
-
import { JEAccruedScheduledTransactionState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
|
|
10
|
+
import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
|
|
11
11
|
import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes';
|
|
12
12
|
export interface JEScheduleOtherAttributesPayload {
|
|
13
13
|
asset_id?: string | null;
|
|
@@ -72,9 +72,13 @@ export interface JEScheduledTransactionPayload {
|
|
|
72
72
|
updated_by: UserPayload;
|
|
73
73
|
vendor: VendorPayload;
|
|
74
74
|
ai_summaries?: JEScheduleAISummariesPayload;
|
|
75
|
+
confidence_score?: number | null;
|
|
76
|
+
create_time?: string | null;
|
|
75
77
|
created_by?: UserPayload;
|
|
76
78
|
end_date?: string | null;
|
|
79
|
+
posted_count?: number | null;
|
|
77
80
|
recommendations?: JEScheduleRecommendationsPayload;
|
|
81
|
+
recurring_amount?: number | null;
|
|
78
82
|
updated_at?: string | null;
|
|
79
83
|
}
|
|
80
84
|
export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTransactionPayload, 'base_transaction' | 'je_schedule_id' | 'je_schedule_type'> {
|
|
@@ -84,6 +88,66 @@ export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTr
|
|
|
84
88
|
memo: string;
|
|
85
89
|
recurring_amount: number;
|
|
86
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* The frozen vendor profile the Cron used to decide an accrual, so the detail page can show its
|
|
93
|
+
* reasoning even after the live profile is rebuilt. Present on agent/Cron rows ONLY — a human-created
|
|
94
|
+
* accrual carries none, which is why every consumer has to treat it as absent rather than empty.
|
|
95
|
+
*/
|
|
96
|
+
export interface JEOneTimeAccrualProfileSnapshotPayload {
|
|
97
|
+
billing_pattern?: {
|
|
98
|
+
avg_amount?: number | null;
|
|
99
|
+
billing_lag_days?: number | null;
|
|
100
|
+
consistency_score?: number | null;
|
|
101
|
+
frequency?: string | null;
|
|
102
|
+
last_bill_amount?: number | null;
|
|
103
|
+
last_bill_date?: string | null;
|
|
104
|
+
months_of_history?: number | null;
|
|
105
|
+
typical_bill_day?: number | null;
|
|
106
|
+
} | null;
|
|
107
|
+
monthly_totals?: Record<string, number> | null;
|
|
108
|
+
sorted_months?: string[] | null;
|
|
109
|
+
}
|
|
110
|
+
/** The JE the AI originally suggested, frozen at draft time for suggested-vs-posted comparison. */
|
|
111
|
+
export interface JEOneTimeAccrualAiSuggestionPayload {
|
|
112
|
+
estimated_amount?: number | null;
|
|
113
|
+
je_credit_account_id?: ID | null;
|
|
114
|
+
je_credit_account_name?: string | null;
|
|
115
|
+
je_debit_account_id?: ID | null;
|
|
116
|
+
je_debit_account_name?: string | null;
|
|
117
|
+
memo?: string | null;
|
|
118
|
+
}
|
|
119
|
+
export interface JEOneTimeAccrualPayload {
|
|
120
|
+
_id: ID;
|
|
121
|
+
estimated_amount: number;
|
|
122
|
+
origin: string;
|
|
123
|
+
service_month: string;
|
|
124
|
+
status: string;
|
|
125
|
+
vendor_id: ID;
|
|
126
|
+
vendor_name: string;
|
|
127
|
+
actual_post_date?: string | null;
|
|
128
|
+
actual_reversal_post_date?: string | null;
|
|
129
|
+
ai_suggestion?: JEOneTimeAccrualAiSuggestionPayload | null;
|
|
130
|
+
automation_tier?: string | null;
|
|
131
|
+
created_by_user?: UserPayload | null;
|
|
132
|
+
currency?: string | null;
|
|
133
|
+
expected_reversal_date?: string | null;
|
|
134
|
+
je_credit_account_id?: ID | null;
|
|
135
|
+
je_credit_account_name?: string | null;
|
|
136
|
+
je_credit_accounting_class_id?: ID | null;
|
|
137
|
+
je_credit_accounting_class_name?: string | null;
|
|
138
|
+
je_debit_account_id?: ID | null;
|
|
139
|
+
je_debit_account_name?: string | null;
|
|
140
|
+
je_debit_accounting_class_id?: ID | null;
|
|
141
|
+
je_debit_accounting_class_name?: string | null;
|
|
142
|
+
memo?: string | null;
|
|
143
|
+
posting_date?: string | null;
|
|
144
|
+
profile_snapshot?: JEOneTimeAccrualProfileSnapshotPayload | null;
|
|
145
|
+
reversal_policy?: string | null;
|
|
146
|
+
reversal_transaction_id?: ID | null;
|
|
147
|
+
reversal_trigger?: string | null;
|
|
148
|
+
transaction_id?: ID | null;
|
|
149
|
+
transaction_integration_id?: ID | null;
|
|
150
|
+
}
|
|
87
151
|
export interface ScheduledJournalEntryPayload {
|
|
88
152
|
actual_post_date: string | null;
|
|
89
153
|
create_time: string | null;
|
|
@@ -114,3 +178,4 @@ export declare function getJEScheduleTransactionDetailKeyPayload(payload: Schedu
|
|
|
114
178
|
export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
|
|
115
179
|
export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
|
|
116
180
|
export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
|
|
181
|
+
export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;
|
|
@@ -8,12 +8,15 @@ exports.getJEScheduleTransactionDetailKeyPayload = getJEScheduleTransactionDetai
|
|
|
8
8
|
exports.getJEScheduleKey = getJEScheduleKey;
|
|
9
9
|
exports.toJEScheduledTransaction = toJEScheduledTransaction;
|
|
10
10
|
exports.toJEAccruedScheduledTransaction = toJEAccruedScheduledTransaction;
|
|
11
|
+
exports.toJEOneTimeAccrual = toJEOneTimeAccrual;
|
|
11
12
|
const amount_1 = require("../../commonStateTypes/amount");
|
|
12
13
|
const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
13
14
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
15
|
+
const zeniUrl_1 = require("../../zeniUrl");
|
|
14
16
|
const transactionIDPayload_1 = require("../transaction/payloadTypes/transactionIDPayload");
|
|
15
17
|
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
16
18
|
const jeSchedulesTypes_1 = require("./jeSchedulesTypes");
|
|
19
|
+
const USD_CURRENCY_CODE = 'USD';
|
|
17
20
|
function toScheduledJournalEntryState(payload, currency_code, currency_symbol) {
|
|
18
21
|
return {
|
|
19
22
|
status: {
|
|
@@ -258,9 +261,18 @@ function toJEScheduledTransaction(payload) {
|
|
|
258
261
|
startDate: payload.start_date != null ? (0, zeniDayJS_1.date)(payload.start_date) : undefined,
|
|
259
262
|
endDate: payload.end_date != null ? (0, zeniDayJS_1.date)(payload.end_date) : undefined,
|
|
260
263
|
period: payload.period != null ? Number(payload.period) : undefined,
|
|
264
|
+
recurringAmount: payload.recurring_amount != null
|
|
265
|
+
? {
|
|
266
|
+
amount: payload.recurring_amount,
|
|
267
|
+
currencyCode: payload.currency_code,
|
|
268
|
+
currencySymbol: payload.currency_symbol,
|
|
269
|
+
}
|
|
270
|
+
: undefined,
|
|
271
|
+
postedCount: payload.posted_count ?? undefined,
|
|
261
272
|
updatedByUserID: payload.updated_by.user_id,
|
|
262
273
|
balanceAsOfToday: payload.balance ?? undefined,
|
|
263
274
|
updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
|
|
275
|
+
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
264
276
|
jeCredit: {
|
|
265
277
|
accountId: payload.je_credit_account_id ?? undefined,
|
|
266
278
|
accountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
@@ -285,6 +297,7 @@ function toJEScheduledTransaction(payload) {
|
|
|
285
297
|
: {},
|
|
286
298
|
scheduledJournalEntry: [],
|
|
287
299
|
aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
|
|
300
|
+
confidenceScore: payload.confidence_score ?? undefined,
|
|
288
301
|
createdByUserID: payload.created_by?.user_id ?? undefined,
|
|
289
302
|
recommendations: toJEScheduleRecommendations(payload.recommendations),
|
|
290
303
|
};
|
|
@@ -342,3 +355,125 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
342
355
|
jeScheduleType: (0, jeSchedulesTypes_1.toScheduleTypesTypeStrict)(payload.je_schedule_type),
|
|
343
356
|
};
|
|
344
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Reads the months in the order the snapshot gives them rather than deriving a range: a vendor that
|
|
360
|
+
* skipped a month has no entry for it, so filling gaps would invent history that was never billed.
|
|
361
|
+
*/
|
|
362
|
+
function toJEOneTimeAccrualMonthlyTotals(snapshot, currencyCode) {
|
|
363
|
+
const monthlyTotals = snapshot.monthly_totals;
|
|
364
|
+
if (monthlyTotals == null) {
|
|
365
|
+
return [];
|
|
366
|
+
}
|
|
367
|
+
const months = snapshot.sorted_months ?? Object.keys(monthlyTotals).sort();
|
|
368
|
+
return months
|
|
369
|
+
.filter((month) => monthlyTotals[month] != null)
|
|
370
|
+
.map((month) => ({
|
|
371
|
+
month,
|
|
372
|
+
amount: toOneTimeAccrualAmount(monthlyTotals[month], currencyCode),
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
function toJEOneTimeAccrualProfileSnapshot(payload, currencyCode) {
|
|
376
|
+
if (payload == null) {
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
const billingPattern = payload.billing_pattern;
|
|
380
|
+
return {
|
|
381
|
+
monthlyTotals: toJEOneTimeAccrualMonthlyTotals(payload, currencyCode),
|
|
382
|
+
billingPattern: billingPattern != null
|
|
383
|
+
? {
|
|
384
|
+
frequency: billingPattern.frequency ?? undefined,
|
|
385
|
+
monthsOfHistory: billingPattern.months_of_history ?? undefined,
|
|
386
|
+
consistencyScore: billingPattern.consistency_score ?? undefined,
|
|
387
|
+
billingLagDays: billingPattern.billing_lag_days ?? undefined,
|
|
388
|
+
typicalBillDay: billingPattern.typical_bill_day ?? undefined,
|
|
389
|
+
avgAmount: billingPattern.avg_amount != null
|
|
390
|
+
? toOneTimeAccrualAmount(billingPattern.avg_amount, currencyCode)
|
|
391
|
+
: undefined,
|
|
392
|
+
lastBillAmount: billingPattern.last_bill_amount != null
|
|
393
|
+
? toOneTimeAccrualAmount(billingPattern.last_bill_amount, currencyCode)
|
|
394
|
+
: undefined,
|
|
395
|
+
lastBillDate: billingPattern.last_bill_date != null
|
|
396
|
+
? (0, zeniDayJS_1.date)(billingPattern.last_bill_date)
|
|
397
|
+
: undefined,
|
|
398
|
+
}
|
|
399
|
+
: undefined,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function toJEOneTimeAccrualAiSuggestion(payload, currencyCode) {
|
|
403
|
+
if (payload == null) {
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
memo: payload.memo ?? undefined,
|
|
408
|
+
jeDebitAccountName: payload.je_debit_account_name ?? undefined,
|
|
409
|
+
jeCreditAccountName: payload.je_credit_account_name ?? undefined,
|
|
410
|
+
estimatedAmount: payload.estimated_amount != null
|
|
411
|
+
? toOneTimeAccrualAmount(payload.estimated_amount, currencyCode)
|
|
412
|
+
: undefined,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function toJEOneTimeAccrual(payload) {
|
|
416
|
+
return {
|
|
417
|
+
accrualId: payload._id,
|
|
418
|
+
vendorId: payload.vendor_id,
|
|
419
|
+
vendorName: payload.vendor_name,
|
|
420
|
+
serviceMonth: payload.service_month,
|
|
421
|
+
accrualStatus: (0, jeSchedulesTypes_1.toOneTimeAccrualStatusCodeType)(payload.status),
|
|
422
|
+
origin: (0, jeSchedulesTypes_1.toOneTimeAccrualOriginType)(payload.origin),
|
|
423
|
+
automationTier: payload.automation_tier != null
|
|
424
|
+
? (0, jeSchedulesTypes_1.toOneTimeAccrualAutomationTierType)(payload.automation_tier)
|
|
425
|
+
: undefined,
|
|
426
|
+
estimatedAmount: toOneTimeAccrualAmount(payload.estimated_amount, payload.currency),
|
|
427
|
+
memo: payload.memo ?? '',
|
|
428
|
+
profileSnapshot: toJEOneTimeAccrualProfileSnapshot(payload.profile_snapshot, payload.currency),
|
|
429
|
+
aiSuggestion: toJEOneTimeAccrualAiSuggestion(payload.ai_suggestion, payload.currency),
|
|
430
|
+
// Exclusive by contract: a scheduled row reverses on expectedReversalDate and bills never
|
|
431
|
+
// drive it, so the two never need reconciling. Defaulting to on_bill_match matches the
|
|
432
|
+
// create path's default when the field is absent on an older document.
|
|
433
|
+
reversalPolicy: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalPolicyType)(payload.reversal_policy ?? 'on_bill_match'),
|
|
434
|
+
reversalTrigger: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalTriggerType)(payload.reversal_trigger ?? undefined),
|
|
435
|
+
expectedReversalDate: payload.expected_reversal_date != null
|
|
436
|
+
? (0, zeniDayJS_1.date)(payload.expected_reversal_date)
|
|
437
|
+
: undefined,
|
|
438
|
+
postingDate: payload.posting_date != null ? (0, zeniDayJS_1.date)(payload.posting_date) : undefined,
|
|
439
|
+
actualPostDate: payload.actual_post_date != null
|
|
440
|
+
? (0, zeniDayJS_1.date)(payload.actual_post_date)
|
|
441
|
+
: undefined,
|
|
442
|
+
actualReversalPostDate: payload.actual_reversal_post_date != null
|
|
443
|
+
? (0, zeniDayJS_1.date)(payload.actual_reversal_post_date)
|
|
444
|
+
: undefined,
|
|
445
|
+
jeDebitAccountId: payload.je_debit_account_id ?? undefined,
|
|
446
|
+
jeDebitAccountName: payload.je_debit_account_name ?? undefined,
|
|
447
|
+
jeDebitAccountingClassId: payload.je_debit_accounting_class_id ?? undefined,
|
|
448
|
+
jeDebitAccountingClassName: payload.je_debit_accounting_class_name ?? undefined,
|
|
449
|
+
jeCreditAccountId: payload.je_credit_account_id ?? undefined,
|
|
450
|
+
jeCreditAccountName: payload.je_credit_account_name ?? undefined,
|
|
451
|
+
jeCreditAccountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
452
|
+
jeCreditAccountingClassName: payload.je_credit_accounting_class_name ?? undefined,
|
|
453
|
+
transactionId: payload.transaction_id ?? undefined,
|
|
454
|
+
transactionIntegrationId: payload.transaction_integration_id ?? undefined,
|
|
455
|
+
reversalTransactionId: payload.reversal_transaction_id ?? undefined,
|
|
456
|
+
createdBy: toJEOneTimeAccrualCreator(payload.created_by_user),
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
// The accrual wire format carries a currency CODE but no symbol, so the symbol has to be derived.
|
|
460
|
+
// Only USD has a known glyph today (the create path is USD-only); anything else falls back to the
|
|
461
|
+
// code, which reads correctly as "EUR 1,200" rather than silently rendering a wrong "$".
|
|
462
|
+
function toOneTimeAccrualAmount(amount, currencyCode) {
|
|
463
|
+
const code = currencyCode ?? USD_CURRENCY_CODE;
|
|
464
|
+
return (0, amount_1.toAmount)(amount, code, code === USD_CURRENCY_CODE ? '$' : code);
|
|
465
|
+
}
|
|
466
|
+
function toJEOneTimeAccrualCreator(payload) {
|
|
467
|
+
if (payload == null) {
|
|
468
|
+
return undefined;
|
|
469
|
+
}
|
|
470
|
+
return {
|
|
471
|
+
userId: payload.user_id,
|
|
472
|
+
email: payload.email ?? undefined,
|
|
473
|
+
firstName: payload.first_name ?? undefined,
|
|
474
|
+
lastName: payload.last_name ?? undefined,
|
|
475
|
+
photo: payload.photo?.original != null
|
|
476
|
+
? (0, zeniUrl_1.toZeniUrl)(payload.photo.original)
|
|
477
|
+
: undefined,
|
|
478
|
+
};
|
|
479
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UpdateType } from '../../commonStateTypes/common';
|
|
2
|
-
import { JEAccruedScheduledTransactionPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './jeSchedulesPayload';
|
|
2
|
+
import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './jeSchedulesPayload';
|
|
3
3
|
import { JESchedulesState } from './jeSchedulesState';
|
|
4
4
|
export declare const initialState: JESchedulesState;
|
|
5
5
|
export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[]], {
|
|
@@ -22,6 +22,8 @@ export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreator
|
|
|
22
22
|
jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
23
23
|
}, "jeSchedules/deleteJESchedulesDetails", never, never>, deleteAccruedJESchedulesDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[JEScheduleKey: `${string}_${string}`], {
|
|
24
24
|
JEScheduleKey: `${string}_${string}`;
|
|
25
|
-
}, "jeSchedules/deleteAccruedJESchedulesDetails", never, never
|
|
25
|
+
}, "jeSchedules/deleteAccruedJESchedulesDetails", never, never>, clearAllAccruedJESchedules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllAccruedJESchedules">, clearAllJEScheduleTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllJEScheduleTransactions">, updateJEOneTimeAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeOneTimeAccrualsPayload: JEOneTimeAccrualPayload[]], {
|
|
26
|
+
jeOneTimeAccrualsPayload: JEOneTimeAccrualPayload[];
|
|
27
|
+
}, "jeSchedules/updateJEOneTimeAccruals", never, never>;
|
|
26
28
|
declare const _default: import("redux").Reducer<JESchedulesState>;
|
|
27
29
|
export default _default;
|
|
@@ -4,14 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
|
|
7
|
+
exports.updateJEOneTimeAccruals = exports.clearAllJEScheduleTransactions = exports.clearAllAccruedJESchedules = exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
10
10
|
const rootActions_1 = require("../../rootActions");
|
|
11
|
+
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
11
12
|
const jeSchedulesPayload_1 = require("./jeSchedulesPayload");
|
|
12
13
|
exports.initialState = {
|
|
13
14
|
schedulesByTransactionKey: {},
|
|
14
15
|
schedulesByAccruedJEScheduleKey: {},
|
|
16
|
+
oneTimeAccrualsByKey: {},
|
|
15
17
|
};
|
|
16
18
|
const jeSchedules = (0, toolkit_1.createSlice)({
|
|
17
19
|
name: 'jeSchedules',
|
|
@@ -116,15 +118,41 @@ const jeSchedules = (0, toolkit_1.createSlice)({
|
|
|
116
118
|
delete draft.schedulesByAccruedJEScheduleKey[JEScheduleKey];
|
|
117
119
|
},
|
|
118
120
|
},
|
|
121
|
+
// Writes directly, unlike updateAccruedJESchedules / updateJESchedules, which are no-op
|
|
122
|
+
// actions whose only job is to trigger the entity fan-out epic that fetches vendors,
|
|
123
|
+
// accounts, classes and users. An accrual denormalizes all of those as names on the document,
|
|
124
|
+
// so there is nothing to fan out to.
|
|
125
|
+
updateJEOneTimeAccruals: {
|
|
126
|
+
prepare(jeOneTimeAccrualsPayload) {
|
|
127
|
+
return {
|
|
128
|
+
payload: {
|
|
129
|
+
jeOneTimeAccrualsPayload,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
reducer(draft, action) {
|
|
134
|
+
action.payload.jeOneTimeAccrualsPayload.forEach((accrualPayload) => {
|
|
135
|
+
const accrual = (0, jeSchedulesPayload_1.toJEOneTimeAccrual)(accrualPayload);
|
|
136
|
+
draft.oneTimeAccrualsByKey[(0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual.accrualId)] = accrual;
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
clearAllJEScheduleTransactions(draft) {
|
|
141
|
+
draft.schedulesByTransactionKey = {};
|
|
142
|
+
},
|
|
143
|
+
clearAllAccruedJESchedules(draft) {
|
|
144
|
+
draft.schedulesByAccruedJEScheduleKey = {};
|
|
145
|
+
},
|
|
119
146
|
},
|
|
120
147
|
extraReducers: (builder) => {
|
|
121
148
|
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
122
149
|
draft.schedulesByAccruedJEScheduleKey = {};
|
|
123
150
|
draft.schedulesByTransactionKey = {};
|
|
151
|
+
draft.oneTimeAccrualsByKey = {};
|
|
124
152
|
});
|
|
125
153
|
},
|
|
126
154
|
});
|
|
127
|
-
_a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails;
|
|
155
|
+
_a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails, exports.clearAllAccruedJESchedules = _a.clearAllAccruedJESchedules, exports.clearAllJEScheduleTransactions = _a.clearAllJEScheduleTransactions, exports.updateJEOneTimeAccruals = _a.updateJEOneTimeAccruals;
|
|
128
156
|
exports.default = jeSchedules.reducer;
|
|
129
157
|
/**
|
|
130
158
|
* Helper functions
|
|
@@ -9,8 +9,8 @@ import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransacti
|
|
|
9
9
|
import { TransactionID } from '../transaction/stateTypes/transactionID';
|
|
10
10
|
import { User } from '../user/userState';
|
|
11
11
|
import { Vendor } from '../vendor/vendorState';
|
|
12
|
-
import { JEScheduleAISummaries, JEScheduleOtherAttributes, JEScheduleRecommendations, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
|
|
13
|
-
import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
12
|
+
import { JEOneTimeAccrualState, JEScheduleAISummaries, JEScheduleOtherAttributes, JEScheduleRecommendations, JESchedulesState, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
|
|
13
|
+
import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
14
14
|
export interface ScheduledJournalEntry {
|
|
15
15
|
error: JournalEntryErrorCodeType[];
|
|
16
16
|
expectedPostDate: ZeniDate;
|
|
@@ -55,13 +55,17 @@ export interface JEScheduledTransaction {
|
|
|
55
55
|
accountingClass?: Class;
|
|
56
56
|
};
|
|
57
57
|
jeScheduleTransactionKey: JEScheduleTransactionKey;
|
|
58
|
+
lifecycleTotal: number;
|
|
58
59
|
otherAttributes: JEScheduleOtherAttributes;
|
|
60
|
+
postedCount: number;
|
|
59
61
|
scheduledJournalEntry: ScheduledJournalEntry[];
|
|
60
62
|
status: ScheduleStatus;
|
|
61
63
|
vendor: Vendor;
|
|
62
64
|
aiSummaries?: JEScheduleAISummaries;
|
|
63
65
|
balanceAsOfToday?: Amount;
|
|
66
|
+
confidenceScore?: number;
|
|
64
67
|
createdByUser?: User;
|
|
68
|
+
createTime?: ZeniDate;
|
|
65
69
|
dayOfPostingDate?: ScheduleDaysOfMonth;
|
|
66
70
|
endDate?: ZeniDate;
|
|
67
71
|
jeScheduleId?: ID;
|
|
@@ -69,9 +73,14 @@ export interface JEScheduledTransaction {
|
|
|
69
73
|
lastDayOfMonth?: boolean;
|
|
70
74
|
period?: number;
|
|
71
75
|
recommendations?: JEScheduleRecommendations;
|
|
76
|
+
recurringAmount?: Amount;
|
|
72
77
|
startDate?: ZeniDate;
|
|
73
78
|
updatedAt?: ZeniDate;
|
|
74
79
|
updatedByUser?: User;
|
|
75
80
|
}
|
|
81
|
+
export interface JEOneTimeAccrual extends JEOneTimeAccrualState {
|
|
82
|
+
jeOneTimeAccrualKey: JEOneTimeAccrualKey;
|
|
83
|
+
}
|
|
84
|
+
export declare const getJEOneTimeAccrualByKey: (jeOneTimeAccrualKey: JEOneTimeAccrualKey, jeSchedulesState: JESchedulesState) => JEOneTimeAccrual | undefined;
|
|
76
85
|
export declare const getJEAccruedScheduleByJEScheduleKey: (JEScheduleKey: JEScheduleKey, state: RootState) => JEAccruedSchedule | undefined;
|
|
77
86
|
export declare const getJEScheduledTransactionByJEScheduleTransactionKey: (jeScheduleTransactionKey: JEScheduleTransactionKey, state: RootState) => JEScheduledTransaction;
|