@zeniai/client-epic-state 4.12.37 → 4.12.39
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/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +12 -1
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +23 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +12 -0
- package/lib/entity/billPay/billTransaction/billTransactionState.js +8 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +2 -2
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +14 -12
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/scheduleView/scheduleAccruedDetailView/epics/fetchRecommendedTransactionRowIndexEpic.js +2 -2
- package/lib/view/scheduleView/scheduleAccruedDetailView/scheduleAccruedDetailLocalDataHelper.js +3 -4
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +4 -4
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +5 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.d.ts +22 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewReducer.js +133 -2
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +2 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.d.ts +9 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewState.js +14 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +10 -1
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchEligibleActionsForBillEpic.d.ts +7 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchEligibleActionsForBillEpic.js +42 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/retryOrRefundBillEpic.d.ts +9 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/retryOrRefundBillEpic.js +76 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +3 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +6 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +68 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +2 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
|
-
import { BillDetailViewState, BillApprovalType } from './billDetailViewState';
|
|
2
|
+
import { BillDetailViewState, BillApprovalType, BillAssistActionType } from './billDetailViewState';
|
|
3
3
|
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
4
4
|
import { BillDetailViewPayload } from './billDetailViewPayload';
|
|
5
5
|
export declare const initialState: BillDetailViewState;
|
|
@@ -45,6 +45,27 @@ export declare const fetchBillDetail: import("@reduxjs/toolkit").ActionCreatorWi
|
|
|
45
45
|
billId: string;
|
|
46
46
|
billDetail: BillDetailViewPayload;
|
|
47
47
|
vendorId: string | undefined;
|
|
48
|
+
}, string, never, never>, fetchEligibleActionsForBill: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride?: any], {
|
|
49
|
+
billId: string;
|
|
50
|
+
cacheOverride: any;
|
|
51
|
+
}, string, never, never>, updateEligibleActionsForBill: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, isEligibleForRefund?: boolean | undefined, isEligibleForRetry?: boolean | undefined], {
|
|
52
|
+
billId: string;
|
|
53
|
+
isEligibleForRefund: boolean | undefined;
|
|
54
|
+
isEligibleForRetry: boolean | undefined;
|
|
55
|
+
}, string, never, never>, updateFetchEligibleActionsFailureState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, error: ZeniAPIStatus<Record<string, unknown>>, vendorId?: string | undefined], {
|
|
56
|
+
billId: string;
|
|
57
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
58
|
+
vendorId: string | undefined;
|
|
59
|
+
}, string, never, never>, retryOrRefundBill: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, actionType: BillAssistActionType], {
|
|
60
|
+
billId: string;
|
|
61
|
+
actionType: BillAssistActionType;
|
|
62
|
+
}, string, never, never>, retryOrRefundBillSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, actionType: BillAssistActionType], {
|
|
63
|
+
billId: string;
|
|
64
|
+
actionType: BillAssistActionType;
|
|
65
|
+
}, string, never, never>, retryOrRefundBillFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, actionType: BillAssistActionType, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
66
|
+
billId: string;
|
|
67
|
+
actionType: BillAssistActionType;
|
|
68
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
48
69
|
}, string, never, never>;
|
|
49
70
|
declare const _default: import("@reduxjs/toolkit").Reducer<BillDetailViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
50
71
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.waitForVendorByNameThenUpdateBillDetail = exports.cancelAndDeleteBillSuccessOrFailure = exports.cancelAndDeleteBill = exports.clearBillDetailView = exports.updateApprovalStatusOnSuccess = exports.approveOrRejectBillFailure = exports.approveOrRejectBillSuccess = exports.approveOrRejectBill = exports.deleteBillSuccessOrFailure = exports.deleteBill = exports.removeBillDetail = exports.updateBillDetailFetchState = exports.updateBillDetail = exports.fetchBillDetail = exports.initialState = void 0;
|
|
7
|
+
exports.retryOrRefundBillFailure = exports.retryOrRefundBillSuccess = exports.retryOrRefundBill = exports.updateFetchEligibleActionsFailureState = exports.updateEligibleActionsForBill = exports.fetchEligibleActionsForBill = exports.waitForVendorByNameThenUpdateBillDetail = exports.cancelAndDeleteBillSuccessOrFailure = exports.cancelAndDeleteBill = exports.clearBillDetailView = exports.updateApprovalStatusOnSuccess = exports.approveOrRejectBillFailure = exports.approveOrRejectBillSuccess = exports.approveOrRejectBill = exports.deleteBillSuccessOrFailure = exports.deleteBill = exports.removeBillDetail = exports.updateBillDetailFetchState = exports.updateBillDetail = exports.fetchBillDetail = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const billDetailViewState_1 = require("./billDetailViewState");
|
|
@@ -243,10 +243,141 @@ const billDetailView = (0, toolkit_1.createSlice)({
|
|
|
243
243
|
return { payload: { billId, billDetail, vendorId } };
|
|
244
244
|
},
|
|
245
245
|
},
|
|
246
|
+
fetchEligibleActionsForBill: {
|
|
247
|
+
reducer(draft, action) {
|
|
248
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
249
|
+
draft.billDetailById[key] = Object.assign(Object.assign({}, draft.billDetailById[key]), { zeniAssist: Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { eligibleActionsFetchStatus: {
|
|
250
|
+
fetchState: 'In-Progress',
|
|
251
|
+
error: undefined,
|
|
252
|
+
} }) });
|
|
253
|
+
},
|
|
254
|
+
prepare(billId, cacheOverride = false) {
|
|
255
|
+
return {
|
|
256
|
+
payload: {
|
|
257
|
+
billId,
|
|
258
|
+
cacheOverride,
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
updateEligibleActionsForBill: {
|
|
264
|
+
reducer(draft, action) {
|
|
265
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
266
|
+
const detail = (0, get_1.default)(draft.billDetailById, key, undefined);
|
|
267
|
+
if (detail != null) {
|
|
268
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { isEligibleForRefund: action.payload.isEligibleForRefund, isEligibleForRetry: action.payload.isEligibleForRetry, eligibleActionsFetchStatus: {
|
|
269
|
+
fetchState: 'Completed',
|
|
270
|
+
error: undefined,
|
|
271
|
+
} });
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
prepare(billId, isEligibleForRefund, isEligibleForRetry) {
|
|
275
|
+
return {
|
|
276
|
+
payload: { billId, isEligibleForRefund, isEligibleForRetry },
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
updateFetchEligibleActionsFailureState: {
|
|
281
|
+
reducer: (draft, action) => {
|
|
282
|
+
const billId = action.payload.billId;
|
|
283
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
284
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { eligibleActionsFetchStatus: {
|
|
285
|
+
fetchState: 'Error',
|
|
286
|
+
error: action.payload.error,
|
|
287
|
+
} });
|
|
288
|
+
},
|
|
289
|
+
prepare(billId, error, vendorId) {
|
|
290
|
+
return {
|
|
291
|
+
payload: {
|
|
292
|
+
billId,
|
|
293
|
+
error,
|
|
294
|
+
vendorId,
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
retryOrRefundBill: {
|
|
300
|
+
reducer(draft, action) {
|
|
301
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
302
|
+
const detail = (0, get_1.default)(draft.billDetailById, key, undefined);
|
|
303
|
+
if (detail != null) {
|
|
304
|
+
if (action.payload.actionType === 'refund') {
|
|
305
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { refundStatus: {
|
|
306
|
+
fetchState: 'In-Progress',
|
|
307
|
+
error: undefined,
|
|
308
|
+
} });
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { retryStatus: {
|
|
312
|
+
fetchState: 'In-Progress',
|
|
313
|
+
error: undefined,
|
|
314
|
+
} });
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
prepare(billId, actionType) {
|
|
319
|
+
return {
|
|
320
|
+
payload: { billId, actionType },
|
|
321
|
+
};
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
retryOrRefundBillSuccess: {
|
|
325
|
+
reducer(draft, action) {
|
|
326
|
+
const { billId } = action.payload;
|
|
327
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
328
|
+
if (action.payload.actionType === 'refund') {
|
|
329
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { refundStatus: {
|
|
330
|
+
fetchState: 'Completed',
|
|
331
|
+
error: undefined,
|
|
332
|
+
} });
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { retryStatus: {
|
|
336
|
+
fetchState: 'Completed',
|
|
337
|
+
error: undefined,
|
|
338
|
+
} });
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
prepare(billId, actionType) {
|
|
342
|
+
return {
|
|
343
|
+
payload: {
|
|
344
|
+
billId,
|
|
345
|
+
actionType,
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
retryOrRefundBillFailure: {
|
|
351
|
+
reducer(draft, action) {
|
|
352
|
+
const { billId, status } = action.payload;
|
|
353
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
354
|
+
if (action.payload.actionType === 'refund') {
|
|
355
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { refundStatus: {
|
|
356
|
+
fetchState: 'Error',
|
|
357
|
+
error: status,
|
|
358
|
+
} });
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
draft.billDetailById[key].zeniAssist = Object.assign(Object.assign({}, draft.billDetailById[key].zeniAssist), { retryStatus: {
|
|
362
|
+
fetchState: 'Error',
|
|
363
|
+
error: status,
|
|
364
|
+
} });
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
prepare(billId, actionType, status) {
|
|
368
|
+
return {
|
|
369
|
+
payload: {
|
|
370
|
+
billId,
|
|
371
|
+
actionType,
|
|
372
|
+
status,
|
|
373
|
+
},
|
|
374
|
+
};
|
|
375
|
+
},
|
|
376
|
+
},
|
|
246
377
|
clearBillDetailView(draft) {
|
|
247
378
|
Object.assign(draft, exports.initialState);
|
|
248
379
|
},
|
|
249
380
|
},
|
|
250
381
|
});
|
|
251
|
-
_a = billDetailView.actions, exports.fetchBillDetail = _a.fetchBillDetail, exports.updateBillDetail = _a.updateBillDetail, exports.updateBillDetailFetchState = _a.updateBillDetailFetchState, exports.removeBillDetail = _a.removeBillDetail, exports.deleteBill = _a.deleteBill, exports.deleteBillSuccessOrFailure = _a.deleteBillSuccessOrFailure, exports.approveOrRejectBill = _a.approveOrRejectBill, exports.approveOrRejectBillSuccess = _a.approveOrRejectBillSuccess, exports.approveOrRejectBillFailure = _a.approveOrRejectBillFailure, exports.updateApprovalStatusOnSuccess = _a.updateApprovalStatusOnSuccess, exports.clearBillDetailView = _a.clearBillDetailView, exports.cancelAndDeleteBill = _a.cancelAndDeleteBill, exports.cancelAndDeleteBillSuccessOrFailure = _a.cancelAndDeleteBillSuccessOrFailure, exports.waitForVendorByNameThenUpdateBillDetail = _a.waitForVendorByNameThenUpdateBillDetail;
|
|
382
|
+
_a = billDetailView.actions, exports.fetchBillDetail = _a.fetchBillDetail, exports.updateBillDetail = _a.updateBillDetail, exports.updateBillDetailFetchState = _a.updateBillDetailFetchState, exports.removeBillDetail = _a.removeBillDetail, exports.deleteBill = _a.deleteBill, exports.deleteBillSuccessOrFailure = _a.deleteBillSuccessOrFailure, exports.approveOrRejectBill = _a.approveOrRejectBill, exports.approveOrRejectBillSuccess = _a.approveOrRejectBillSuccess, exports.approveOrRejectBillFailure = _a.approveOrRejectBillFailure, exports.updateApprovalStatusOnSuccess = _a.updateApprovalStatusOnSuccess, exports.clearBillDetailView = _a.clearBillDetailView, exports.cancelAndDeleteBill = _a.cancelAndDeleteBill, exports.cancelAndDeleteBillSuccessOrFailure = _a.cancelAndDeleteBillSuccessOrFailure, exports.waitForVendorByNameThenUpdateBillDetail = _a.waitForVendorByNameThenUpdateBillDetail, exports.fetchEligibleActionsForBill = _a.fetchEligibleActionsForBill, exports.updateEligibleActionsForBill = _a.updateEligibleActionsForBill, exports.updateFetchEligibleActionsFailureState = _a.updateFetchEligibleActionsFailureState, exports.retryOrRefundBill = _a.retryOrRefundBill, exports.retryOrRefundBillSuccess = _a.retryOrRefundBillSuccess, exports.retryOrRefundBillFailure = _a.retryOrRefundBillFailure;
|
|
252
383
|
exports.default = billDetailView.reducer;
|
|
@@ -11,7 +11,7 @@ import { ZeniDate } from '../../../../zeniDayJS';
|
|
|
11
11
|
import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
|
|
12
12
|
import { StepWithUser } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
|
|
13
13
|
import { PreviousBillsSelectorView } from '../previousBills/previousBillsSelector';
|
|
14
|
-
import { BillApprovalType } from './billDetailViewState';
|
|
14
|
+
import { BillApprovalType, ZeniAssistForBills } from './billDetailViewState';
|
|
15
15
|
import { LoggedInUser } from '../../../../entity/tenant/tenantState';
|
|
16
16
|
import { ActivityRealTimeApprovalSelectorView } from '../../realTimeApprovalView/realTimeApprovalSelector';
|
|
17
17
|
import { UserAndRole } from '../../../companyView/types/userAndRole';
|
|
@@ -46,6 +46,7 @@ export interface BillDetailViewSelector extends SelectorView {
|
|
|
46
46
|
isRecurring: boolean;
|
|
47
47
|
recurringBillInstances?: RecurringBillData[];
|
|
48
48
|
recurringBillConfigDetail?: RecurringBillConfig;
|
|
49
|
+
zeniAssist?: ZeniAssistForBills;
|
|
49
50
|
}
|
|
50
51
|
export interface StepWithStatus extends StepWithUser {
|
|
51
52
|
actorsActivity: ActorActivityWithUser[];
|
|
@@ -188,6 +188,7 @@ const getBillDetailView = (state, billId) => {
|
|
|
188
188
|
recurringBillConfigDetail = recurringBillDetail === null || recurringBillDetail === void 0 ? void 0 : recurringBillDetail.recurringBillConfig;
|
|
189
189
|
recurringBillInstances = recurringBillDetail === null || recurringBillDetail === void 0 ? void 0 : recurringBillDetail.recurringBillInstances;
|
|
190
190
|
}
|
|
191
|
+
const zeniAssist = billTransactionDetails === null || billTransactionDetails === void 0 ? void 0 : billTransactionDetails.zeniAssist;
|
|
191
192
|
return {
|
|
192
193
|
fetchState: fetchState.fetchState,
|
|
193
194
|
error: fetchState.error,
|
|
@@ -218,6 +219,7 @@ const getBillDetailView = (state, billId) => {
|
|
|
218
219
|
isRecurring,
|
|
219
220
|
recurringBillInstances,
|
|
220
221
|
recurringBillConfigDetail,
|
|
222
|
+
zeniAssist,
|
|
221
223
|
};
|
|
222
224
|
};
|
|
223
225
|
exports.getBillDetailView = getBillDetailView;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FetchedState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
export declare type BillApprovalType = 'approved' | 'rejected';
|
|
3
|
+
export declare type BillAssistActionType = 'retry' | 'refund';
|
|
3
4
|
export declare const getBillTransactionDetailKey: (billId: ID) => string;
|
|
4
5
|
export declare type BillTransactionDetailKey = ReturnType<typeof getBillTransactionDetailKey>;
|
|
5
6
|
export interface BillDetailView extends FetchedState {
|
|
@@ -12,6 +13,14 @@ export interface BillDetailView extends FetchedState {
|
|
|
12
13
|
approvalRuleIds: ID[];
|
|
13
14
|
eventIds: ID[];
|
|
14
15
|
vendorId?: ID;
|
|
16
|
+
zeniAssist: ZeniAssistForBills;
|
|
17
|
+
}
|
|
18
|
+
export interface ZeniAssistForBills {
|
|
19
|
+
eligibleActionsFetchStatus: FetchStateAndError;
|
|
20
|
+
retryStatus: FetchStateAndError;
|
|
21
|
+
refundStatus: FetchStateAndError;
|
|
22
|
+
isEligibleForRetry?: boolean;
|
|
23
|
+
isEligibleForRefund?: boolean;
|
|
15
24
|
}
|
|
16
25
|
export interface BillDetailViewState {
|
|
17
26
|
billDetailById: Record<BillTransactionDetailKey, BillDetailView>;
|
|
@@ -38,4 +38,18 @@ exports.initialBillDetailView = {
|
|
|
38
38
|
eventIds: [],
|
|
39
39
|
entityApprovalIds: [],
|
|
40
40
|
approvalRuleIds: [],
|
|
41
|
+
zeniAssist: {
|
|
42
|
+
eligibleActionsFetchStatus: {
|
|
43
|
+
fetchState: 'Not-Started',
|
|
44
|
+
error: undefined,
|
|
45
|
+
},
|
|
46
|
+
retryStatus: {
|
|
47
|
+
fetchState: 'Not-Started',
|
|
48
|
+
error: undefined,
|
|
49
|
+
},
|
|
50
|
+
refundStatus: {
|
|
51
|
+
fetchState: 'Not-Started',
|
|
52
|
+
error: undefined,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
41
55
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { fetchBillDetail, updateBillDetailFetchState, removeBillDetail, updateBillDetail, waitForVendorByNameThenUpdateBillDetail } from '../billDetailViewReducer';
|
|
3
|
+
import { fetchBillDetail, updateBillDetailFetchState, removeBillDetail, updateBillDetail, waitForVendorByNameThenUpdateBillDetail, fetchEligibleActionsForBill } from '../billDetailViewReducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
5
|
import { RootState } from '../../../../../reducer';
|
|
6
6
|
import { removeBillTransaction, updateBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
@@ -22,7 +22,7 @@ import { updatePaymentInstruments } from '../../../../../entity/paymentInstrumen
|
|
|
22
22
|
import { convertAmountToHomeCurrency } from '../../editBillView/editBillViewReducer';
|
|
23
23
|
import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
|
|
24
24
|
import { updateDepositAccounts } from '../../../../../entity/depositAccount/depositAccountReducer';
|
|
25
|
-
export declare type ActionType = ReturnType<typeof fetchBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof updateBillDetailFetchState> | ReturnType<typeof removeBillTransaction> | ReturnType<typeof removeBillDetail> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof updateBillDetail> | ReturnType<typeof updateClasses> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateAddresses> | ReturnType<typeof fetchEntityHistory> | ReturnType<typeof fetchVendorsList> | ReturnType<typeof fetchDuplicateBill> | ReturnType<typeof convertAmountToHomeCurrency> | ReturnType<typeof waitForVendorByNameThenUpdateBillDetail> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills> | ReturnType<typeof updateDepositAccounts>;
|
|
25
|
+
export declare type ActionType = ReturnType<typeof fetchBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof updateBillDetailFetchState> | ReturnType<typeof removeBillTransaction> | ReturnType<typeof removeBillDetail> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof updateBillDetail> | ReturnType<typeof updateClasses> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateAddresses> | ReturnType<typeof fetchEntityHistory> | ReturnType<typeof fetchVendorsList> | ReturnType<typeof fetchDuplicateBill> | ReturnType<typeof convertAmountToHomeCurrency> | ReturnType<typeof waitForVendorByNameThenUpdateBillDetail> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof fetchEligibleActionsForBill>;
|
|
26
26
|
export declare const fetchBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
27
27
|
export declare const waitForVendorByNameThenUpdateBillDetailEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>) => Observable<{
|
|
28
28
|
payload: {
|
|
@@ -55,7 +55,7 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
55
55
|
const getTransactionDetail$ = zeniAPI
|
|
56
56
|
.getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bills/transactions/${billId}?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
57
57
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
58
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
59
59
|
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
60
60
|
((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.transaction) === null || _b === void 0 ? void 0 : _b.transaction_id) != null) {
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -110,6 +110,15 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
110
110
|
Boolean(vendorInResponse) === true) {
|
|
111
111
|
fetchActions.push((0, billPayReviewReducer_1.fetchDuplicateBill)(vendorInResponse.vendor_name, vendorInResponse.vendor_id, transactionInResponse.total_amount, transactionInResponse.recipient_total_amount, transactionInResponse.document_id, billId));
|
|
112
112
|
}
|
|
113
|
+
const billHasPaymentError = [
|
|
114
|
+
'failed',
|
|
115
|
+
'cancelled',
|
|
116
|
+
'returned',
|
|
117
|
+
].includes((_q = transactionInResponse.bill_pay_info.bill_payment_status
|
|
118
|
+
.code) !== null && _q !== void 0 ? _q : '');
|
|
119
|
+
if (billHasPaymentError) {
|
|
120
|
+
fetchActions.push((0, billDetailViewReducer_1.fetchEligibleActionsForBill)(billId, true));
|
|
121
|
+
}
|
|
113
122
|
}
|
|
114
123
|
return (0, rxjs_1.from)(fetchActions);
|
|
115
124
|
}
|
package/lib/view/spendManagement/billPay/billDetailView/epics/fetchEligibleActionsForBillEpic.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { fetchEligibleActionsForBill, updateFetchEligibleActionsFailureState, updateEligibleActionsForBill } from '../billDetailViewReducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { RootState } from '../../../../../reducer';
|
|
6
|
+
export declare type ActionType = ReturnType<typeof fetchEligibleActionsForBill> | ReturnType<typeof updateEligibleActionsForBill> | ReturnType<typeof updateFetchEligibleActionsFailureState>;
|
|
7
|
+
export declare const fetchEligibleActionsForBillEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/billPay/billDetailView/epics/fetchEligibleActionsForBillEpic.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchEligibleActionsForBillEpic = void 0;
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
9
|
+
const billDetailViewReducer_1 = require("../billDetailViewReducer");
|
|
10
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
12
|
+
const billDetailViewState_1 = require("../billDetailViewState");
|
|
13
|
+
const fetchEligibleActionsForBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.fetchEligibleActionsForBill.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
const { billId, cacheOverride } = action.payload;
|
|
15
|
+
const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
16
|
+
const state = state$.value;
|
|
17
|
+
const billDetail = (0, get_1.default)(state.billDetailViewState.billDetailById, detailKey, undefined);
|
|
18
|
+
if (cacheOverride == true ||
|
|
19
|
+
billDetail == null ||
|
|
20
|
+
billDetail.zeniAssist.eligibleActionsFetchStatus.fetchState !==
|
|
21
|
+
'In-Progress') {
|
|
22
|
+
return zeniAPI
|
|
23
|
+
.getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bills/transactions/${billId}/eligible-actions`)
|
|
24
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
27
|
+
const fetchActions = [
|
|
28
|
+
(0, billDetailViewReducer_1.updateEligibleActionsForBill)(billId, (_a = response.data.is_refund_eligible) !== null && _a !== void 0 ? _a : undefined, (_b = response.data.is_retry_eligible) !== null && _b !== void 0 ? _b : undefined),
|
|
29
|
+
];
|
|
30
|
+
return (0, rxjs_1.from)(fetchActions);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return (0, rxjs_1.of)((0, billDetailViewReducer_1.updateFetchEligibleActionsFailureState)(action.payload.billId, response.status));
|
|
34
|
+
}
|
|
35
|
+
}), (0, operators_1.catchError)((error) => {
|
|
36
|
+
console.error(`Fetch eligible actions REST API call errored out ${error}`);
|
|
37
|
+
return (0, rxjs_1.of)((0, billDetailViewReducer_1.updateFetchEligibleActionsFailureState)(action.payload.billId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Fetch eligible actions REST API call errored out ${error}`)));
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
return (0, rxjs_1.from)([]);
|
|
41
|
+
}));
|
|
42
|
+
exports.fetchEligibleActionsForBillEpic = fetchEligibleActionsForBillEpic;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { retryOrRefundBillSuccess, retryOrRefundBillFailure } from '../billDetailViewReducer';
|
|
6
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
import { updateBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof retryOrRefundBillSuccess> | ReturnType<typeof retryOrRefundBillFailure>;
|
|
9
|
+
export declare const retryOrRefundBillEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.retryOrRefundBillEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const billDetailViewReducer_1 = require("../billDetailViewReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const billDetailViewState_1 = require("../billDetailViewState");
|
|
10
|
+
const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
|
|
11
|
+
const retryOrRefundBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.retryOrRefundBill.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
|
+
const { billId, actionType } = action.payload;
|
|
14
|
+
const { editBillDetailViewState } = state$.value;
|
|
15
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
16
|
+
const billDetail = editBillDetailViewState.editBillStateById[key];
|
|
17
|
+
let apiUrl = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bills/transactions/${billId}`;
|
|
18
|
+
let payload;
|
|
19
|
+
if (actionType === 'retry') {
|
|
20
|
+
apiUrl = `${apiUrl}/payment/retry`;
|
|
21
|
+
payload = {
|
|
22
|
+
bill_pay_info: {
|
|
23
|
+
to_account: ((_b = (_a = billDetail.billDetailLocalData.paymentDetailsSection) === null || _a === void 0 ? void 0 : _a.paymentType) === null || _b === void 0 ? void 0 : _b.method.includes('international')) === true
|
|
24
|
+
? {
|
|
25
|
+
payment_instrument_id: Boolean(billDetail.billDetailLocalData
|
|
26
|
+
.isCollectToAccountInfoFromVendorContact) === false
|
|
27
|
+
? (_d = (_c = billDetail.billDetailLocalData.paymentDetailsSection) === null || _c === void 0 ? void 0 : _c.paymentTo) !== null && _d !== void 0 ? _d : null
|
|
28
|
+
: null,
|
|
29
|
+
}
|
|
30
|
+
: {
|
|
31
|
+
account_id: Boolean(billDetail.billDetailLocalData
|
|
32
|
+
.isCollectToAccountInfoFromVendorContact) === false
|
|
33
|
+
? (_f = (_e = billDetail.billDetailLocalData.paymentDetailsSection) === null || _e === void 0 ? void 0 : _e.paymentTo) !== null && _f !== void 0 ? _f : null
|
|
34
|
+
: null,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
apiUrl = `${apiUrl}/payment/refund`;
|
|
41
|
+
}
|
|
42
|
+
return zeniAPI.putAndGetJSON(apiUrl, payload).pipe((0, operators_1.mergeMap)((response) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
45
|
+
const actions = [];
|
|
46
|
+
if (response.data != null &&
|
|
47
|
+
((_a = response.data.transactions[0]) === null || _a === void 0 ? void 0 : _a.transaction_id) != null) {
|
|
48
|
+
actions.push((0, billTransactionReducer_1.updateBillTransaction)(response.data.transactions[0]));
|
|
49
|
+
}
|
|
50
|
+
actions.push((0, billDetailViewReducer_1.retryOrRefundBillSuccess)(action.payload.billId, action.payload.actionType));
|
|
51
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
52
|
+
messageSection: action.payload.actionType === 'refund'
|
|
53
|
+
? 'bill_pay_refund'
|
|
54
|
+
: 'bill_pay_retry',
|
|
55
|
+
messageText: 'success',
|
|
56
|
+
type: 'success',
|
|
57
|
+
}));
|
|
58
|
+
return (0, rxjs_1.from)(actions);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return (0, rxjs_1.of)((0, billDetailViewReducer_1.retryOrRefundBillFailure)(billId, action.payload.actionType, response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
62
|
+
messageSection: 'bill_pay_cancelled_deleted',
|
|
63
|
+
messageText: 'failed',
|
|
64
|
+
type: 'error',
|
|
65
|
+
variables: [
|
|
66
|
+
{
|
|
67
|
+
variableName: '_api-error_',
|
|
68
|
+
variableValue: response.status.message,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billDetailViewReducer_1.retryOrRefundBillFailure)(action.payload.billId, action.payload.actionType, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Retry Refund bill REST API call errored out ` +
|
|
74
|
+
JSON.stringify(error))))));
|
|
75
|
+
}));
|
|
76
|
+
exports.retryOrRefundBillEpic = retryOrRefundBillEpic;
|
|
@@ -26,6 +26,7 @@ export interface BillPayReviewSelectorView extends SelectorView {
|
|
|
26
26
|
isInvoiceDateAutoUpdated: boolean;
|
|
27
27
|
recurringBillInstance?: number;
|
|
28
28
|
recurringConfig?: RecurringBillConfigLocalData;
|
|
29
|
+
isBillMarkedForRetry?: boolean;
|
|
29
30
|
}
|
|
30
31
|
export interface DuplicateBillsSelectorView extends SelectorView {
|
|
31
32
|
bills: BillTransaction[];
|
|
@@ -58,6 +58,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
58
58
|
let isRecurring = false;
|
|
59
59
|
let recurringBillInstance;
|
|
60
60
|
let recurringConfig;
|
|
61
|
+
let isBillMarkedForRetry = false;
|
|
61
62
|
if (billId != null) {
|
|
62
63
|
const transaction = (0, get_1.default)(billTransactionState.transactionById, billId, undefined);
|
|
63
64
|
toAccountVendorEmail = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.toAccountVendorEmail;
|
|
@@ -122,6 +123,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
122
123
|
paymentDetailsSection.paymentTo = (0, editBillViewSelector_1.toPaymentToOption)(contact);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
126
|
+
isBillMarkedForRetry = Boolean(sourceBillDetail.isBillMarkedForRetry);
|
|
125
127
|
}
|
|
126
128
|
const lineDetailSection = {};
|
|
127
129
|
const lineDetailSectionUpdatesByLineId = (_j = (_h = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData) === null || _h === void 0 ? void 0 : _h.updatesByLineId) !== null && _j !== void 0 ? _j : {};
|
|
@@ -170,6 +172,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
170
172
|
recurringBillInstance,
|
|
171
173
|
recurringConfig,
|
|
172
174
|
isInvoiceDateAutoUpdated: (_y = whatForSection.isInvoiceDateAutoUpdated) !== null && _y !== void 0 ? _y : false,
|
|
175
|
+
isBillMarkedForRetry,
|
|
173
176
|
};
|
|
174
177
|
};
|
|
175
178
|
exports.getReviewPageBillDetail = getReviewPageBillDetail;
|
|
@@ -72,6 +72,8 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
72
72
|
}, string, never, never>, waitForVendorByIdThenSaveBillUpdatetoLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, billId?: string | undefined], {
|
|
73
73
|
vendorId: string;
|
|
74
74
|
billId: string | undefined;
|
|
75
|
-
}, string, never, never
|
|
75
|
+
}, string, never, never>, markBillForRetry: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
76
|
+
billId: ID;
|
|
77
|
+
}, string>;
|
|
76
78
|
declare const _default: import("@reduxjs/toolkit").Reducer<EditBillDetailViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
77
79
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
4
|
+
exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const editBillViewState_1 = require("./editBillViewState");
|
|
7
7
|
const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
|
|
@@ -325,12 +325,16 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
325
325
|
return { payload: { vendorId, billId } };
|
|
326
326
|
},
|
|
327
327
|
},
|
|
328
|
+
markBillForRetry(draft, action) {
|
|
329
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
330
|
+
draft.editBillStateById[key].isBillMarkedForRetry = true;
|
|
331
|
+
},
|
|
328
332
|
clearEditBillViewDetail(draft) {
|
|
329
333
|
Object.assign(draft, exports.initialState);
|
|
330
334
|
},
|
|
331
335
|
},
|
|
332
336
|
});
|
|
333
|
-
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore;
|
|
337
|
+
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry;
|
|
334
338
|
exports.default = editBillView.reducer;
|
|
335
339
|
function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
|
|
336
340
|
var _a, _b, _c, _d;
|
|
@@ -106,6 +106,7 @@ export interface EditBillDetailSelectorView extends SelectorView {
|
|
|
106
106
|
lastRecommendedVendorName?: string;
|
|
107
107
|
recurringConfig?: RecurringBillConfigLocalData;
|
|
108
108
|
recurringBillInstances?: RecurringBillInstance[];
|
|
109
|
+
isBillMarkedForRetry?: boolean;
|
|
109
110
|
}
|
|
110
111
|
export interface EditBillInitialDetails {
|
|
111
112
|
vendor?: Vendor;
|
|
@@ -124,6 +124,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
124
124
|
let isRecurring = false;
|
|
125
125
|
let recurringConfig;
|
|
126
126
|
let recurringBillInstances;
|
|
127
|
+
let isBillMarkedForRetry = false;
|
|
127
128
|
if (billId != null) {
|
|
128
129
|
isDeleted = (_h = transaction === null || transaction === void 0 ? void 0 : transaction.isDeleted) !== null && _h !== void 0 ? _h : false;
|
|
129
130
|
createdBy = (0, userSelector_1.getUserByUserId)(userState, (_j = transaction === null || transaction === void 0 ? void 0 : transaction.createdBy) !== null && _j !== void 0 ? _j : '');
|
|
@@ -275,6 +276,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
275
276
|
recurringConfig = sourceBillDetail.billDetailLocalData.recurringConfig;
|
|
276
277
|
recurringBillInstances =
|
|
277
278
|
sourceBillDetail.billDetailLocalData.recurringBillInstances;
|
|
279
|
+
isBillMarkedForRetry = Boolean(sourceBillDetail.isBillMarkedForRetry);
|
|
278
280
|
//add paymentToOption on initial bill load for collect from email
|
|
279
281
|
if (isCollectToAccountInfoFromVendorContact &&
|
|
280
282
|
toAccountVendorEmail != null &&
|
|
@@ -361,6 +363,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
361
363
|
recurringBillInstances,
|
|
362
364
|
recurringConfig,
|
|
363
365
|
isProcessing,
|
|
366
|
+
isBillMarkedForRetry,
|
|
364
367
|
};
|
|
365
368
|
};
|
|
366
369
|
exports.getEditBillDetail = getEditBillDetail;
|
|
@@ -24,6 +24,7 @@ export interface EditBillDetail {
|
|
|
24
24
|
uploadFetchState: FetchStateAndError;
|
|
25
25
|
suggestedVendorIdFromParsedInvoice?: ID;
|
|
26
26
|
recommendationByLineId: Record<ID, Recommendation[]>;
|
|
27
|
+
isBillMarkedForRetry?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export declare const initialBillDetail: EditBillDetail;
|
|
29
30
|
export interface EditBillDetailViewState {
|