@zeniai/client-epic-state 5.3.12 → 5.3.14-beta0MM
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -2
- package/lib/entity/actualMatching/actualMatchingPayload.d.ts +1 -0
- package/lib/entity/actualMatching/actualMatchingPayload.js +3 -0
- package/lib/entity/actualMatching/actualMatchingReducer.js +2 -1
- package/lib/entity/actualMatching/actualMatchingState.d.ts +1 -0
- package/lib/entity/actualMatching/actualMatchingTypes.d.ts +2 -0
- package/lib/entity/actualMatching/actualMatchingTypes.js +9 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/commonStateTypes/animations.js +1 -2
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +3 -0
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +2 -1
- package/lib/esm/entity/actualMatching/actualMatchingTypes.js +8 -1
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +5 -4
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +65 -3
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +25 -0
- package/lib/esm/view/aiCfoView/epics/transcribeAudioEpic.js +60 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +2 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +8 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +7 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +12 -7
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +30 -23
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/types/transactionGroup.js +10 -5
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionPayload.js +19 -3
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionState.js +2 -0
- package/lib/index.d.ts +6 -5
- package/lib/index.js +30 -22
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +20 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +2 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +66 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +8 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +27 -0
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +9 -0
- package/lib/view/aiCfoView/epics/transcribeAudioEpic.d.ts +19 -0
- package/lib/view/aiCfoView/epics/transcribeAudioEpic.js +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +8 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +7 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +12 -7
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +9 -3
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +30 -23
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/types/transactionGroup.d.ts +6 -6
- package/lib/view/expenseAutomationView/types/transactionGroup.js +10 -5
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -2
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.d.ts +6 -3
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.js +19 -3
- package/lib/view/transactionDetail/createTransaction/createTransactionState.d.ts +7 -2
- package/lib/view/transactionDetail/createTransaction/createTransactionState.js +2 -0
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +20 -20
- package/package.json +1 -1
|
@@ -6,15 +6,19 @@ import { clearAll } from '../../../../../rootActions';
|
|
|
6
6
|
import { fetchActualMatchingMatch, fetchActualMatchingMatchFailure, fetchActualMatchingMatchSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
7
7
|
import { getTenantDisplayCurrency } from '../../../selectors/actualMatchingViewSelector';
|
|
8
8
|
export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchActualMatchingMatch.match), mergeMap((action) => {
|
|
9
|
-
const { matchId, refreshViewInBackground } = action.payload;
|
|
9
|
+
const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
|
|
10
|
+
const batchQuery = matchBatchId != null && matchBatchId !== ''
|
|
11
|
+
? `?batch_id=${encodeURIComponent(matchBatchId)}`
|
|
12
|
+
: '';
|
|
10
13
|
return zeniAPI
|
|
11
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}`)
|
|
14
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}${batchQuery}`)
|
|
12
15
|
.pipe(mergeMap((response) => {
|
|
13
16
|
if (isSuccessResponse(response) && response.data != null) {
|
|
14
17
|
return from([
|
|
15
18
|
updateActualMatchingMatches([response.data], getTenantDisplayCurrency(state$.value)),
|
|
16
19
|
fetchActualMatchingMatchSuccess({
|
|
17
20
|
matchId,
|
|
21
|
+
matchBatchId,
|
|
18
22
|
refreshViewInBackground,
|
|
19
23
|
}),
|
|
20
24
|
]);
|
|
@@ -22,6 +26,7 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
|
|
|
22
26
|
return from([
|
|
23
27
|
fetchActualMatchingMatchFailure({
|
|
24
28
|
matchId,
|
|
29
|
+
matchBatchId,
|
|
25
30
|
refreshViewInBackground,
|
|
26
31
|
status: response.status,
|
|
27
32
|
}),
|
|
@@ -29,6 +34,7 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
|
|
|
29
34
|
}), catchError((error) => from([
|
|
30
35
|
fetchActualMatchingMatchFailure({
|
|
31
36
|
matchId,
|
|
37
|
+
matchBatchId,
|
|
32
38
|
refreshViewInBackground,
|
|
33
39
|
status: createZeniAPIStatus('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
|
|
34
40
|
}),
|
|
@@ -56,8 +56,12 @@ function matchAndReverseHttpFailSnackbar(vendorName) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function matchVendorName(state, matchId) {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const stored = getActualMatchingMatchById(state.actualMatchingState, matchId);
|
|
60
|
+
if (stored?.vendorName != null && stored.vendorName !== '') {
|
|
61
|
+
return stored.vendorName;
|
|
62
|
+
}
|
|
63
|
+
const sameBill = Object.values(state.actualMatchingState.byMatchId).find((match) => match.matchId === matchId);
|
|
64
|
+
return sameBill?.vendorName ?? '';
|
|
61
65
|
}
|
|
62
66
|
export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match),
|
|
63
67
|
// Per-match exhaust: a second click on the same match drops while HTTP is in
|
|
@@ -96,7 +100,7 @@ groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.pa
|
|
|
96
100
|
// List + detail: list can omit leftovers; detail GET always
|
|
97
101
|
// writes intended occupancy so leftover retry can join C
|
|
98
102
|
// onto the occupied bill instead of a stale cached row.
|
|
99
|
-
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
|
|
103
|
+
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true, response.data.match_batch_id));
|
|
100
104
|
}
|
|
101
105
|
const snackbar = matchAndReverseSnackbar(results, vendorName);
|
|
102
106
|
if (snackbar != null) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
2
|
import { catchError, exhaustMap, filter, groupBy, mergeMap, takeUntil, } from 'rxjs/operators';
|
|
3
3
|
import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
|
|
4
|
+
import { actualMatchingRowKey } from '../../../../../entity/actualMatching/actualMatchingTypes';
|
|
4
5
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
6
7
|
import { clearAll } from '../../../../../rootActions';
|
|
@@ -37,41 +38,45 @@ function undoReversalSnackbar(results, vendorName) {
|
|
|
37
38
|
variables,
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
function matchVendorName(state, matchId) {
|
|
41
|
-
|
|
41
|
+
function matchVendorName(state, matchId, matchBatchId) {
|
|
42
|
+
const rowKey = actualMatchingRowKey(matchId, matchBatchId);
|
|
43
|
+
return (getActualMatchingMatchById(state.actualMatchingState, rowKey)?.vendorName ??
|
|
44
|
+
getActualMatchingMatchById(state.actualMatchingState, matchId)?.vendorName ??
|
|
42
45
|
'');
|
|
43
46
|
}
|
|
44
47
|
export const undoReversalAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(undoReversalAccruals.match),
|
|
45
48
|
// Per-match exhaust: a second click on the same match drops while HTTP is in
|
|
46
49
|
// flight. A different match must still run — a global exhaustMap left the
|
|
47
50
|
// other match's reducer In-Progress with no request.
|
|
48
|
-
groupBy((action) => action.payload.matchId), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
|
|
49
|
-
const { accrualIds, matchId } = action.payload;
|
|
51
|
+
groupBy((action) => actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId)), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
|
|
52
|
+
const { accrualIds, matchId, matchBatchId } = action.payload;
|
|
50
53
|
const body = {
|
|
51
54
|
accrual_ids: accrualIds,
|
|
52
55
|
};
|
|
53
|
-
const vendorName = matchVendorName(state$.value, matchId);
|
|
56
|
+
const vendorName = matchVendorName(state$.value, matchId, matchBatchId);
|
|
54
57
|
return zeniAPI
|
|
55
58
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/undo-reversal`, body)
|
|
56
59
|
.pipe(mergeMap((response) => {
|
|
57
60
|
if (isSuccessResponse(response) && response.data != null) {
|
|
58
61
|
const results = response.data.results.map(toUndoReversalResult);
|
|
59
62
|
const successActions = [
|
|
60
|
-
undoReversalAccrualsSuccess(matchId, results),
|
|
63
|
+
undoReversalAccrualsSuccess(matchId, results, matchBatchId),
|
|
61
64
|
];
|
|
62
65
|
const anyUndone = results.some((result) => result.status === 'undone');
|
|
63
66
|
if (anyUndone) {
|
|
64
|
-
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
|
|
67
|
+
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true, matchBatchId));
|
|
65
68
|
}
|
|
66
69
|
successActions.push(undoReversalSnackbar(results, vendorName));
|
|
67
70
|
return from(successActions);
|
|
68
71
|
}
|
|
69
72
|
return of(undoReversalAccrualsFailure({
|
|
70
73
|
matchId,
|
|
74
|
+
matchBatchId,
|
|
71
75
|
status: response.status,
|
|
72
76
|
}), undoReversalSnackbar([], vendorName));
|
|
73
77
|
}), catchError((error) => of(undoReversalAccrualsFailure({
|
|
74
78
|
matchId,
|
|
79
|
+
matchBatchId,
|
|
75
80
|
status: createZeniAPIStatus('Unexpected Error', 'Undo reversal accruals REST API call errored out' +
|
|
76
81
|
JSON.stringify(error)),
|
|
77
82
|
}), undoReversalSnackbar([], vendorName))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
|
+
import { actualMatchingRowKey } from '../../../entity/actualMatching/actualMatchingTypes';
|
|
3
4
|
import { generateJEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeScheduleHelper';
|
|
4
5
|
import { createZeniAPIStatus } from '../../../responsePayload';
|
|
5
6
|
import { clearAll } from '../../../rootActions';
|
|
@@ -183,19 +184,20 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
183
184
|
}
|
|
184
185
|
},
|
|
185
186
|
fetchActualMatchingMatch: {
|
|
186
|
-
prepare(matchId, refreshViewInBackground = false) {
|
|
187
|
-
return { payload: { matchId, refreshViewInBackground } };
|
|
187
|
+
prepare(matchId, refreshViewInBackground = false, matchBatchId) {
|
|
188
|
+
return { payload: { matchId, matchBatchId, refreshViewInBackground } };
|
|
188
189
|
},
|
|
189
190
|
reducer(draft, action) {
|
|
190
|
-
const { matchId, refreshViewInBackground } = action.payload;
|
|
191
|
+
const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
|
|
192
|
+
const rowKey = actualMatchingRowKey(matchId, matchBatchId);
|
|
191
193
|
if (refreshViewInBackground) {
|
|
192
|
-
draft.detailRefreshStatusByMatchId[
|
|
194
|
+
draft.detailRefreshStatusByMatchId[rowKey] = {
|
|
193
195
|
fetchState: 'In-Progress',
|
|
194
196
|
error: undefined,
|
|
195
197
|
};
|
|
196
198
|
}
|
|
197
199
|
else {
|
|
198
|
-
draft.detailFetchStateByMatchId[
|
|
200
|
+
draft.detailFetchStateByMatchId[rowKey] = {
|
|
199
201
|
fetchState: 'In-Progress',
|
|
200
202
|
error: undefined,
|
|
201
203
|
};
|
|
@@ -203,30 +205,32 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
203
205
|
},
|
|
204
206
|
},
|
|
205
207
|
fetchActualMatchingMatchSuccess(draft, action) {
|
|
206
|
-
const { matchId, refreshViewInBackground } = action.payload;
|
|
208
|
+
const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
|
|
209
|
+
const rowKey = actualMatchingRowKey(matchId, matchBatchId);
|
|
207
210
|
if (refreshViewInBackground) {
|
|
208
|
-
draft.detailRefreshStatusByMatchId[
|
|
211
|
+
draft.detailRefreshStatusByMatchId[rowKey] = {
|
|
209
212
|
fetchState: 'Completed',
|
|
210
213
|
error: undefined,
|
|
211
214
|
};
|
|
212
215
|
}
|
|
213
216
|
else {
|
|
214
|
-
draft.detailFetchStateByMatchId[
|
|
217
|
+
draft.detailFetchStateByMatchId[rowKey] = {
|
|
215
218
|
fetchState: 'Completed',
|
|
216
219
|
error: undefined,
|
|
217
220
|
};
|
|
218
221
|
}
|
|
219
222
|
},
|
|
220
223
|
fetchActualMatchingMatchFailure(draft, action) {
|
|
221
|
-
const { matchId, refreshViewInBackground, status } = action.payload;
|
|
224
|
+
const { matchId, matchBatchId, refreshViewInBackground, status } = action.payload;
|
|
225
|
+
const rowKey = actualMatchingRowKey(matchId, matchBatchId);
|
|
222
226
|
if (refreshViewInBackground) {
|
|
223
|
-
draft.detailRefreshStatusByMatchId[
|
|
227
|
+
draft.detailRefreshStatusByMatchId[rowKey] = {
|
|
224
228
|
fetchState: 'Error',
|
|
225
229
|
error: status,
|
|
226
230
|
};
|
|
227
231
|
}
|
|
228
232
|
else {
|
|
229
|
-
draft.detailFetchStateByMatchId[
|
|
233
|
+
draft.detailFetchStateByMatchId[rowKey] = {
|
|
230
234
|
fetchState: 'Error',
|
|
231
235
|
error: status,
|
|
232
236
|
};
|
|
@@ -417,40 +421,42 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
417
421
|
},
|
|
418
422
|
undoReversalAccruals: {
|
|
419
423
|
reducer(draft, action) {
|
|
420
|
-
|
|
424
|
+
const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
|
|
425
|
+
draft.undoReversalStatusByMatchId[rowKey] = {
|
|
421
426
|
fetchState: 'In-Progress',
|
|
422
427
|
error: undefined,
|
|
423
428
|
};
|
|
424
429
|
},
|
|
425
|
-
prepare(matchId, accrualIds) {
|
|
426
|
-
return { payload: { matchId, accrualIds } };
|
|
430
|
+
prepare(matchId, accrualIds, matchBatchId) {
|
|
431
|
+
return { payload: { matchId, accrualIds, matchBatchId } };
|
|
427
432
|
},
|
|
428
433
|
},
|
|
429
434
|
undoReversalAccrualsSuccess: {
|
|
430
435
|
reducer(draft, action) {
|
|
431
|
-
const { matchId, results } = action.payload;
|
|
432
|
-
|
|
436
|
+
const { matchId, matchBatchId, results } = action.payload;
|
|
437
|
+
const rowKey = actualMatchingRowKey(matchId, matchBatchId);
|
|
438
|
+
draft.undoReversalStatusByMatchId[rowKey] = {
|
|
433
439
|
fetchState: 'Completed',
|
|
434
440
|
error: undefined,
|
|
435
441
|
};
|
|
436
442
|
const allUndone = results.length > 0 &&
|
|
437
443
|
results.every((result) => result.status === 'undone');
|
|
438
444
|
if (allUndone) {
|
|
439
|
-
enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds,
|
|
445
|
+
enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
|
|
440
446
|
}
|
|
441
447
|
else {
|
|
442
|
-
draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds,
|
|
448
|
+
draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
|
|
443
449
|
}
|
|
444
450
|
pruneLastMatchResultsForUndone(draft, matchId, results);
|
|
445
451
|
if (allUndone) {
|
|
446
|
-
delete draft.lastUndoResultsByMatchId[
|
|
452
|
+
delete draft.lastUndoResultsByMatchId[rowKey];
|
|
447
453
|
}
|
|
448
454
|
else {
|
|
449
|
-
draft.lastUndoResultsByMatchId[
|
|
455
|
+
draft.lastUndoResultsByMatchId[rowKey] = results;
|
|
450
456
|
}
|
|
451
457
|
},
|
|
452
|
-
prepare(matchId, results) {
|
|
453
|
-
return { payload: { matchId, results } };
|
|
458
|
+
prepare(matchId, results, matchBatchId) {
|
|
459
|
+
return { payload: { matchId, results, matchBatchId } };
|
|
454
460
|
},
|
|
455
461
|
},
|
|
456
462
|
ackCloseMatchAfterUndo(draft) {
|
|
@@ -494,7 +500,8 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
494
500
|
draft.closeMatchAfterIgnoreMatchIds.shift();
|
|
495
501
|
},
|
|
496
502
|
undoReversalAccrualsFailure(draft, action) {
|
|
497
|
-
|
|
503
|
+
const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
|
|
504
|
+
draft.undoReversalStatusByMatchId[rowKey] = {
|
|
498
505
|
fetchState: 'Error',
|
|
499
506
|
error: action.payload.status,
|
|
500
507
|
};
|
|
@@ -4,15 +4,20 @@ import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
|
4
4
|
* verbatim to the listing API as `transaction_group`. When revenue automation is
|
|
5
5
|
* enabled for the tenant the backend scopes the whole view by the line
|
|
6
6
|
* account_type: `'expense'` -> expense accounts, `'income'` -> income accounts,
|
|
7
|
-
* `'
|
|
8
|
-
*
|
|
7
|
+
* `'other'` -> balance-sheet accounts other than bank/credit card (plus lines
|
|
8
|
+
* with no account type), `'all'` -> all three. The list epics always send it;
|
|
9
|
+
* when the gate is off the backend ignores it and returns the legacy expense
|
|
10
|
+
* scope.
|
|
9
11
|
*
|
|
10
12
|
* The wire value for expenses is the singular `'expense'` (matches the backend
|
|
11
13
|
* `TransactionGroup` enum) even though the picker labels it "Expenses".
|
|
12
|
-
* Balance-sheet groups (assets, liability) are reserved for later and are not
|
|
13
|
-
* part of this union yet.
|
|
14
14
|
*/
|
|
15
|
-
export const TRANSACTION_GROUPS = [
|
|
15
|
+
export const TRANSACTION_GROUPS = [
|
|
16
|
+
'all',
|
|
17
|
+
'income',
|
|
18
|
+
'expense',
|
|
19
|
+
'other',
|
|
20
|
+
];
|
|
16
21
|
export const toTransactionGroup = (v) => stringToUnion(v != null ? v.trim().toLowerCase() : '', TRANSACTION_GROUPS);
|
|
17
22
|
/**
|
|
18
23
|
* Default group for the listing — matches the picker's default selection ("All").
|
|
@@ -131,13 +131,29 @@ export const prepareCreateTransactionPayload = (state, localData) => {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
const lines = localData.lines.map((line) => toLinePayload(state, line, transactionType));
|
|
134
|
+
const documentIdField = localData.documentNumber != null && localData.documentNumber !== ''
|
|
135
|
+
? { document_id: localData.documentNumber }
|
|
136
|
+
: {};
|
|
134
137
|
if (transactionType === 'journal_entry') {
|
|
138
|
+
return { ...base, ...documentIdField, lines };
|
|
139
|
+
}
|
|
140
|
+
// Both post to accounts payable, so they carry no header account or payment type.
|
|
141
|
+
if (transactionType === 'vendor_credit') {
|
|
142
|
+
return {
|
|
143
|
+
...base,
|
|
144
|
+
vendor_id: toQboVendorId(state, localData.vendorId),
|
|
145
|
+
...documentIdField,
|
|
146
|
+
lines,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (transactionType === 'bill') {
|
|
135
150
|
return {
|
|
136
151
|
...base,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
vendor_id: toQboVendorId(state, localData.vendorId),
|
|
153
|
+
...(localData.dueDate != null && {
|
|
154
|
+
due_date: localData.dueDate.format(DEFAULT_DATE_FORMAT),
|
|
140
155
|
}),
|
|
156
|
+
...documentIdField,
|
|
141
157
|
lines,
|
|
142
158
|
};
|
|
143
159
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -512,7 +512,7 @@ import { InternationalWireSelectorView, getInternationalWireView } from './view/
|
|
|
512
512
|
import { fetchInternationalVerificationForm, submitInternationalVerificationForm, updateVerificationFormLocalData } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer';
|
|
513
513
|
import { InternationalWireVerificationView, getIntlWireVerificationView } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector';
|
|
514
514
|
import { FieldValueType, InternationalWireVerificationState, VerificationFormField, VerificationFormLocalData } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState';
|
|
515
|
-
import { fetchBillAttachment, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, fetchMagicLinkTenant, saveBankAccount, saveMagicLinkAddressInLocalStore, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData } from './view/spendManagement/billPay/magicLinkView/magicLinkViewReducer';
|
|
515
|
+
import { fetchBillAttachment, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, fetchMagicLinkTenant, saveBankAccount, saveMagicLinkAddressInLocalStore, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData, updateMagicLinkTenantFailure, updateMagicLinkTenantSuccess } from './view/spendManagement/billPay/magicLinkView/magicLinkViewReducer';
|
|
516
516
|
import { MagicLinkView, getMagicLinkBankAccountView, getMagicLinkCurrentAddressState, getMagicLinkView } from './view/spendManagement/billPay/magicLinkView/magicLinkViewSelector';
|
|
517
517
|
import { PreviousBillsSelectorView } from './view/spendManagement/billPay/previousBills/previousBillsSelector';
|
|
518
518
|
import { fetchWiseRedirectStatus } from './view/spendManagement/billPay/wiseRedirectView/wiseRedirectReducer';
|
|
@@ -952,7 +952,7 @@ export { isZeniClearingAccountReport, ZENI_CLEARING_ACCOUNT, isZeniClearingAccou
|
|
|
952
952
|
export { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, getOnboardingPlaidLinkToken, establishOnboardingPlaidConnection, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus, updateOnboardingCustomerView, updateOnboardingCustomerViewLocalStoreData, updateCurrentStep, updateCurrentSubStep, updateOnboardingCustomerViewUIState, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerViewDataInLocalStore, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, fetchAiAgentsActivationStatus, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, getAiAgentsActivationCounts, getAiAgentsActivationPhases, getAiAgentsActivationSubview, getOnboardingCustomerView, getProductSettingsString, OnboardingCustomerView, OnboardingStep, OnboardingSubStep, ALL_ONBOARDING_STEPS, ALL_ONBOARDING_SUB_STEPS, toOnboardingStepType, toOnboardingSubStepType, OnboardingCustomerViewUIState, OnboardingCustomerViewLocalData, OnboardingBusinessProfileUpdate, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, };
|
|
953
953
|
export { saveAccountMapping, saveAccountMappingLocalData, clearAccountMappingLocalData, AccountMappingLocalData, AccountMappingView, VendorAccountMappingView, getAccountMappingView, initializeAccountMappingView, ExpenseCategory1099Filing, };
|
|
954
954
|
export { MagicLinkView, getMagicLinkView, getMagicLinkBankAccountView, getMagicLinkCurrentAddressState, };
|
|
955
|
-
export { fetchMagicLinkTenant, fetchBillAttachment, saveBankAccount, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, saveMagicLinkAddressInLocalStore, };
|
|
955
|
+
export { fetchMagicLinkTenant, updateMagicLinkTenantSuccess, updateMagicLinkTenantFailure, fetchBillAttachment, saveBankAccount, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, saveMagicLinkAddressInLocalStore, };
|
|
956
956
|
export { getWiseRedirect, fetchWiseRedirectStatus };
|
|
957
957
|
export { getInternationalWireView, InternationalWireSelectorView, DynamicFormField, CreateInternationalWireDetailsLocalData, SupportedAccountType, VendorCurrency, initializeInternationalWireLocalData, updateInternationalWireLocalStoreData, initializeDynamicForm, fetchInternationalWireDynamicForm, createPaymentInstrument, createPaymentInstrumentUpdateStatus, deletePaymentInstrument, clearInternationalWire, };
|
|
958
958
|
export { fetchUserRoleConfig, getUserRoleConfig };
|
|
@@ -1002,12 +1002,12 @@ export { AiAccountantCustomerViewState, AiAccountantSortKey, AiAccountantUIState
|
|
|
1002
1002
|
export { AiAccountantFilterCategoryField } from './view/companyView/types/cockpitTypes';
|
|
1003
1003
|
export { cancelAiAccountantOnboarding, fetchAiAccountantCustomers, fetchAiAccountantJobs, setSelectedTenantIdsForJobTrigger, triggerAiAccountantJob, updateAiAccountantUIState, } from './view/aiAccountantView/aiAccountantViewReducer';
|
|
1004
1004
|
export { AiAccountantCockpitView, getAiAccountantCockpitView, } from './view/aiAccountantView/aiAccountantViewSelector';
|
|
1005
|
-
export { acceptMasterTOS, applyAiCfoSidePanelHostPageTransition, clearAiCfoSidePanelHostPageContext, clearCurrentSessionId, clearDeleteChatSessionStatus, clearLastContextMessage, clearSkillDetail, clearSkillMutation, closeRoutineRuns, closeRoutinesBrowser, closeSkillsBrowser, createSession, createSessionAndSubmit, deleteChatSession, deleteRoutine, deleteSkill, fetchChatHistory, fetchChatSessionsForUser, fetchRoutineRuns, fetchRoutines, fetchSkillDetail, fetchSkills, fetchSkillsFailure, fetchSkillsSuccess, fetchSkillVersionBody, fetchSkillVersions, fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, openRoutinesBrowser, openSkillsBrowser, runRoutine, saveRoutine, saveSkill, setRoutineEnabled, setSession, setSkillVisibility, stopSubmit, stopSubmitQuestion, submitFeedback, submitQuestion, updateAiCfoViewScrollPosition, updateCotCollapsedState, updateCurrentInput, updateResponseState, } from './view/aiCfoView/aiCfoViewReducer';
|
|
1005
|
+
export { acceptMasterTOS, applyAiCfoSidePanelHostPageTransition, clearAiCfoSidePanelHostPageContext, clearCurrentSessionId, clearDeleteChatSessionStatus, clearLastContextMessage, clearSkillDetail, clearSkillMutation, closeRoutineRuns, closeRoutinesBrowser, closeSkillsBrowser, createSession, createSessionAndSubmit, deleteChatSession, deleteRoutine, deleteSkill, fetchChatHistory, fetchChatSessionsForUser, fetchRoutineRuns, fetchRoutines, fetchSkillDetail, fetchSkills, fetchSkillsFailure, fetchSkillsSuccess, fetchSkillVersionBody, fetchSkillVersions, fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, openRoutinesBrowser, openSkillsBrowser, runRoutine, saveRoutine, saveSkill, setRoutineEnabled, setSession, setSkillVisibility, stopSubmit, stopSubmitQuestion, submitFeedback, submitQuestion, transcribeAudio, updateAiCfoViewScrollPosition, updateCotCollapsedState, updateCurrentInput, updateResponseState, } from './view/aiCfoView/aiCfoViewReducer';
|
|
1006
1006
|
export { AiCfoViewState, AiCfoViewUIState, Routine, RoutineDraft, RoutineMutationState, RoutineRecurrence, RoutineRun, RoutineRunsState, RoutineRunStatus, RoutinesState, RoutineStatus, Skill, SkillDetail, SkillDetailState, SkillDraft, SkillMutationState, SkillsState, SkillVersion, SkillVersionBodyState, SkillVersionsState, SkillVisibility, SuggestedQuestionsForPageContext, } from './view/aiCfoView/aiCfoViewState';
|
|
1007
1007
|
export { FetchSuggestedQuestionsResponse, SuggestedQuestionsDataPayload, FetchSkillsResponse, SkillSummaryPayload, SkillListDataPayload, } from './view/aiCfoView/aiCfoViewPayload';
|
|
1008
|
-
export type { FeedbackType, SubmitFeedbackPayload, } from './view/aiCfoView/aiCfoViewPayload';
|
|
1008
|
+
export type { FeedbackType, SubmitFeedbackPayload, TranscribeAudioPayload, TranscriptionResponseData, } from './view/aiCfoView/aiCfoViewPayload';
|
|
1009
1009
|
export type { AiCfoSuggestedQuestionsPageContext } from './common/aiCfo/aiCfoSuggestedQuestionsPageContext';
|
|
1010
|
-
export { AiCfoViewSelector, canCreateRoutine, getAiCfoView, getRoutineMutation, getRoutineRuns, getRoutines, getRoutinesEnabled, getSkillDetail, getSkillMutation, getSkills, getSkillsEnabled, getSkillVersionBody, getSkillVersions, getSuggestedQuestionsForPageContext, } from './view/aiCfoView/aiCfoViewSelector';
|
|
1010
|
+
export { AiCfoViewSelector, canCreateRoutine, getAiCfoView, getIsTranscribing, getRoutineMutation, getRoutineRuns, getRoutines, getRoutinesEnabled, getSkillDetail, getSkillMutation, getSkills, getSkillsEnabled, getSkillVersionBody, getSkillVersions, getSuggestedQuestionsForPageContext, getTranscriptionFailed, } from './view/aiCfoView/aiCfoViewSelector';
|
|
1011
1011
|
export { MessagePayload, ChatSessionPayload, AiCfoAnswerPayload, } from './entity/aiCfo/aiCfoPayload';
|
|
1012
1012
|
export { setNewSession, setSessions, updateAiCfoAnswerCardPolicyWizardPlan, upsertAnswerPayload, upsertOrAddQuestionAnswerPayload, addQuestionPayload, clearSession, toAiCfoExports, toAiCfoVisualization, appendSyntheticAiCfoAnswer, updateSyntheticAiCfoAnswer, removeSyntheticAiCfoAnswer, } from './entity/aiCfo/aiCfoReducer';
|
|
1013
1013
|
export { AiCfoSelectorView, getAllQuestionAnswersForChatSession, getQuestionAnswerByIdForChatSession, getAllQuestionsForChatSession, getAiCfoSelectorView, getSyntheticAiCfoAnswersForChatSession, getSyntheticAiCfoAnswerByQuestionAnswerId, ChatSessionWithOrderedQuestionAnswers, } from './entity/aiCfo/aiCfoSelector';
|
|
@@ -1274,6 +1274,7 @@ export type { ExpenseAutomationActualMatchingMatchView } from './view/expenseAut
|
|
|
1274
1274
|
export type { ActualMatchingMatch, ActualMatchingMatchKind, } from './entity/actualMatching/actualMatchingState';
|
|
1275
1275
|
export type { ActualMatchingMatchId } from './entity/actualMatching/actualMatchingTypes';
|
|
1276
1276
|
export type { SessionEndpointsLoader } from './sessionEndpointsLoader';
|
|
1277
|
+
export { actualMatchingRowKey } from './entity/actualMatching/actualMatchingTypes';
|
|
1277
1278
|
export type { DisplayCurrencyFallback } from './entity/actualMatching/actualMatchingPayload';
|
|
1278
1279
|
export { fetchCustomerSummaryDetail, fetchCustomerSummaryList, resetCustomerSummaryDetailUiState, saveCustomerSummaryDetail, updateCustomerAllTransactionsTabData, updateCustomerDetailSelectedTab, updateCustomerSummaryRevenueSelection, updateCustomerSummaryScrollYOffset, updateCustomerSummarySortUiState, updateCustomerTrendFilter, } from './view/customerSummaryView/customerSummaryViewReducer';
|
|
1279
1280
|
export { getCustomerSummaryAllTransactionsTabData, getCustomerSummaryDetail, getCustomerSummaryList, getCustomerSummarySelectedTabType, getCustomerSummaryTrendFilter, isCustomersTabVisible, } from './view/customerSummaryView/customerSummaryViewSelector';
|