@zeniai/client-epic-state 5.1.82 → 5.1.83-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/entity/jeSchedules/jeScheduleHelper.d.ts +2 -0
- package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +34 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +68 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +26 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +10 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +28 -3
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +41 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +12 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +40 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +29 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +1 -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 +5 -1
- package/lib/epic.js +5 -1
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +68 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +26 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +26 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +34 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +29 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -1
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +11 -5
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +34 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +21 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +73 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +163 -28
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +70 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +260 -22
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +24 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +24 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +33 -9
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +35 -9
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +32 -5
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +23 -3
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +24 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +60 -17
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +29 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +28 -5
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +24 -4
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +22 -14
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +46 -7
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +26 -8
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +4 -1
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +41 -9
- package/lib/index.d.ts +18 -13
- package/lib/index.js +72 -50
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +32 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -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 +77 -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/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 +8 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +45 -10
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +164 -28
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +25 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +34 -8
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +10 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +75 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +10 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +266 -21
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +59 -8
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +23 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -1
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +23 -3
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +22 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.js +32 -8
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +34 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +31 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +22 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +23 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +2 -1
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +59 -16
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +11 -31
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -1
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +28 -9
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +27 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +23 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +24 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +23 -16
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +45 -6
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +25 -7
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +4 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +2 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +40 -8
- package/package.json +1 -1
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
1
2
|
import { JEAccruedScheduledTransactionPayload } from './jeSchedulesPayload';
|
|
2
3
|
export declare function generateJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): `${string}_${string}`;
|
|
4
|
+
export declare function generateJEOneTimeAccrualKey(accrualId: ID): `${string}_one_time_accrual`;
|
|
@@ -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(payload) {
|
|
5
6
|
return `${payload.je_schedule_id}_${payload.je_schedule_type}`;
|
|
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,6 +72,8 @@ 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;
|
|
77
79
|
recommendations?: JEScheduleRecommendationsPayload;
|
|
@@ -84,6 +86,36 @@ export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTr
|
|
|
84
86
|
memo: string;
|
|
85
87
|
recurring_amount: number;
|
|
86
88
|
}
|
|
89
|
+
export interface JEOneTimeAccrualPayload {
|
|
90
|
+
_id: ID;
|
|
91
|
+
estimated_amount: number;
|
|
92
|
+
origin: string;
|
|
93
|
+
service_month: string;
|
|
94
|
+
status: string;
|
|
95
|
+
vendor_id: ID;
|
|
96
|
+
vendor_name: string;
|
|
97
|
+
actual_post_date?: string | null;
|
|
98
|
+
actual_reversal_post_date?: string | null;
|
|
99
|
+
automation_tier?: string | null;
|
|
100
|
+
created_by_user?: UserPayload | null;
|
|
101
|
+
currency?: string | null;
|
|
102
|
+
expected_reversal_date?: string | null;
|
|
103
|
+
je_credit_account_id?: ID | null;
|
|
104
|
+
je_credit_account_name?: string | null;
|
|
105
|
+
je_credit_accounting_class_id?: ID | null;
|
|
106
|
+
je_credit_accounting_class_name?: string | null;
|
|
107
|
+
je_debit_account_id?: ID | null;
|
|
108
|
+
je_debit_account_name?: string | null;
|
|
109
|
+
je_debit_accounting_class_id?: ID | null;
|
|
110
|
+
je_debit_accounting_class_name?: string | null;
|
|
111
|
+
memo?: string | null;
|
|
112
|
+
posting_date?: string | null;
|
|
113
|
+
reversal_policy?: string | null;
|
|
114
|
+
reversal_transaction_id?: ID | null;
|
|
115
|
+
reversal_trigger?: string | null;
|
|
116
|
+
transaction_id?: ID | null;
|
|
117
|
+
transaction_integration_id?: ID | null;
|
|
118
|
+
}
|
|
87
119
|
export interface ScheduledJournalEntryPayload {
|
|
88
120
|
actual_post_date: string | null;
|
|
89
121
|
create_time: string | null;
|
|
@@ -114,3 +146,4 @@ export declare function getJEScheduleTransactionDetailKeyPayload(payload: Schedu
|
|
|
114
146
|
export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
|
|
115
147
|
export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
|
|
116
148
|
export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
|
|
149
|
+
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: {
|
|
@@ -261,6 +264,7 @@ function toJEScheduledTransaction(payload) {
|
|
|
261
264
|
updatedByUserID: payload.updated_by.user_id,
|
|
262
265
|
balanceAsOfToday: payload.balance ?? undefined,
|
|
263
266
|
updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
|
|
267
|
+
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
264
268
|
jeCredit: {
|
|
265
269
|
accountId: payload.je_credit_account_id ?? undefined,
|
|
266
270
|
accountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
@@ -285,6 +289,7 @@ function toJEScheduledTransaction(payload) {
|
|
|
285
289
|
: {},
|
|
286
290
|
scheduledJournalEntry: [],
|
|
287
291
|
aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
|
|
292
|
+
confidenceScore: payload.confidence_score ?? undefined,
|
|
288
293
|
createdByUserID: payload.created_by?.user_id ?? undefined,
|
|
289
294
|
recommendations: toJEScheduleRecommendations(payload.recommendations),
|
|
290
295
|
};
|
|
@@ -342,3 +347,66 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
342
347
|
jeScheduleType: (0, jeSchedulesTypes_1.toScheduleTypesTypeStrict)(payload.je_schedule_type),
|
|
343
348
|
};
|
|
344
349
|
}
|
|
350
|
+
function toJEOneTimeAccrual(payload) {
|
|
351
|
+
return {
|
|
352
|
+
accrualId: payload._id,
|
|
353
|
+
vendorId: payload.vendor_id,
|
|
354
|
+
vendorName: payload.vendor_name,
|
|
355
|
+
serviceMonth: payload.service_month,
|
|
356
|
+
accrualStatus: (0, jeSchedulesTypes_1.toOneTimeAccrualStatusCodeType)(payload.status),
|
|
357
|
+
origin: (0, jeSchedulesTypes_1.toOneTimeAccrualOriginType)(payload.origin),
|
|
358
|
+
automationTier: payload.automation_tier != null
|
|
359
|
+
? (0, jeSchedulesTypes_1.toOneTimeAccrualAutomationTierType)(payload.automation_tier)
|
|
360
|
+
: undefined,
|
|
361
|
+
estimatedAmount: toOneTimeAccrualAmount(payload.estimated_amount, payload.currency),
|
|
362
|
+
memo: payload.memo ?? '',
|
|
363
|
+
// Exclusive by contract: a scheduled row reverses on expectedReversalDate and bills never
|
|
364
|
+
// drive it, so the two never need reconciling. Defaulting to on_bill_match matches the
|
|
365
|
+
// create path's default when the field is absent on an older document.
|
|
366
|
+
reversalPolicy: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalPolicyType)(payload.reversal_policy ?? 'on_bill_match'),
|
|
367
|
+
reversalTrigger: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalTriggerType)(payload.reversal_trigger ?? undefined),
|
|
368
|
+
expectedReversalDate: payload.expected_reversal_date != null
|
|
369
|
+
? (0, zeniDayJS_1.date)(payload.expected_reversal_date)
|
|
370
|
+
: undefined,
|
|
371
|
+
postingDate: payload.posting_date != null ? (0, zeniDayJS_1.date)(payload.posting_date) : undefined,
|
|
372
|
+
actualPostDate: payload.actual_post_date != null
|
|
373
|
+
? (0, zeniDayJS_1.date)(payload.actual_post_date)
|
|
374
|
+
: undefined,
|
|
375
|
+
actualReversalPostDate: payload.actual_reversal_post_date != null
|
|
376
|
+
? (0, zeniDayJS_1.date)(payload.actual_reversal_post_date)
|
|
377
|
+
: undefined,
|
|
378
|
+
jeDebitAccountId: payload.je_debit_account_id ?? undefined,
|
|
379
|
+
jeDebitAccountName: payload.je_debit_account_name ?? undefined,
|
|
380
|
+
jeDebitAccountingClassId: payload.je_debit_accounting_class_id ?? undefined,
|
|
381
|
+
jeDebitAccountingClassName: payload.je_debit_accounting_class_name ?? undefined,
|
|
382
|
+
jeCreditAccountId: payload.je_credit_account_id ?? undefined,
|
|
383
|
+
jeCreditAccountName: payload.je_credit_account_name ?? undefined,
|
|
384
|
+
jeCreditAccountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
385
|
+
jeCreditAccountingClassName: payload.je_credit_accounting_class_name ?? undefined,
|
|
386
|
+
transactionId: payload.transaction_id ?? undefined,
|
|
387
|
+
transactionIntegrationId: payload.transaction_integration_id ?? undefined,
|
|
388
|
+
reversalTransactionId: payload.reversal_transaction_id ?? undefined,
|
|
389
|
+
createdBy: toJEOneTimeAccrualCreator(payload.created_by_user),
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
// The accrual wire format carries a currency CODE but no symbol, so the symbol has to be derived.
|
|
393
|
+
// Only USD has a known glyph today (the create path is USD-only); anything else falls back to the
|
|
394
|
+
// code, which reads correctly as "EUR 1,200" rather than silently rendering a wrong "$".
|
|
395
|
+
function toOneTimeAccrualAmount(amount, currencyCode) {
|
|
396
|
+
const code = currencyCode ?? USD_CURRENCY_CODE;
|
|
397
|
+
return (0, amount_1.toAmount)(amount, code, code === USD_CURRENCY_CODE ? '$' : code);
|
|
398
|
+
}
|
|
399
|
+
function toJEOneTimeAccrualCreator(payload) {
|
|
400
|
+
if (payload == null) {
|
|
401
|
+
return undefined;
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
userId: payload.user_id,
|
|
405
|
+
email: payload.email ?? undefined,
|
|
406
|
+
firstName: payload.first_name ?? undefined,
|
|
407
|
+
lastName: payload.last_name ?? undefined,
|
|
408
|
+
photo: payload.photo?.original != null
|
|
409
|
+
? (0, zeniUrl_1.toZeniUrl)(payload.photo.original)
|
|
410
|
+
: undefined,
|
|
411
|
+
};
|
|
412
|
+
}
|
|
@@ -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}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${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>, clearAllAccruedJESchedules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllAccruedJESchedules">, clearAllJEScheduleTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllJEScheduleTransactions"
|
|
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>, clearAllJEOneTimeAccruals: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllJEOneTimeAccruals">;
|
|
26
28
|
declare const _default: import("redux").Reducer<JESchedulesState>;
|
|
27
29
|
export default _default;
|
|
@@ -4,13 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.clearAllJEScheduleTransactions = exports.clearAllAccruedJESchedules = exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
|
|
7
|
+
exports.clearAllJEOneTimeAccruals = 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
|
+
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
10
11
|
const jeSchedulesPayload_1 = require("./jeSchedulesPayload");
|
|
11
12
|
exports.initialState = {
|
|
12
13
|
schedulesByTransactionKey: {},
|
|
13
14
|
schedulesByAccruedJEScheduleKey: {},
|
|
15
|
+
oneTimeAccrualsByKey: {},
|
|
14
16
|
};
|
|
15
17
|
const jeSchedules = (0, toolkit_1.createSlice)({
|
|
16
18
|
name: 'jeSchedules',
|
|
@@ -115,15 +117,37 @@ const jeSchedules = (0, toolkit_1.createSlice)({
|
|
|
115
117
|
delete draft.schedulesByAccruedJEScheduleKey[JEScheduleKey];
|
|
116
118
|
},
|
|
117
119
|
},
|
|
120
|
+
// Writes directly, unlike updateAccruedJESchedules / updateJESchedules, which are no-op
|
|
121
|
+
// actions whose only job is to trigger the entity fan-out epic that fetches vendors,
|
|
122
|
+
// accounts, classes and users. An accrual denormalizes all of those as names on the document,
|
|
123
|
+
// so there is nothing to fan out to.
|
|
124
|
+
updateJEOneTimeAccruals: {
|
|
125
|
+
prepare(jeOneTimeAccrualsPayload) {
|
|
126
|
+
return {
|
|
127
|
+
payload: {
|
|
128
|
+
jeOneTimeAccrualsPayload,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
reducer(draft, action) {
|
|
133
|
+
action.payload.jeOneTimeAccrualsPayload.forEach((accrualPayload) => {
|
|
134
|
+
const accrual = (0, jeSchedulesPayload_1.toJEOneTimeAccrual)(accrualPayload);
|
|
135
|
+
draft.oneTimeAccrualsByKey[(0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual.accrualId)] = accrual;
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
},
|
|
118
139
|
clearAllJEScheduleTransactions(draft) {
|
|
119
140
|
draft.schedulesByTransactionKey = {};
|
|
120
141
|
},
|
|
121
142
|
clearAllAccruedJESchedules(draft) {
|
|
122
143
|
draft.schedulesByAccruedJEScheduleKey = {};
|
|
123
144
|
},
|
|
145
|
+
clearAllJEOneTimeAccruals(draft) {
|
|
146
|
+
draft.oneTimeAccrualsByKey = {};
|
|
147
|
+
},
|
|
124
148
|
},
|
|
125
149
|
});
|
|
126
|
-
_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;
|
|
150
|
+
_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, exports.clearAllJEOneTimeAccruals = _a.clearAllJEOneTimeAccruals;
|
|
127
151
|
exports.default = jeSchedules.reducer;
|
|
128
152
|
/**
|
|
129
153
|
* Helper functions
|
|
@@ -9,8 +9,8 @@ import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransacti
|
|
|
9
9
|
import { TransactionID } from '../transaction/stateTypes/transaction';
|
|
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;
|
|
@@ -73,5 +77,9 @@ export interface JEScheduledTransaction {
|
|
|
73
77
|
updatedAt?: ZeniDate;
|
|
74
78
|
updatedByUser?: User;
|
|
75
79
|
}
|
|
80
|
+
export interface JEOneTimeAccrual extends JEOneTimeAccrualState {
|
|
81
|
+
jeOneTimeAccrualKey: JEOneTimeAccrualKey;
|
|
82
|
+
}
|
|
83
|
+
export declare const getJEOneTimeAccrualByKey: (jeOneTimeAccrualKey: JEOneTimeAccrualKey, jeSchedulesState: JESchedulesState) => JEOneTimeAccrual | undefined;
|
|
76
84
|
export declare const getJEAccruedScheduleByJEScheduleKey: (JEScheduleKey: JEScheduleKey, state: RootState) => JEAccruedSchedule | undefined;
|
|
77
85
|
export declare const getJEScheduledTransactionByJEScheduleTransactionKey: (jeScheduleTransactionKey: JEScheduleTransactionKey, state: RootState) => JEScheduledTransaction;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getJEScheduledTransactionByJEScheduleTransactionKey = exports.getJEAccruedScheduleByJEScheduleKey = void 0;
|
|
6
|
+
exports.getJEScheduledTransactionByJEScheduleTransactionKey = exports.getJEAccruedScheduleByJEScheduleKey = exports.getJEOneTimeAccrualByKey = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const amount_1 = require("../../commonStateTypes/amount");
|
|
9
9
|
const accountSelector_1 = require("../account/accountSelector");
|
|
@@ -11,13 +11,27 @@ const classSelector_1 = require("../class/classSelector");
|
|
|
11
11
|
const transactionSelector_1 = require("../transaction/transactionSelector");
|
|
12
12
|
const userSelector_1 = require("../user/userSelector");
|
|
13
13
|
const vendorSelector_1 = require("../vendor/vendorSelector");
|
|
14
|
+
// Takes the slice, not RootState: an accrual denormalizes its vendor, account and class names, so
|
|
15
|
+
// unlike getJEAccruedScheduleByJEScheduleKey this joins nothing.
|
|
16
|
+
//
|
|
17
|
+
// Spreads the stored entity rather than rebuilding it field by field. That is deliberate — the
|
|
18
|
+
// accrued joiner listed every field explicitly and silently dropped jeScheduleType, which made a
|
|
19
|
+
// whole tab render empty while its reducer test still passed. A spread cannot lose a field.
|
|
20
|
+
const getJEOneTimeAccrualByKey = (jeOneTimeAccrualKey, jeSchedulesState) => {
|
|
21
|
+
const accrual = (0, get_1.default)(jeSchedulesState.oneTimeAccrualsByKey, jeOneTimeAccrualKey);
|
|
22
|
+
if (accrual == null) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return { ...accrual, jeOneTimeAccrualKey };
|
|
26
|
+
};
|
|
27
|
+
exports.getJEOneTimeAccrualByKey = getJEOneTimeAccrualByKey;
|
|
14
28
|
const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
15
29
|
const { jeSchedulesState, vendorState, accountState, userState, classState } = state;
|
|
16
30
|
const JEAccruedScheduleState = (0, get_1.default)(jeSchedulesState.schedulesByAccruedJEScheduleKey, JEScheduleKey);
|
|
17
31
|
if (JEAccruedScheduleState == null) {
|
|
18
32
|
return undefined;
|
|
19
33
|
}
|
|
20
|
-
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, } = JEAccruedScheduleState;
|
|
34
|
+
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, jeScheduleType, } = JEAccruedScheduleState;
|
|
21
35
|
const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
|
|
22
36
|
if (vendorDetails == null) {
|
|
23
37
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
@@ -41,6 +55,8 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
|
41
55
|
reportId: 'class_list',
|
|
42
56
|
})
|
|
43
57
|
: undefined;
|
|
58
|
+
const postedCount = scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
|
|
59
|
+
const lifecycleTotal = period ?? scheduledJournalEntry.length;
|
|
44
60
|
return {
|
|
45
61
|
jeScheduleId,
|
|
46
62
|
otherAttributes,
|
|
@@ -49,6 +65,8 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
|
49
65
|
updatedAt,
|
|
50
66
|
currencyCode,
|
|
51
67
|
currencySymbol,
|
|
68
|
+
lifecycleTotal,
|
|
69
|
+
postedCount,
|
|
52
70
|
jeCredit: {
|
|
53
71
|
accountingClass: classCredit,
|
|
54
72
|
account: accountCredit,
|
|
@@ -66,6 +84,7 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
|
66
84
|
memo,
|
|
67
85
|
createTime,
|
|
68
86
|
recurringAmount,
|
|
87
|
+
jeScheduleType,
|
|
69
88
|
jeAccruedScheduleKey: JEScheduleKey,
|
|
70
89
|
balanceAsOfToday: balanceAsOfToday != null
|
|
71
90
|
? (0, amount_1.toAmount)(balanceAsOfToday, currencyCode, currencySymbol)
|
|
@@ -77,7 +96,7 @@ exports.getJEAccruedScheduleByJEScheduleKey = getJEAccruedScheduleByJEScheduleKe
|
|
|
77
96
|
const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
|
|
78
97
|
const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
|
|
79
98
|
const jeScheduleTransactionState = (0, get_1.default)(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
|
|
80
|
-
const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, recommendations, } = jeScheduleTransactionState;
|
|
99
|
+
const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, createTime, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, confidenceScore, recommendations, } = jeScheduleTransactionState;
|
|
81
100
|
const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
|
|
82
101
|
if (vendorDetails == null) {
|
|
83
102
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
@@ -106,6 +125,8 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
|
|
|
106
125
|
reportId: 'class_list',
|
|
107
126
|
})
|
|
108
127
|
: undefined;
|
|
128
|
+
const postedCount = scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
|
|
129
|
+
const lifecycleTotal = period ?? scheduledJournalEntry.length;
|
|
109
130
|
return {
|
|
110
131
|
jeScheduleId,
|
|
111
132
|
jeScheduleType,
|
|
@@ -114,6 +135,8 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
|
|
|
114
135
|
updatedByUser: userDetails,
|
|
115
136
|
updatedAt: updatedAt,
|
|
116
137
|
period,
|
|
138
|
+
lifecycleTotal,
|
|
139
|
+
postedCount,
|
|
117
140
|
balanceAsOfToday: balanceAsOfToday != null
|
|
118
141
|
? (0, amount_1.toAmount)(balanceAsOfToday, currencyCode, currencySymbol)
|
|
119
142
|
: undefined,
|
|
@@ -136,7 +159,9 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
|
|
|
136
159
|
},
|
|
137
160
|
scheduledJournalEntry,
|
|
138
161
|
aiSummaries,
|
|
162
|
+
confidenceScore,
|
|
139
163
|
createdByUser: createdByUserDetails,
|
|
164
|
+
createTime,
|
|
140
165
|
recommendations,
|
|
141
166
|
};
|
|
142
167
|
};
|
|
@@ -2,8 +2,9 @@ import { Amount } from '../../commonStateTypes/amount';
|
|
|
2
2
|
import { ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { ScheduleDaysOfMonth } from '../../commonStateTypes/timePeriod';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
|
+
import { ZeniUrl as Url } from '../../zeniUrl';
|
|
5
6
|
import { TransactionID } from '../transaction/stateTypes/transaction';
|
|
6
|
-
import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
7
|
+
import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualAutomationTierType, OneTimeAccrualOriginType, OneTimeAccrualReversalPolicyType, OneTimeAccrualReversalTriggerType, OneTimeAccrualStatusCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
7
8
|
export interface ScheduleStatus {
|
|
8
9
|
code: ScheduleStatusCodeType;
|
|
9
10
|
label: string;
|
|
@@ -94,7 +95,9 @@ export interface JEScheduledTransactionState {
|
|
|
94
95
|
vendorId: ID;
|
|
95
96
|
aiSummaries?: JEScheduleAISummaries;
|
|
96
97
|
balanceAsOfToday?: number;
|
|
98
|
+
confidenceScore?: number;
|
|
97
99
|
createdByUserID?: ID;
|
|
100
|
+
createTime?: ZeniDate;
|
|
98
101
|
dayOfPostingDate?: ScheduleDaysOfMonth;
|
|
99
102
|
endDate?: ZeniDate;
|
|
100
103
|
jeScheduleId?: ID;
|
|
@@ -112,7 +115,44 @@ export interface JEAccruedScheduledTransactionState extends Omit<JEScheduledTran
|
|
|
112
115
|
memo: string;
|
|
113
116
|
recurringAmount: Amount;
|
|
114
117
|
}
|
|
118
|
+
export interface JEOneTimeAccrualCreator {
|
|
119
|
+
userId: ID;
|
|
120
|
+
email?: string;
|
|
121
|
+
firstName?: string;
|
|
122
|
+
lastName?: string;
|
|
123
|
+
photo?: Url;
|
|
124
|
+
}
|
|
125
|
+
export interface JEOneTimeAccrualState {
|
|
126
|
+
accrualId: ID;
|
|
127
|
+
accrualStatus: OneTimeAccrualStatusCodeType;
|
|
128
|
+
estimatedAmount: Amount;
|
|
129
|
+
memo: string;
|
|
130
|
+
origin: OneTimeAccrualOriginType;
|
|
131
|
+
reversalPolicy: OneTimeAccrualReversalPolicyType;
|
|
132
|
+
serviceMonth: string;
|
|
133
|
+
vendorId: ID;
|
|
134
|
+
vendorName: string;
|
|
135
|
+
actualPostDate?: ZeniDate;
|
|
136
|
+
actualReversalPostDate?: ZeniDate;
|
|
137
|
+
automationTier?: OneTimeAccrualAutomationTierType;
|
|
138
|
+
createdBy?: JEOneTimeAccrualCreator;
|
|
139
|
+
expectedReversalDate?: ZeniDate;
|
|
140
|
+
jeCreditAccountId?: ID;
|
|
141
|
+
jeCreditAccountingClassId?: ID;
|
|
142
|
+
jeCreditAccountingClassName?: string;
|
|
143
|
+
jeCreditAccountName?: string;
|
|
144
|
+
jeDebitAccountId?: ID;
|
|
145
|
+
jeDebitAccountingClassId?: ID;
|
|
146
|
+
jeDebitAccountingClassName?: string;
|
|
147
|
+
jeDebitAccountName?: string;
|
|
148
|
+
postingDate?: ZeniDate;
|
|
149
|
+
reversalTransactionId?: ID;
|
|
150
|
+
reversalTrigger?: OneTimeAccrualReversalTriggerType;
|
|
151
|
+
transactionId?: ID;
|
|
152
|
+
transactionIntegrationId?: ID;
|
|
153
|
+
}
|
|
115
154
|
export interface JESchedulesState {
|
|
155
|
+
oneTimeAccrualsByKey: Record<JEOneTimeAccrualKey, JEOneTimeAccrualState>;
|
|
116
156
|
schedulesByAccruedJEScheduleKey: Record<JEScheduleKey, JEAccruedScheduledTransactionState>;
|
|
117
157
|
schedulesByTransactionKey: Record<JEScheduleTransactionKey, JEScheduledTransactionState>;
|
|
118
158
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TransactionID } from '../transaction/stateTypes/transaction';
|
|
2
|
-
import { generateJEScheduleKey } from './jeScheduleHelper';
|
|
2
|
+
import { generateJEOneTimeAccrualKey, generateJEScheduleKey } from './jeScheduleHelper';
|
|
3
3
|
export interface ScheduleTransactionID extends TransactionID {
|
|
4
4
|
lineId: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const getJEScheduleTransactionKey: (scheduleTransactionId: ScheduleTransactionID) => `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${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}`;
|
|
7
7
|
export type JEScheduleTransactionKey = ReturnType<typeof getJEScheduleTransactionKey>;
|
|
8
8
|
export type JEScheduleKey = ReturnType<typeof generateJEScheduleKey>;
|
|
9
|
+
export type JEOneTimeAccrualKey = ReturnType<typeof generateJEOneTimeAccrualKey>;
|
|
9
10
|
export declare const ALL_SCHEDULES_TYPES: readonly ["prepaid_expenses", "fixed_assets", "accrued_expenses", "deferred_revenue"];
|
|
10
11
|
export declare const toScheduleTypesType: (v: string) => "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
11
12
|
export type ScheduleTypes = ReturnType<typeof toScheduleTypesType>;
|
|
@@ -14,5 +15,15 @@ export declare const toScheduleJournalEntryStatusCodeType: (v: string) => "pendi
|
|
|
14
15
|
export type ScheduleJournalEntryStatusCodeType = ReturnType<typeof toScheduleJournalEntryStatusCodeType>;
|
|
15
16
|
export declare const toScheduleStatusCodeType: (v: string) => "completed" | "draft" | "new" | "ongoing" | "marked_as_completed";
|
|
16
17
|
export type ScheduleStatusCodeType = ReturnType<typeof toScheduleStatusCodeType>;
|
|
18
|
+
export declare const toOneTimeAccrualStatusCodeType: (v: string) => "draft" | "posted" | "posting" | "posting_blocked" | "reversing" | "reversed";
|
|
19
|
+
export type OneTimeAccrualStatusCodeType = ReturnType<typeof toOneTimeAccrualStatusCodeType>;
|
|
20
|
+
export declare const toOneTimeAccrualOriginType: (v: string) => "agent" | "human";
|
|
21
|
+
export type OneTimeAccrualOriginType = ReturnType<typeof toOneTimeAccrualOriginType>;
|
|
22
|
+
export declare const toOneTimeAccrualAutomationTierType: (v: string) => "auto" | "draft" | "manual";
|
|
23
|
+
export type OneTimeAccrualAutomationTierType = ReturnType<typeof toOneTimeAccrualAutomationTierType>;
|
|
24
|
+
export declare const toOneTimeAccrualReversalPolicyType: (v: string) => "on_bill_match" | "scheduled_date";
|
|
25
|
+
export type OneTimeAccrualReversalPolicyType = ReturnType<typeof toOneTimeAccrualReversalPolicyType>;
|
|
26
|
+
export declare const toOneTimeAccrualReversalTriggerType: (v?: string) => "scheduled_date" | "bill_match" | "manual_reverse" | undefined;
|
|
27
|
+
export type OneTimeAccrualReversalTriggerType = ReturnType<typeof toOneTimeAccrualReversalTriggerType>;
|
|
17
28
|
export declare const toJournalEntryErrorCodeType: (v: string) => "vendor_deleted" | "debit_category_deleted" | "credit_category_deleted" | "qbo_error" | "qbo_authorization_error" | "qbo_invalid_company_status_error" | "qbo_book_close_date_error";
|
|
18
29
|
export type JournalEntryErrorCodeType = ReturnType<typeof toJournalEntryErrorCodeType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toJournalEntryErrorCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
|
|
3
|
+
exports.toJournalEntryErrorCodeType = exports.toOneTimeAccrualReversalTriggerType = exports.toOneTimeAccrualReversalPolicyType = exports.toOneTimeAccrualAutomationTierType = exports.toOneTimeAccrualOriginType = exports.toOneTimeAccrualStatusCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
const getJEScheduleTransactionKey = (scheduleTransactionId) => `${scheduleTransactionId.id}_${scheduleTransactionId.type}_${scheduleTransactionId.lineId}`;
|
|
6
6
|
exports.getJEScheduleTransactionKey = getJEScheduleTransactionKey;
|
|
@@ -32,6 +32,45 @@ const SCHEDULE_STATUS_CODE = [
|
|
|
32
32
|
];
|
|
33
33
|
const toScheduleStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, SCHEDULE_STATUS_CODE);
|
|
34
34
|
exports.toScheduleStatusCodeType = toScheduleStatusCodeType;
|
|
35
|
+
// One-time accruals come from agent-je's Mongo `accruals` collection, not the JE schedule
|
|
36
|
+
// datastore, so they carry their own status vocabulary rather than SCHEDULE_STATUS_CODE.
|
|
37
|
+
// `posting` and `reversing` are transient claims held while a JE posts.
|
|
38
|
+
const ONE_TIME_ACCRUAL_STATUS_CODE = [
|
|
39
|
+
'draft',
|
|
40
|
+
'posting',
|
|
41
|
+
'posted',
|
|
42
|
+
'posting_blocked',
|
|
43
|
+
'reversing',
|
|
44
|
+
'reversed',
|
|
45
|
+
];
|
|
46
|
+
const toOneTimeAccrualStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_STATUS_CODE);
|
|
47
|
+
exports.toOneTimeAccrualStatusCodeType = toOneTimeAccrualStatusCodeType;
|
|
48
|
+
// Who created the accrual. This — not the creator's email — is the authoritative
|
|
49
|
+
// AI-vs-manual signal for the Method column.
|
|
50
|
+
const ONE_TIME_ACCRUAL_ORIGIN = ['agent', 'human'];
|
|
51
|
+
const toOneTimeAccrualOriginType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_ORIGIN);
|
|
52
|
+
exports.toOneTimeAccrualOriginType = toOneTimeAccrualOriginType;
|
|
53
|
+
const ONE_TIME_ACCRUAL_AUTOMATION_TIER = ['manual', 'draft', 'auto'];
|
|
54
|
+
const toOneTimeAccrualAutomationTierType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_AUTOMATION_TIER);
|
|
55
|
+
exports.toOneTimeAccrualAutomationTierType = toOneTimeAccrualAutomationTierType;
|
|
56
|
+
// How the accrual is allowed to reverse. The two are exclusive: a scheduled row reverses on
|
|
57
|
+
// expectedReversalDate and bills never drive it; an on_bill_match row reverses only when a bill
|
|
58
|
+
// is matched, which is why its lifecycle reads "Reverses on match" rather than showing a date.
|
|
59
|
+
const ONE_TIME_ACCRUAL_REVERSAL_POLICY = [
|
|
60
|
+
'on_bill_match',
|
|
61
|
+
'scheduled_date',
|
|
62
|
+
];
|
|
63
|
+
const toOneTimeAccrualReversalPolicyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_REVERSAL_POLICY);
|
|
64
|
+
exports.toOneTimeAccrualReversalPolicyType = toOneTimeAccrualReversalPolicyType;
|
|
65
|
+
// What actually caused a reverse. Distinct from a *revert*, which soft-deletes the row and
|
|
66
|
+
// never sets this.
|
|
67
|
+
const ONE_TIME_ACCRUAL_REVERSAL_TRIGGER = [
|
|
68
|
+
'bill_match',
|
|
69
|
+
'scheduled_date',
|
|
70
|
+
'manual_reverse',
|
|
71
|
+
];
|
|
72
|
+
const toOneTimeAccrualReversalTriggerType = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ONE_TIME_ACCRUAL_REVERSAL_TRIGGER);
|
|
73
|
+
exports.toOneTimeAccrualReversalTriggerType = toOneTimeAccrualReversalTriggerType;
|
|
35
74
|
const JOURNAL_ENTRY_ERROR_CODE = [
|
|
36
75
|
'vendor_deleted',
|
|
37
76
|
'debit_category_deleted',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed";
|
|
1
|
+
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
|
|
2
2
|
export type SnackbarMessageSections = ReturnType<typeof toSnackbarMessageSection>;
|
|
3
3
|
export declare const toSnackbarMessageSectionTexts: (v: string) => "notification" | "failed" | "success";
|
|
4
4
|
export type SnackbarMessageSectionTexts = ReturnType<typeof toSnackbarMessageSectionTexts>;
|
|
@@ -230,6 +230,35 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
230
230
|
'qbo_connection_already_linked',
|
|
231
231
|
'qbo_connection_failed',
|
|
232
232
|
'accounting_projects_qbo_reconnect_failed',
|
|
233
|
+
'invoicing_dunning_case_resolved',
|
|
234
|
+
'invoicing_dunning_retry',
|
|
235
|
+
'invoicing_dunning_cancel',
|
|
236
|
+
'invoicing_dunning_settings_save',
|
|
237
|
+
'invoicing_qbo_backfill',
|
|
238
|
+
'invoicing_qbo_sync_health_retry',
|
|
239
|
+
'invoicing_qbo_settings_save',
|
|
240
|
+
'invoicing_branding_save',
|
|
241
|
+
'invoicing_discount_archive',
|
|
242
|
+
'invoicing_discount_unarchive',
|
|
243
|
+
'invoicing_discount_delete',
|
|
244
|
+
'invoicing_invoice_reminder_sent',
|
|
245
|
+
'invoicing_invoice_regenerated',
|
|
246
|
+
'invoicing_invoice_voided',
|
|
247
|
+
'invoicing_catalog_item_saved',
|
|
248
|
+
'invoicing_customer_saved',
|
|
249
|
+
'invoicing_subscription_saved',
|
|
250
|
+
'invoicing_coupon_saved',
|
|
251
|
+
'invoicing_invoice_saved',
|
|
252
|
+
'invoicing_credit_note_saved',
|
|
253
|
+
'invoicing_payment_recorded',
|
|
254
|
+
'invoicing_subscription_activated',
|
|
255
|
+
'invoicing_subscription_cancellation_removed',
|
|
256
|
+
'invoicing_subscription_cancelled',
|
|
257
|
+
'invoicing_subscription_non_renewing',
|
|
258
|
+
'invoicing_subscription_paused',
|
|
259
|
+
'invoicing_subscription_reactivated',
|
|
260
|
+
'invoicing_subscription_resumed',
|
|
261
|
+
'invoicing_subscription_term_end_changed',
|
|
233
262
|
];
|
|
234
263
|
const toSnackbarMessageSection = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_SNACKBAR_MESSAGE_SECTIONS);
|
|
235
264
|
exports.toSnackbarMessageSection = toSnackbarMessageSection;
|