@zeniai/client-epic-state 5.3.25-betaGS1 → 5.3.26
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/jeSchedulesPayload.d.ts +1 -15
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -31
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +0 -16
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +0 -8
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -51
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -15
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +0 -6
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -14
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -5
- package/lib/entity/userRole/userRoleTenantAccess.d.ts +0 -9
- package/lib/entity/userRole/userRoleTenantAccess.js +1 -25
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +2 -9
- package/lib/epic.js +2 -17
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -31
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +0 -16
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +0 -48
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -11
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -5
- package/lib/esm/entity/userRole/userRoleTenantAccess.js +0 -22
- package/lib/esm/epic.js +3 -18
- package/lib/esm/index.js +6 -13
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +10 -62
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -16
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +0 -2
- package/lib/esm/view/settingsView/settingsViewHelpers.js +3 -7
- package/lib/esm/view/transactionDetail/createTransaction/epics/createTransactionCompletedEpic.js +22 -0
- package/lib/esm/view/transactionDetail/createTransaction/epics/createTransactionEpic.js +1 -5
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +3 -3
- package/lib/index.d.ts +7 -16
- package/lib/index.js +48 -97
- package/lib/reducer.d.ts +0 -1
- package/lib/reducer.js +0 -3
- package/lib/rootStateTypes.d.ts +0 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +2 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +9 -62
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +0 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +1 -4
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -18
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +1 -1
- package/lib/view/invoicing/couponView/couponViewState.d.ts +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +0 -2
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.js +2 -6
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionCompletedEpic.d.ts +7 -0
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionCompletedEpic.js +26 -0
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionEpic.js +1 -5
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -2
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -4
- package/package.json +1 -1
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRulePayload.d.ts +0 -105
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRulePayload.js +0 -158
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleState.d.ts +0 -89
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleState.js +0 -2
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleTypes.d.ts +0 -33
- package/lib/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleTypes.js +0 -64
- package/lib/esm/entity/jeScheduleApprovalRule/jeScheduleApprovalRulePayload.js +0 -147
- package/lib/esm/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleState.js +0 -1
- package/lib/esm/entity/jeScheduleApprovalRule/jeScheduleApprovalRuleTypes.js +0 -55
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/deleteJEScheduleApprovalRuleEpic.js +0 -56
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -31
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApproversEpic.js +0 -25
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/jeScheduleApprovalActionEpic.js +0 -66
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/reorderJEScheduleApprovalRulesEpic.js +0 -46
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalDraftEpic.js +0 -50
- package/lib/esm/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRuleEpic.js +0 -62
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewPayload.js +0 -31
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewReducer.js +0 -275
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelector.js +0 -60
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelectorTypes.js +0 -1
- package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewState.js +0 -1
- package/lib/esm/view/transactionDetail/createTransaction/epics/createTransactionAttachmentUploadFailureEpic.js +0 -19
- package/lib/view/settings/jeScheduleApprovalRules/epic/deleteJEScheduleApprovalRuleEpic.d.ts +0 -9
- package/lib/view/settings/jeScheduleApprovalRules/epic/deleteJEScheduleApprovalRuleEpic.js +0 -60
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.d.ts +0 -9
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -35
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApproversEpic.d.ts +0 -9
- package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApproversEpic.js +0 -29
- package/lib/view/settings/jeScheduleApprovalRules/epic/jeScheduleApprovalActionEpic.d.ts +0 -13
- package/lib/view/settings/jeScheduleApprovalRules/epic/jeScheduleApprovalActionEpic.js +0 -70
- package/lib/view/settings/jeScheduleApprovalRules/epic/reorderJEScheduleApprovalRulesEpic.d.ts +0 -13
- package/lib/view/settings/jeScheduleApprovalRules/epic/reorderJEScheduleApprovalRulesEpic.js +0 -50
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalDraftEpic.d.ts +0 -11
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalDraftEpic.js +0 -54
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRuleEpic.d.ts +0 -9
- package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRuleEpic.js +0 -66
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewPayload.d.ts +0 -51
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewPayload.js +0 -37
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewReducer.d.ts +0 -51
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewReducer.js +0 -280
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelector.d.ts +0 -8
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelector.js +0 -64
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelectorTypes.d.ts +0 -23
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewSelectorTypes.js +0 -2
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewState.d.ts +0 -28
- package/lib/view/settings/jeScheduleApprovalRules/jeScheduleSetupApproverViewState.js +0 -2
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionAttachmentUploadFailureEpic.d.ts +0 -10
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionAttachmentUploadFailureEpic.js +0 -23
|
@@ -2,13 +2,12 @@ import { StatusCodeWithLabelPayload } from '../../commonPayloadTypes/statusPaylo
|
|
|
2
2
|
import { ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { AccountPayload } from '../account/accountPayload';
|
|
4
4
|
import { ClassBasePayload } from '../class/classPayload';
|
|
5
|
-
import { JEScheduleApprovalInfoPayload } from '../jeScheduleApprovalRule/jeScheduleApprovalRulePayload';
|
|
6
5
|
import { ScheduleTransactionPayload } from '../transaction/payloadTypes/scheduleTransactionPayload';
|
|
7
6
|
import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDPayload';
|
|
8
7
|
import { TransactionCategory } from '../transaction/stateTypes/transactionType';
|
|
9
8
|
import { UserPayload } from '../user/userPayload';
|
|
10
9
|
import { VendorPayload } from '../vendor/vendorPayload';
|
|
11
|
-
import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState,
|
|
10
|
+
import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
|
|
12
11
|
import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes';
|
|
13
12
|
export interface JEScheduleOtherAttributesPayload {
|
|
14
13
|
asset_id?: string | null;
|
|
@@ -84,9 +83,7 @@ export interface JEScheduledTransactionPayload {
|
|
|
84
83
|
updated_by: UserPayload;
|
|
85
84
|
vendor: VendorPayload;
|
|
86
85
|
ai_summaries?: JEScheduleAISummariesPayload;
|
|
87
|
-
approval_info?: JEScheduleApprovalInfoPayload | null;
|
|
88
86
|
confidence_score?: number | null;
|
|
89
|
-
contributors?: JEScheduleContributorPayload[] | null;
|
|
90
87
|
create_time?: string | null;
|
|
91
88
|
created_by?: UserPayload;
|
|
92
89
|
end_date?: string | null;
|
|
@@ -95,14 +92,6 @@ export interface JEScheduledTransactionPayload {
|
|
|
95
92
|
recurring_amount?: number | null;
|
|
96
93
|
updated_at?: string | null;
|
|
97
94
|
}
|
|
98
|
-
export interface JEScheduleContributorPayload {
|
|
99
|
-
kind: string;
|
|
100
|
-
last_action: string;
|
|
101
|
-
name: string;
|
|
102
|
-
user_id: ID;
|
|
103
|
-
first_action_at?: string | null;
|
|
104
|
-
last_action_at?: string | null;
|
|
105
|
-
}
|
|
106
95
|
export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTransactionPayload, 'base_transaction' | 'je_schedule_id' | 'je_schedule_type'> {
|
|
107
96
|
create_time: string;
|
|
108
97
|
je_schedule_id: ID;
|
|
@@ -177,7 +166,6 @@ export interface JEOneTimeAccrualPayload {
|
|
|
177
166
|
actual_post_date?: string | null;
|
|
178
167
|
actual_reversal_post_date?: string | null;
|
|
179
168
|
ai_suggestion?: JEOneTimeAccrualAiSuggestionPayload | null;
|
|
180
|
-
approval_info?: JEScheduleApprovalInfoPayload | null;
|
|
181
169
|
automation_tier?: string | null;
|
|
182
170
|
cleared?: JEOneTimeAccrualClearedPayload | null;
|
|
183
171
|
created_by_user?: UserPayload | null;
|
|
@@ -233,8 +221,6 @@ export declare function toJEAccruedAccountPayload(payload: JEScheduledTransactio
|
|
|
233
221
|
export declare function toJEClassPayload(payload: JEScheduledTransactionPayload | JEAccruedScheduledTransactionPayload, type: TransactionCategory): ClassBasePayload | undefined;
|
|
234
222
|
export declare function getJEScheduleTransactionDetailKeyPayload(payload: ScheduleTransactionPayload): JEScheduleTransactionKey;
|
|
235
223
|
export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
|
|
236
|
-
/** Drops entries whose kind or action this client does not know, so an unknown actor is never shown as an editor. */
|
|
237
|
-
export declare function toJEScheduleContributors(payload: JEScheduleContributorPayload[] | null | undefined): JEScheduleContributor[];
|
|
238
224
|
export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
|
|
239
225
|
export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
|
|
240
226
|
export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;
|
|
@@ -6,7 +6,6 @@ exports.toJEAccruedAccountPayload = toJEAccruedAccountPayload;
|
|
|
6
6
|
exports.toJEClassPayload = toJEClassPayload;
|
|
7
7
|
exports.getJEScheduleTransactionDetailKeyPayload = getJEScheduleTransactionDetailKeyPayload;
|
|
8
8
|
exports.getJEScheduleKey = getJEScheduleKey;
|
|
9
|
-
exports.toJEScheduleContributors = toJEScheduleContributors;
|
|
10
9
|
exports.toJEScheduledTransaction = toJEScheduledTransaction;
|
|
11
10
|
exports.toJEAccruedScheduledTransaction = toJEAccruedScheduledTransaction;
|
|
12
11
|
exports.toJEOneTimeAccrual = toJEOneTimeAccrual;
|
|
@@ -14,7 +13,6 @@ const amount_1 = require("../../commonStateTypes/amount");
|
|
|
14
13
|
const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
15
14
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
16
15
|
const zeniUrl_1 = require("../../zeniUrl");
|
|
17
|
-
const jeScheduleApprovalRulePayload_1 = require("../jeScheduleApprovalRule/jeScheduleApprovalRulePayload");
|
|
18
16
|
const transactionIDPayload_1 = require("../transaction/payloadTypes/transactionIDPayload");
|
|
19
17
|
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
20
18
|
const jeSchedulesTypes_1 = require("./jeSchedulesTypes");
|
|
@@ -256,30 +254,6 @@ function toJEScheduleAISummaries(payload) {
|
|
|
256
254
|
}
|
|
257
255
|
return Object.keys(result).length > 0 ? result : undefined;
|
|
258
256
|
}
|
|
259
|
-
/** Drops entries whose kind or action this client does not know, so an unknown actor is never shown as an editor. */
|
|
260
|
-
function toJEScheduleContributors(payload) {
|
|
261
|
-
const contributors = [];
|
|
262
|
-
(payload ?? []).forEach((contributor) => {
|
|
263
|
-
const kind = (0, jeSchedulesTypes_1.toJEScheduleContributorKind)(contributor.kind);
|
|
264
|
-
const lastAction = (0, jeSchedulesTypes_1.toJEScheduleContributorAction)(contributor.last_action);
|
|
265
|
-
if (kind == null || lastAction == null) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
contributors.push({
|
|
269
|
-
userId: contributor.user_id,
|
|
270
|
-
kind,
|
|
271
|
-
name: contributor.name,
|
|
272
|
-
lastAction,
|
|
273
|
-
firstActionAt: contributor.first_action_at != null
|
|
274
|
-
? (0, zeniDayJS_1.date)(contributor.first_action_at)
|
|
275
|
-
: undefined,
|
|
276
|
-
lastActionAt: contributor.last_action_at != null
|
|
277
|
-
? (0, zeniDayJS_1.date)(contributor.last_action_at)
|
|
278
|
-
: undefined,
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
return contributors;
|
|
282
|
-
}
|
|
283
257
|
function toJEScheduleRecommendations(payload) {
|
|
284
258
|
if (payload == null) {
|
|
285
259
|
return undefined;
|
|
@@ -360,11 +334,9 @@ function toJEScheduledTransaction(payload) {
|
|
|
360
334
|
: {},
|
|
361
335
|
scheduledJournalEntry: [],
|
|
362
336
|
aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
|
|
363
|
-
approvalInfo: (0, jeScheduleApprovalRulePayload_1.toJEScheduleApprovalInfo)(payload.approval_info),
|
|
364
337
|
confidenceScore: payload.confidence_score ?? undefined,
|
|
365
338
|
createdByUserID: payload.created_by?.user_id ?? undefined,
|
|
366
339
|
recommendations: toJEScheduleRecommendations(payload.recommendations),
|
|
367
|
-
contributors: toJEScheduleContributors(payload.contributors),
|
|
368
340
|
};
|
|
369
341
|
}
|
|
370
342
|
function toJEAccruedScheduledTransaction(payload) {
|
|
@@ -412,7 +384,6 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
412
384
|
},
|
|
413
385
|
currencyCode: payload.currency_code,
|
|
414
386
|
currencySymbol: payload.currency_symbol,
|
|
415
|
-
approvalInfo: (0, jeScheduleApprovalRulePayload_1.toJEScheduleApprovalInfo)(payload.approval_info),
|
|
416
387
|
dayOfPostingDate: payload.posting_date != null &&
|
|
417
388
|
payload.posting_date >= timePeriod_1.MIN_SCHEDULE_DAY_OF_MONTH &&
|
|
418
389
|
payload.posting_date <= timePeriod_1.MAX_SCHEDULE_DAY_OF_MONTH
|
|
@@ -425,7 +396,6 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
425
396
|
scheduledJournalEntry: [],
|
|
426
397
|
createTime: (0, zeniDayJS_1.date)(payload.create_time),
|
|
427
398
|
jeScheduleType: (0, jeSchedulesTypes_1.toScheduleTypesTypeStrict)(payload.je_schedule_type),
|
|
428
|
-
contributors: toJEScheduleContributors(payload.contributors),
|
|
429
399
|
};
|
|
430
400
|
}
|
|
431
401
|
/**
|
|
@@ -544,7 +514,6 @@ function toJEOneTimeAccrual(payload) {
|
|
|
544
514
|
automationTier: payload.automation_tier != null
|
|
545
515
|
? (0, jeSchedulesTypes_1.toOneTimeAccrualAutomationTierType)(payload.automation_tier)
|
|
546
516
|
: undefined,
|
|
547
|
-
approvalInfo: (0, jeScheduleApprovalRulePayload_1.toJEScheduleApprovalInfo)(payload.approval_info),
|
|
548
517
|
estimatedAmount: toOneTimeAccrualAmount(payload.estimated_amount, payload.currency),
|
|
549
518
|
memo: payload.memo ?? '',
|
|
550
519
|
profileSnapshot: toJEOneTimeAccrualProfileSnapshot(payload.profile_snapshot, payload.currency),
|
|
@@ -183,10 +183,6 @@ function doUpdateJEScheduledTransaction(draft, id, payload, updateType) {
|
|
|
183
183
|
const jeTransaction = (0, jeSchedulesPayload_1.toJEScheduledTransaction)(payload);
|
|
184
184
|
const existingTransaction = draft[id];
|
|
185
185
|
if (existingTransaction != null && updateType === 'merge') {
|
|
186
|
-
// A payload without a contributors ledger maps to [], which would otherwise wipe the stored one.
|
|
187
|
-
if (payload.contributors == null) {
|
|
188
|
-
jeTransaction.contributors = existingTransaction.contributors;
|
|
189
|
-
}
|
|
190
186
|
// scheduledJournalEntry is held back from the merge. The list payload never carries journal
|
|
191
187
|
// entries -- toJEScheduledTransaction always sets [] -- and [] is not nullish, so the
|
|
192
188
|
// customizer below would treat it as a value and wipe whatever updateJESchedulesDetails had
|
|
@@ -203,10 +199,6 @@ function doUpdateJEAccruedScheduledTransaction(draft, id, payload, updateType) {
|
|
|
203
199
|
const jeTransaction = (0, jeSchedulesPayload_1.toJEAccruedScheduledTransaction)(payload);
|
|
204
200
|
const existingTransaction = draft[id];
|
|
205
201
|
if (existingTransaction != null && updateType === 'merge') {
|
|
206
|
-
// A payload without a contributors ledger maps to [], which would otherwise wipe the stored one.
|
|
207
|
-
if (payload.contributors == null) {
|
|
208
|
-
jeTransaction.contributors = existingTransaction.contributors;
|
|
209
|
-
}
|
|
210
202
|
(0, assignWith_1.default)(draft[id], jeTransaction, (objValue, srcValue) => srcValue ?? objValue); // IMPORTANT: replace the value only when source has valid value. Otherwise keep the existing value!
|
|
211
203
|
}
|
|
212
204
|
else {
|
|
@@ -252,10 +244,6 @@ function doUpdateAccruedScheduledDetailTransaction(draft, id, jeSchedulePayload,
|
|
|
252
244
|
}
|
|
253
245
|
const existingTransaction = draft[id];
|
|
254
246
|
if (existingTransaction != null && updateType === 'merge') {
|
|
255
|
-
// A payload without a contributors ledger maps to [], which would otherwise wipe the stored one.
|
|
256
|
-
if (jeSchedulePayload.contributors == null) {
|
|
257
|
-
jeTransaction.contributors = existingTransaction.contributors;
|
|
258
|
-
}
|
|
259
247
|
// An empty array here means "this payload carried no entries for this schedule", not "this
|
|
260
248
|
// schedule has none" -- and [] is not nullish, so the customizer below would treat it as a
|
|
261
249
|
// value and clear entries another call already wrote. Only overwrite when there is something
|
|
@@ -286,10 +274,6 @@ function doUpdateScheduledDetailTransaction(draft, id, jeSchedulePayload, schedu
|
|
|
286
274
|
}
|
|
287
275
|
const existingTransaction = draft[id];
|
|
288
276
|
if (existingTransaction != null && updateType === 'merge') {
|
|
289
|
-
// A payload without a contributors ledger maps to [], which would otherwise wipe the stored one.
|
|
290
|
-
if (jeSchedulePayload.contributors == null) {
|
|
291
|
-
jeTransaction.contributors = existingTransaction.contributors;
|
|
292
|
-
}
|
|
293
277
|
// An empty array here means "this payload carried no entries for this schedule", not "this
|
|
294
278
|
// schedule has none" -- and [] is not nullish, so the customizer below would treat it as a
|
|
295
279
|
// value and clear entries another call already wrote. Only overwrite when there is something
|
|
@@ -5,7 +5,6 @@ import { RootState } from '../../rootStateTypes';
|
|
|
5
5
|
import { ZeniDate } from '../../zeniDayJS';
|
|
6
6
|
import { AccountBase } from '../account/accountState';
|
|
7
7
|
import { Class } from '../class/classState';
|
|
8
|
-
import { JEScheduleApprovalInfo } from '../jeScheduleApprovalRule/jeScheduleApprovalRuleState';
|
|
9
8
|
import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransaction';
|
|
10
9
|
import { TransactionID } from '../transaction/stateTypes/transactionID';
|
|
11
10
|
import { User } from '../user/userState';
|
|
@@ -85,10 +84,3 @@ export interface JEOneTimeAccrual extends JEOneTimeAccrualState {
|
|
|
85
84
|
export declare const getJEOneTimeAccrualByKey: (jeOneTimeAccrualKey: JEOneTimeAccrualKey, jeSchedulesState: JESchedulesState) => JEOneTimeAccrual | undefined;
|
|
86
85
|
export declare const getJEAccruedScheduleByJEScheduleKey: (JEScheduleKey: JEScheduleKey, state: RootState) => JEAccruedSchedule | undefined;
|
|
87
86
|
export declare const getJEScheduledTransactionByJEScheduleTransactionKey: (jeScheduleTransactionKey: JEScheduleTransactionKey, state: RootState) => JEScheduledTransaction;
|
|
88
|
-
/** Schedules are keyed by transaction / accrued key, not schedule id, so this re-indexes both maps by schedule id. */
|
|
89
|
-
export declare const getApprovalInfoByScheduleId: (jeSchedulesState: JESchedulesState) => Record<ID, JEScheduleApprovalInfo>;
|
|
90
|
-
export declare const getScheduleApprovalInfo: (jeSchedulesState: JESchedulesState, jeScheduleId: ID) => JEScheduleApprovalInfo | undefined;
|
|
91
|
-
/** One-time accruals are keyed by accrual id, so this is a direct lookup, unlike the schedule scan. */
|
|
92
|
-
export declare const getOneTimeAccrualApprovalInfo: (jeSchedulesState: JESchedulesState, accrualId: ID) => JEScheduleApprovalInfo | undefined;
|
|
93
|
-
/** Human contributors other than the creator, earliest first; schedules nobody else touched are omitted. */
|
|
94
|
-
export declare const getEditedByNamesByScheduleId: (jeSchedulesState: JESchedulesState) => Record<ID, string[]>;
|
|
@@ -3,8 +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.
|
|
7
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.getJEScheduledTransactionByJEScheduleTransactionKey = exports.getJEAccruedScheduleByJEScheduleKey = exports.getJEOneTimeAccrualByKey = void 0;
|
|
8
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
8
|
const amount_1 = require("../../commonStateTypes/amount");
|
|
10
9
|
const accountSelector_1 = require("../account/accountSelector");
|
|
@@ -12,7 +11,6 @@ const classSelector_1 = require("../class/classSelector");
|
|
|
12
11
|
const transactionSelector_1 = require("../transaction/transactionSelector");
|
|
13
12
|
const userSelector_1 = require("../user/userSelector");
|
|
14
13
|
const vendorSelector_1 = require("../vendor/vendorSelector");
|
|
15
|
-
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
16
14
|
// Takes the slice, not RootState: an accrual denormalizes its vendor, account and class names, so
|
|
17
15
|
// unlike getJEAccruedScheduleByJEScheduleKey this joins nothing.
|
|
18
16
|
//
|
|
@@ -178,51 +176,3 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
|
|
|
178
176
|
};
|
|
179
177
|
};
|
|
180
178
|
exports.getJEScheduledTransactionByJEScheduleTransactionKey = getJEScheduledTransactionByJEScheduleTransactionKey;
|
|
181
|
-
/** Schedules are keyed by transaction / accrued key, not schedule id, so this re-indexes both maps by schedule id. */
|
|
182
|
-
exports.getApprovalInfoByScheduleId = (0, toolkit_1.createSelector)((jeSchedulesState) => jeSchedulesState.schedulesByTransactionKey, (jeSchedulesState) => jeSchedulesState.schedulesByAccruedJEScheduleKey, (schedulesByTransactionKey, schedulesByAccruedJEScheduleKey) => {
|
|
183
|
-
const byScheduleId = {};
|
|
184
|
-
[
|
|
185
|
-
...Object.values(schedulesByTransactionKey),
|
|
186
|
-
...Object.values(schedulesByAccruedJEScheduleKey),
|
|
187
|
-
].forEach((schedule) => {
|
|
188
|
-
if (schedule.jeScheduleId != null && schedule.approvalInfo != null) {
|
|
189
|
-
byScheduleId[schedule.jeScheduleId] = schedule.approvalInfo;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
return byScheduleId;
|
|
193
|
-
});
|
|
194
|
-
const getScheduleApprovalInfo = (jeSchedulesState, jeScheduleId) => (0, get_1.default)((0, exports.getApprovalInfoByScheduleId)(jeSchedulesState), jeScheduleId, undefined);
|
|
195
|
-
exports.getScheduleApprovalInfo = getScheduleApprovalInfo;
|
|
196
|
-
/** One-time accruals are keyed by accrual id, so this is a direct lookup, unlike the schedule scan. */
|
|
197
|
-
const getOneTimeAccrualApprovalInfo = (jeSchedulesState, accrualId) => (0, get_1.default)(jeSchedulesState.oneTimeAccrualsByKey, (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrualId), undefined)?.approvalInfo;
|
|
198
|
-
exports.getOneTimeAccrualApprovalInfo = getOneTimeAccrualApprovalInfo;
|
|
199
|
-
const compareByFirstActionAt = (left, right) => {
|
|
200
|
-
// Undated contributors sort last, keeping their ledger order.
|
|
201
|
-
const leftTime = left.firstActionAt?.valueOf() ?? Number.POSITIVE_INFINITY;
|
|
202
|
-
const rightTime = right.firstActionAt?.valueOf() ?? Number.POSITIVE_INFINITY;
|
|
203
|
-
if (leftTime === rightTime) {
|
|
204
|
-
return 0;
|
|
205
|
-
}
|
|
206
|
-
return leftTime < rightTime ? -1 : 1;
|
|
207
|
-
};
|
|
208
|
-
/** Human contributors other than the creator, earliest first; schedules nobody else touched are omitted. */
|
|
209
|
-
exports.getEditedByNamesByScheduleId = (0, toolkit_1.createSelector)((jeSchedulesState) => jeSchedulesState.schedulesByTransactionKey, (jeSchedulesState) => jeSchedulesState.schedulesByAccruedJEScheduleKey, (schedulesByTransactionKey, schedulesByAccruedJEScheduleKey) => {
|
|
210
|
-
const byScheduleId = {};
|
|
211
|
-
[
|
|
212
|
-
...Object.values(schedulesByTransactionKey),
|
|
213
|
-
...Object.values(schedulesByAccruedJEScheduleKey),
|
|
214
|
-
].forEach((schedule) => {
|
|
215
|
-
if (schedule.jeScheduleId == null) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const names = schedule.contributors
|
|
219
|
-
.filter((contributor) => contributor.kind === 'user' &&
|
|
220
|
-
contributor.userId !== schedule.createdByUserID)
|
|
221
|
-
.sort(compareByFirstActionAt)
|
|
222
|
-
.map((contributor) => contributor.name);
|
|
223
|
-
if (names.length > 0) {
|
|
224
|
-
byScheduleId[schedule.jeScheduleId] = names;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
return byScheduleId;
|
|
228
|
-
});
|
|
@@ -3,9 +3,8 @@ import { ID } from '../../commonStateTypes/common';
|
|
|
3
3
|
import { ScheduleDaysOfMonth } from '../../commonStateTypes/timePeriod';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { ZeniUrl as Url } from '../../zeniUrl';
|
|
6
|
-
import { JEScheduleApprovalInfo } from '../jeScheduleApprovalRule/jeScheduleApprovalRuleState';
|
|
7
6
|
import { TransactionID } from '../transaction/stateTypes/transactionID';
|
|
8
|
-
import { JEOneTimeAccrualKey,
|
|
7
|
+
import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualAutomationTierType, OneTimeAccrualOriginType, OneTimeAccrualReversalPolicyType, OneTimeAccrualReversalTriggerType, OneTimeAccrualStatusCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
9
8
|
export interface ScheduleStatus {
|
|
10
9
|
code: ScheduleStatusCodeType;
|
|
11
10
|
label: string;
|
|
@@ -96,18 +95,8 @@ export interface ScheduledJournalEntryState {
|
|
|
96
95
|
transactionID?: ID;
|
|
97
96
|
updateTime?: ZeniDate;
|
|
98
97
|
}
|
|
99
|
-
/** Everyone who acted on a schedule, as the backend's contributors ledger reports them. */
|
|
100
|
-
export interface JEScheduleContributor {
|
|
101
|
-
kind: JEScheduleContributorKind;
|
|
102
|
-
lastAction: JEScheduleContributorAction;
|
|
103
|
-
name: string;
|
|
104
|
-
userId: ID;
|
|
105
|
-
firstActionAt?: ZeniDate;
|
|
106
|
-
lastActionAt?: ZeniDate;
|
|
107
|
-
}
|
|
108
98
|
export interface JEScheduledTransactionState {
|
|
109
99
|
baseTransaction: JEScheduleTransactionKey;
|
|
110
|
-
contributors: JEScheduleContributor[];
|
|
111
100
|
currencyCode: string;
|
|
112
101
|
currencySymbol: string;
|
|
113
102
|
jeCredit: {
|
|
@@ -123,7 +112,6 @@ export interface JEScheduledTransactionState {
|
|
|
123
112
|
status: ScheduleStatus;
|
|
124
113
|
vendorId: ID;
|
|
125
114
|
aiSummaries?: JEScheduleAISummaries;
|
|
126
|
-
approvalInfo?: JEScheduleApprovalInfo;
|
|
127
115
|
balanceAsOfToday?: number;
|
|
128
116
|
confidenceScore?: number;
|
|
129
117
|
createdByUserID?: ID;
|
|
@@ -264,8 +252,6 @@ export interface JEOneTimeAccrualState {
|
|
|
264
252
|
actualPostDate?: ZeniDate;
|
|
265
253
|
actualReversalPostDate?: ZeniDate;
|
|
266
254
|
aiSuggestion?: JEOneTimeAccrualAiSuggestion;
|
|
267
|
-
/** Set only on a draft an approval rule holds; see JEScheduledTransactionState.approvalInfo. */
|
|
268
|
-
approvalInfo?: JEScheduleApprovalInfo;
|
|
269
255
|
automationTier?: OneTimeAccrualAutomationTierType;
|
|
270
256
|
cleared?: JEOneTimeAccrualCleared;
|
|
271
257
|
createdBy?: JEOneTimeAccrualCreator;
|
|
@@ -39,9 +39,3 @@ export type OneTimeAccrualRevertReasonType = ReturnType<typeof toOneTimeAccrualR
|
|
|
39
39
|
export declare const ALL_ONE_TIME_ACCRUAL_REVERT_REASONS: readonly OneTimeAccrualRevertReasonType[];
|
|
40
40
|
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";
|
|
41
41
|
export type JournalEntryErrorCodeType = ReturnType<typeof toJournalEntryErrorCodeType>;
|
|
42
|
-
export declare const JE_SCHEDULE_CONTRIBUTOR_KINDS: readonly ["user", "agent"];
|
|
43
|
-
export type JEScheduleContributorKind = (typeof JE_SCHEDULE_CONTRIBUTOR_KINDS)[number];
|
|
44
|
-
export declare const toJEScheduleContributorKind: (v: string) => JEScheduleContributorKind | undefined;
|
|
45
|
-
export declare const JE_SCHEDULE_CONTRIBUTOR_ACTIONS: readonly ["created", "edited", "saved_draft", "approved", "rejected", "reverted"];
|
|
46
|
-
export type JEScheduleContributorAction = (typeof JE_SCHEDULE_CONTRIBUTOR_ACTIONS)[number];
|
|
47
|
-
export declare const toJEScheduleContributorAction: (v: string) => JEScheduleContributorAction | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toJournalEntryErrorCodeType = exports.ALL_ONE_TIME_ACCRUAL_REVERT_REASONS = exports.toOneTimeAccrualRevertReasonType = exports.ALL_JE_SCHEDULE_REVERT_REASONS = exports.toJEScheduleRevertReasonType = exports.ALL_JE_SCHEDULE_IGNORE_REASONS = exports.toJEScheduleIgnoreReasonType = exports.ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS = exports.toOneTimeAccrualIgnoreReasonType = 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;
|
|
@@ -138,16 +138,3 @@ const JOURNAL_ENTRY_ERROR_CODE = [
|
|
|
138
138
|
];
|
|
139
139
|
const toJournalEntryErrorCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, JOURNAL_ENTRY_ERROR_CODE);
|
|
140
140
|
exports.toJournalEntryErrorCodeType = toJournalEntryErrorCodeType;
|
|
141
|
-
exports.JE_SCHEDULE_CONTRIBUTOR_KINDS = ['user', 'agent'];
|
|
142
|
-
const toJEScheduleContributorKind = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.JE_SCHEDULE_CONTRIBUTOR_KINDS);
|
|
143
|
-
exports.toJEScheduleContributorKind = toJEScheduleContributorKind;
|
|
144
|
-
exports.JE_SCHEDULE_CONTRIBUTOR_ACTIONS = [
|
|
145
|
-
'created',
|
|
146
|
-
'edited',
|
|
147
|
-
'saved_draft',
|
|
148
|
-
'approved',
|
|
149
|
-
'rejected',
|
|
150
|
-
'reverted',
|
|
151
|
-
];
|
|
152
|
-
const toJEScheduleContributorAction = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.JE_SCHEDULE_CONTRIBUTOR_ACTIONS);
|
|
153
|
-
exports.toJEScheduleContributorAction = toJEScheduleContributorAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toSnackbarMessageSection: (v: string) => "common" | "recommendation_feedback" | "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" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "actual_matching_ignore_suggestion" | "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" | "
|
|
1
|
+
export declare const toSnackbarMessageSection: (v: string) => "common" | "recommendation_feedback" | "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" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "actual_matching_ignore_suggestion" | "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" | "update_customer" | "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" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "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" | "create_transaction" | "create_transaction_attachment_failed" | "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" | "auto_review_income_without_customer_update" | "customers_tab_settings_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "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" | "product_services_update" | "qbo_realm_id_update" | "kyc_kyb_reset" | "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" | "invoicing_data_import_download";
|
|
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>;
|
|
@@ -54,11 +54,6 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
54
54
|
'bill_pay_duplicate_approval_update',
|
|
55
55
|
'bill_pay_approval_delete',
|
|
56
56
|
'bill_pay_approval_reorder',
|
|
57
|
-
'je_schedule_approval_create',
|
|
58
|
-
'je_schedule_approval_update',
|
|
59
|
-
'je_schedule_approval_delete',
|
|
60
|
-
'je_schedule_approval_reorder',
|
|
61
|
-
'je_schedule_approval_action',
|
|
62
57
|
'bill_pay_updated',
|
|
63
58
|
'bill_pay_deleted',
|
|
64
59
|
'bill_pay_cancelled_deleted',
|
|
@@ -202,6 +197,7 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
|
|
|
202
197
|
'complete_profile_done',
|
|
203
198
|
'create_transfer_entry',
|
|
204
199
|
'create_transaction',
|
|
200
|
+
'create_transaction_attachment_failed',
|
|
205
201
|
'reports_resync',
|
|
206
202
|
'invalid_phone_number',
|
|
207
203
|
'transactions_categorized_updated_failed',
|
|
@@ -10,12 +10,3 @@ export declare const hasReimbursementAccessible: (currentTenant: CurrentTenant |
|
|
|
10
10
|
export declare const hasChargeCardAccessible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
11
11
|
export declare const hasZeniAccountsAccessible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
12
12
|
export declare const hasTreasuryAccessible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* JE schedule screens are gated by the Statsig expense-automation gate in the
|
|
15
|
-
* app, which CES cannot read; the CES-level signal is "this tenant buys
|
|
16
|
-
* accounting services" (bookkeeping / CFO / tax / payroll). Screens AND the
|
|
17
|
-
* Statsig gate on top of this.
|
|
18
|
-
*/
|
|
19
|
-
export declare const hasJEScheduleApprovalAccessible: (currentTenant: CurrentTenant | undefined) => boolean;
|
|
20
|
-
/** Zeni: reviewer or controller. Customer: admin or bookkeeping_admin. */
|
|
21
|
-
export declare const canEditJEScheduleApprovalRules: (userRoleMap: RoleMap | undefined, isZeni: boolean) => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const tenantSelector_1 = require("../tenant/tenantSelector");
|
|
3
|
+
exports.hasTreasuryAccessible = exports.hasZeniAccountsAccessible = exports.hasChargeCardAccessible = exports.hasReimbursementAccessible = exports.hasBillPayAccessible = exports.hasReimbursementUserAccess = exports.hasRemiFallbackAdminLevelAccess = exports.hasBillPayFallbackAdminLevelAccess = exports.isZeniSignedInUser = void 0;
|
|
5
4
|
const userRoleType_1 = require("./userRoleType");
|
|
6
5
|
const isZeniSignedInUser = (signedInUser) => {
|
|
7
6
|
if (signedInUser == null) {
|
|
@@ -101,26 +100,3 @@ const hasTreasuryAccessible = (currentTenant, userRoleMap) => {
|
|
|
101
100
|
return isTreasuryTOSAccepted && (0, userRoleType_1.hasTreasuryAdminLevelAccess)(userRoleMap);
|
|
102
101
|
};
|
|
103
102
|
exports.hasTreasuryAccessible = hasTreasuryAccessible;
|
|
104
|
-
/**
|
|
105
|
-
* JE schedule screens are gated by the Statsig expense-automation gate in the
|
|
106
|
-
* app, which CES cannot read; the CES-level signal is "this tenant buys
|
|
107
|
-
* accounting services" (bookkeeping / CFO / tax / payroll). Screens AND the
|
|
108
|
-
* Statsig gate on top of this.
|
|
109
|
-
*/
|
|
110
|
-
const hasJEScheduleApprovalAccessible = (currentTenant) => {
|
|
111
|
-
if (currentTenant == null) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
return (0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant);
|
|
115
|
-
};
|
|
116
|
-
exports.hasJEScheduleApprovalAccessible = hasJEScheduleApprovalAccessible;
|
|
117
|
-
/** Zeni: reviewer or controller. Customer: admin or bookkeeping_admin. */
|
|
118
|
-
const canEditJEScheduleApprovalRules = (userRoleMap, isZeni) => {
|
|
119
|
-
if (userRoleMap == null) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
return isZeni
|
|
123
|
-
? Boolean(userRoleMap.reviewer) || Boolean(userRoleMap.controller)
|
|
124
|
-
: Boolean(userRoleMap.admin) || Boolean(userRoleMap.bookkeeping_admin);
|
|
125
|
-
};
|
|
126
|
-
exports.canEditJEScheduleApprovalRules = canEditJEScheduleApprovalRules;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const toUserRoleTypeStrict: (v?: string) => "
|
|
2
|
-
export declare const toUserRoleType: (v: string) => "
|
|
1
|
+
export declare const toUserRoleTypeStrict: (v?: string) => "admin" | "controller" | "tax_lead" | "ap_analyst" | "preparer" | "reviewer" | "customer_success_manager" | "zeni_support_user" | "bookkeeping_admin" | "bookkeeping_user" | "investor_or_banker" | "company_officer" | "reimbursements_user" | "bill_pay_admin" | "bill_pay_user" | "reimbursements_admin" | "deposit_accounts_admin" | "deposit_accounts_user" | "charge_card_admin" | "charge_card_user" | "treasury_admin" | "treasury_user" | undefined;
|
|
2
|
+
export declare const toUserRoleType: (v: string) => "admin" | "controller" | "tax_lead" | "ap_analyst" | "preparer" | "reviewer" | "customer_success_manager" | "zeni_support_user" | "bookkeeping_admin" | "bookkeeping_user" | "investor_or_banker" | "company_officer" | "reimbursements_user" | "bill_pay_admin" | "bill_pay_user" | "reimbursements_admin" | "deposit_accounts_admin" | "deposit_accounts_user" | "charge_card_admin" | "charge_card_user" | "treasury_admin" | "treasury_user";
|
|
3
3
|
export type UserRoleType = ReturnType<typeof toUserRoleType>;
|
|
4
4
|
export type RoleMap = Record<string, boolean>;
|
|
5
5
|
export declare const isFinOpsUserRoleType: (userRole: UserRoleType) => boolean;
|