@zeniai/client-epic-state 4.7.73 → 4.7.74

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.
Files changed (66) hide show
  1. package/lib/commonStateTypes/workingDayHelper.d.ts +5 -9
  2. package/lib/commonStateTypes/workingDayHelper.js +12 -36
  3. package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +0 -3
  4. package/lib/entity/billPay/billTransaction/billTransactionPayload.js +2 -2
  5. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +0 -3
  6. package/lib/entity/chargeCard/chargeCard.d.ts +2 -2
  7. package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.d.ts +0 -1
  8. package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.js +0 -1
  9. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +0 -1
  10. package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
  11. package/lib/entity/tenant/clearAllEpic.js +0 -2
  12. package/lib/entity/transaction/stateTypes/attachment.js +5 -5
  13. package/lib/index.d.ts +4 -6
  14. package/lib/index.js +4 -10
  15. package/lib/reducer.d.ts +0 -3
  16. package/lib/reducer.js +0 -3
  17. package/lib/view/accountList/accountListReducer.js +1 -2
  18. package/lib/view/accountList/accountListState.d.ts +1 -1
  19. package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +0 -1
  20. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +1 -1
  21. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewPayload.d.ts +0 -3
  22. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +0 -5
  23. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +2 -13
  24. package/lib/view/spendManagement/billPay/billDetailView/epics/cancelAndDeleteBillEpic.d.ts +1 -2
  25. package/lib/view/spendManagement/billPay/billDetailView/epics/cancelAndDeleteBillEpic.js +8 -19
  26. package/lib/view/spendManagement/billPay/billDetailView/epics/deleteBillEpic.d.ts +1 -2
  27. package/lib/view/spendManagement/billPay/billDetailView/epics/deleteBillEpic.js +4 -14
  28. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.d.ts +1 -2
  29. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +2 -5
  30. package/lib/view/spendManagement/billPay/billList/billListPayload.d.ts +0 -2
  31. package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +0 -3
  32. package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -10
  33. package/lib/view/spendManagement/billPay/billList/fetchBillListPerTabEpic.d.ts +1 -2
  34. package/lib/view/spendManagement/billPay/billList/fetchBillListPerTabEpic.js +1 -3
  35. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +0 -4
  36. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +9 -31
  37. package/lib/view/spendManagement/billPay/editBillView/editBillViewPayload.d.ts +0 -4
  38. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +0 -17
  39. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +2 -10
  40. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +14 -59
  41. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -28
  42. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +0 -1
  43. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +3 -3
  44. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +2 -13
  45. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +2 -3
  46. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +24 -11
  47. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +14 -100
  48. package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +0 -1
  49. package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.d.ts +0 -1
  50. package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.js +5 -9
  51. package/lib/view/spendManagement/helpers.d.ts +1 -11
  52. package/lib/view/spendManagement/helpers.js +1 -134
  53. package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.d.ts +0 -1
  54. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts +0 -1
  55. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js +0 -1
  56. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js +1 -3
  57. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts +0 -1
  58. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js +1 -2
  59. package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts +0 -1
  60. package/package.json +4 -5
  61. package/lib/entity/billPay/recurringBills/recurringBillsPayload.d.ts +0 -34
  62. package/lib/entity/billPay/recurringBills/recurringBillsPayload.js +0 -44
  63. package/lib/entity/billPay/recurringBills/recurringBillsReducer.d.ts +0 -6
  64. package/lib/entity/billPay/recurringBills/recurringBillsReducer.js +0 -40
  65. package/lib/entity/billPay/recurringBills/recurringBillsState.d.ts +0 -33
  66. package/lib/entity/billPay/recurringBills/recurringBillsState.js +0 -14
@@ -9,30 +9,22 @@ const responsePayload_1 = require("../../../../../responsePayload");
9
9
  const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
10
10
  const billDetailViewState_1 = require("../billDetailViewState");
11
11
  const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
12
- const recurringBillsReducer_1 = require("../../../../../entity/billPay/recurringBills/recurringBillsReducer");
13
12
  const cancelAndDeleteBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.cancelAndDeleteBill.match), (0, operators_1.mergeMap)((action) => {
14
- var _a;
15
13
  const query = {
16
14
  bill_pay_provider: 'zeni',
17
15
  is_delete_bill: action.payload.isDeleteBill,
18
16
  };
19
17
  const { billTransactionState } = state$.value;
20
18
  const transaction = billTransactionState.transactionById[action.payload.billId];
21
- const isRecurring = (_a = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _a !== void 0 ? _a : false;
22
- const recurringConfigId = transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillConfigId;
23
- let cancelApiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions/${action.payload.billId}`;
24
- if (isRecurring === true) {
25
- cancelApiUrl = `${cancelApiUrl}/recurring/cancel-payment`;
26
- }
27
- else {
28
- cancelApiUrl = `${cancelApiUrl}/cancel-payment`;
29
- }
30
- return zeniAPI.putAndGetJSON(cancelApiUrl, query).pipe((0, operators_1.mergeMap)((response) => {
31
- var _a;
19
+ return zeniAPI
20
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions/${action.payload.billId}/cancel-payment`, query)
21
+ .pipe((0, operators_1.mergeMap)((response) => {
22
+ var _a, _b;
32
23
  if (action.payload.isDeleteBill === true &&
33
24
  (0, responsePayload_1.isSuccessStatus)(response)) {
34
- const actions = [];
35
- actions.push((0, billDetailViewReducer_1.cancelAndDeleteBillSuccessOrFailure)('Completed', action.payload.billId, action.payload.isDeleteBill));
25
+ const actions = [
26
+ (0, billDetailViewReducer_1.cancelAndDeleteBillSuccessOrFailure)('Completed', action.payload.billId, action.payload.isDeleteBill),
27
+ ];
36
28
  if (transaction != null) {
37
29
  actions.push((0, billListReducer_1.removeTransactionIdFromBillTabList)({
38
30
  billId: action.payload.billId,
@@ -40,9 +32,6 @@ const cancelAndDeleteBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
40
32
  }));
41
33
  }
42
34
  actions.push((0, billTransactionReducer_1.removeBillTransaction)((0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId)));
43
- if (isRecurring === true && recurringConfigId != null) {
44
- actions.push((0, recurringBillsReducer_1.removeRecurringBill)(recurringConfigId));
45
- }
46
35
  actions.push((0, snackbarReducer_1.openSnackbar)({
47
36
  messageSection: 'bill_pay_cancelled_deleted',
48
37
  messageText: 'success',
@@ -52,7 +41,7 @@ const cancelAndDeleteBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
52
41
  }
53
42
  else if ((0, responsePayload_1.isSuccessResponse)(response) &&
54
43
  response.data != null &&
55
- ((_a = response.data.transactions[0]) === null || _a === void 0 ? void 0 : _a.transaction_id) != null) {
44
+ ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.transactions[0]) === null || _b === void 0 ? void 0 : _b.transaction_id) != null) {
56
45
  return (0, rxjs_1.of)((0, billTransactionReducer_1.updateBillTransaction)(response.data.transactions[0]), (0, billDetailViewReducer_1.cancelAndDeleteBillSuccessOrFailure)('Completed', action.payload.billId, action.payload.isDeleteBill), (0, snackbarReducer_1.openSnackbar)({
57
46
  messageSection: 'bill_pay_cancelled',
58
47
  messageText: 'success',
@@ -5,6 +5,5 @@ import { deleteBill, deleteBillSuccessOrFailure } from '../billDetailViewReducer
5
5
  import { removeTransactionIdFromBillTabList } from '../../billList/billListReducer';
6
6
  import { removeBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
7
7
  import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
8
- import { removeRecurringBill } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
9
- export declare type ActionType = ReturnType<typeof deleteBill> | ReturnType<typeof removeBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeTransactionIdFromBillTabList> | ReturnType<typeof deleteBillSuccessOrFailure> | ReturnType<typeof removeRecurringBill>;
8
+ export declare type ActionType = ReturnType<typeof deleteBill> | ReturnType<typeof removeBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeTransactionIdFromBillTabList> | ReturnType<typeof deleteBillSuccessOrFailure>;
10
9
  export declare const deleteBillEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
@@ -9,27 +9,20 @@ const responsePayload_1 = require("../../../../../responsePayload");
9
9
  const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
10
10
  const billDetailViewState_1 = require("../billDetailViewState");
11
11
  const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
12
- const recurringBillsReducer_1 = require("../../../../../entity/billPay/recurringBills/recurringBillsReducer");
13
12
  const deleteBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.deleteBill.match), (0, operators_1.mergeMap)((action) => {
14
- var _a;
15
13
  const query = {
16
14
  transaction_type: 'bill',
17
15
  bill_pay_provider: 'zeni',
18
16
  };
19
17
  const { billTransactionState } = state$.value;
20
18
  const transaction = billTransactionState.transactionById[action.payload.billId];
21
- const isRecurring = (_a = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _a !== void 0 ? _a : false;
22
- const recurringConfigId = transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillConfigId;
23
- let deleteApiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions/${action.payload.billId}`;
24
- if (isRecurring === true) {
25
- deleteApiUrl = `${deleteApiUrl}/recurring`;
26
- }
27
19
  return zeniAPI
28
- .deleteAndGetJSON(`${deleteApiUrl}?query=${encodeURIComponent(JSON.stringify(query))}`)
20
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bills/transactions/${action.payload.billId}?query=${encodeURIComponent(JSON.stringify(query))}`)
29
21
  .pipe((0, operators_1.mergeMap)((response) => {
30
22
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
31
- const actions = [];
32
- actions.push((0, billDetailViewReducer_1.deleteBillSuccessOrFailure)('Completed', action.payload.billId));
23
+ const actions = [
24
+ (0, billDetailViewReducer_1.deleteBillSuccessOrFailure)('Completed', action.payload.billId),
25
+ ];
33
26
  if (transaction != null) {
34
27
  actions.push((0, billListReducer_1.removeTransactionIdFromBillTabList)({
35
28
  billId: action.payload.billId,
@@ -37,9 +30,6 @@ const deleteBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operator
37
30
  }));
38
31
  }
39
32
  actions.push((0, billTransactionReducer_1.removeBillTransaction)((0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId)));
40
- if (isRecurring === true && recurringConfigId != null) {
41
- actions.push((0, recurringBillsReducer_1.removeRecurringBill)(recurringConfigId));
42
- }
43
33
  actions.push((0, snackbarReducer_1.openSnackbar)({
44
34
  messageSection: 'bill_pay_deleted',
45
35
  messageText: 'success',
@@ -20,8 +20,7 @@ import { fetchVendorsList } from '../../../../vendorList/vendorListReducer';
20
20
  import { fetchDuplicateBill } from '../../billPayReview/billPayReviewReducer';
21
21
  import { updatePaymentInstruments } from '../../../../../entity/paymentInstrument/paymentInstrumentReducer';
22
22
  import { convertAmountToHomeCurrency } from '../../editBillView/editBillViewReducer';
23
- import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
24
- 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>;
23
+ 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>;
25
24
  export declare const fetchBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
26
25
  export declare const waitForVendorByNameThenUpdateBillDetailEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>) => Observable<{
27
26
  payload: {
@@ -27,7 +27,6 @@ const commonHistoryReducer_1 = require("../../../commonHistoryView/commonHistory
27
27
  const vendorListReducer_1 = require("../../../../vendorList/vendorListReducer");
28
28
  const billPayReviewReducer_1 = require("../../billPayReview/billPayReviewReducer");
29
29
  const paymentInstrumentReducer_1 = require("../../../../../entity/paymentInstrument/paymentInstrumentReducer");
30
- const recurringBillsReducer_1 = require("../../../../../entity/billPay/recurringBills/recurringBillsReducer");
31
30
  const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.fetchBillDetail.match), (0, operators_1.mergeMap)((action) => {
32
31
  const { billId, cacheOverride, isShowDeletedBillsEnabled } = action.payload;
33
32
  const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
@@ -72,8 +71,6 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
72
71
  : [];
73
72
  const fetchActions = [
74
73
  ...getVendorPreviousBillsActions(response.data.transaction),
75
- (0, recurringBillsReducer_1.updateRecurringBillConfigs)(response.data.recurring_bill_configs),
76
- (0, recurringBillsReducer_1.updateRecurringBills)(response.data.recurring_bills),
77
74
  (0, billTransactionReducer_1.updateBillTransaction)(response.data.transaction),
78
75
  (0, paymentAccountReducer_1.updatePaymentAccounts)(response.data.payment_accounts),
79
76
  (0, accountReducer_1.updateAccounts)((_j = response.data.accounts) !== null && _j !== void 0 ? _j : [], 'bill_pay'),
@@ -94,8 +91,8 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
94
91
  // end: save all vendor related entities
95
92
  ];
96
93
  if (vendorInResponse == null &&
97
- response.data.transaction.candidate_vendor_name != null &&
98
- response.data.transaction.candidate_vendor_name.length > 0) {
94
+ response.data.transaction.candidate_vendor_name != null
95
+ && response.data.transaction.candidate_vendor_name.length > 0) {
99
96
  fetchActions.push((0, vendorListReducer_1.fetchVendorsList)((_l = response.data) === null || _l === void 0 ? void 0 : _l.transaction.candidate_vendor_name));
100
97
  fetchActions.push((0, billDetailViewReducer_1.waitForVendorByNameThenUpdateBillDetail)(billId, response.data, (_m = response.data.vendors[0]) === null || _m === void 0 ? void 0 : _m.vendor_id));
101
98
  }
@@ -6,7 +6,6 @@ import { VendorPayload } from '../../../../entity/vendor/vendorPayload';
6
6
  import { ZeniAPIResponse } from '../../../../responsePayload';
7
7
  import { ID } from '../../../../commonStateTypes/common';
8
8
  import { UserPayload } from '../../../../entity/user/userPayload';
9
- import { RecurringBillConfigResponsePayload } from '../../../../entity/billPay/recurringBills/recurringBillsPayload';
10
9
  export interface BillListPayload {
11
10
  customers: CustomerPayload[];
12
11
  query_definitions: Record<string, unknown>;
@@ -16,7 +15,6 @@ export interface BillListPayload {
16
15
  vendors: VendorPayload[];
17
16
  accounts: AccountBasePayload[];
18
17
  users: UserPayload[];
19
- recurring_bill_configs: RecurringBillConfigResponsePayload[];
20
18
  query: {
21
19
  start_date: string;
22
20
  end_date: string;
@@ -9,11 +9,8 @@ import { UserState } from '../../../../entity/user/userState';
9
9
  import { EntityApprovalStatusState } from '../../../../entity/entityApprovalStatus/entityApprovalStatusState';
10
10
  import { SortOrder } from '../../../../commonStateTypes/selectorTypes/sortOrderTypes';
11
11
  import { Approvers } from '../../../../entity/approvalRule/approvalRuleState';
12
- import { RecurringBillConfig } from '../../../../entity/billPay/recurringBills/recurringBillsState';
13
12
  export interface BillTransactionView extends BillTransaction {
14
13
  approvers: Approvers;
15
- isRecurring: boolean;
16
- recurringBillConfig?: RecurringBillConfig;
17
14
  }
18
15
  export interface BillListReport extends SelectorView {
19
16
  billOrder: EntityOrder;
@@ -15,7 +15,7 @@ const approvalRuleState_1 = require("../../../../entity/approvalRule/approvalRul
15
15
  const spendManagementFilterHelpers_1 = require("../../spendManagementFilterHelpers");
16
16
  const getBillList = (state, currentTimePeriod) => {
17
17
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
18
- const { billListState, billTransactionState, billPayConfigState, entityApprovalStatusState, userState, recurringBillState, } = state;
18
+ const { billListState, billTransactionState, billPayConfigState, entityApprovalStatusState, userState, } = state;
19
19
  const key = (0, billListState_1.getBillListKey)(currentTimePeriod, billListState.currentTab);
20
20
  const pendingApprovalKey = (0, billListState_1.getBillListKey)(currentTimePeriod, 'pending_approval');
21
21
  const billPayBotEmail = (0, billPayConfigSelector_1.getBillPayConfigBotEmail)(billPayConfigState);
@@ -106,15 +106,7 @@ const getBillList = (state, currentTimePeriod) => {
106
106
  if (entityApprovalStatusState.entityApprovalStatusById[transaction.entityApprovalId] != null) {
107
107
  approvers = (0, exports.getApproversOrRejectors)(transaction, entityApprovalStatusState, userState);
108
108
  }
109
- const isRecurring = transaction.isRecurring;
110
- let recurringBillDetail = undefined;
111
- if (isRecurring && transaction.recurringBillConfigId != null) {
112
- recurringBillDetail = (0, get_1.default)(recurringBillState.recurringBillDetailByConfigId, transaction.recurringBillConfigId, undefined);
113
- }
114
- const recurringBillConfig = recurringBillDetail === null || recurringBillDetail === void 0 ? void 0 : recurringBillDetail.recurringBillConfig;
115
- return Object.assign(Object.assign({}, transaction), { approvers,
116
- isRecurring,
117
- recurringBillConfig });
109
+ return Object.assign(Object.assign({}, transaction), { approvers });
118
110
  });
119
111
  transactionsView = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('bill_pay', transactionsView, billListState.filters);
120
112
  const TransactionsPendingForMyApprovalLength = pendingApprovalTransactionIDs.length;
@@ -6,6 +6,5 @@ import { updateBillTransactions } from '../../../../entity/billPay/billTransacti
6
6
  import { RootState } from '../../../../reducer';
7
7
  import { updateEntityApprovalStatus } from '../../../../entity/entityApprovalStatus/entityApprovalStatusReducer';
8
8
  import { updateAllUsers } from '../../../../entity/user/userReducer';
9
- import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../entity/billPay/recurringBills/recurringBillsReducer';
10
- export declare type ActionType = ReturnType<typeof fetchBillListPerTab> | ReturnType<typeof updateBillTransactions> | ReturnType<typeof updateBillListByStatus> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateBillListFailure> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
9
+ export declare type ActionType = ReturnType<typeof fetchBillListPerTab> | ReturnType<typeof updateBillTransactions> | ReturnType<typeof updateBillListByStatus> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateBillListFailure> | ReturnType<typeof updateEntityApprovalStatus>;
11
10
  export declare const fetchBillListPerTabEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -9,7 +9,6 @@ const billListReducer_1 = require("./billListReducer");
9
9
  const billTransactionReducer_1 = require("../../../../entity/billPay/billTransaction/billTransactionReducer");
10
10
  const entityApprovalStatusReducer_1 = require("../../../../entity/entityApprovalStatus/entityApprovalStatusReducer");
11
11
  const userReducer_1 = require("../../../../entity/user/userReducer");
12
- const recurringBillsReducer_1 = require("../../../../entity/billPay/recurringBills/recurringBillsReducer");
13
12
  const fetchBillListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billListReducer_1.fetchBillListPerTab.match), (0, operators_1.mergeMap)((action) => {
14
13
  const { period, tab, isShowDeletedBillsEnabled } = action.payload;
15
14
  const queryParam = {
@@ -31,8 +30,7 @@ const fetchBillListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0
31
30
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
32
31
  const updateActions = [];
33
32
  updateActions.push((0, userReducer_1.updateAllUsers)({ users: (_a = response.data.users) !== null && _a !== void 0 ? _a : [] })),
34
- updateActions.push((0, recurringBillsReducer_1.updateRecurringBillConfigs)(response.data.recurring_bill_configs));
35
- updateActions.push((0, billTransactionReducer_1.updateBillTransactions)(response.data.transactions));
33
+ updateActions.push((0, billTransactionReducer_1.updateBillTransactions)(response.data.transactions));
36
34
  updateActions.push((0, billListReducer_1.updateBillListByStatus)({
37
35
  billList: response.data,
38
36
  tab: tab,
@@ -5,7 +5,6 @@ import { BillTransaction } from '../../../../entity/billPay/billTransaction/bill
5
5
  import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
6
6
  import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
7
7
  import { Vendor } from '../../../../entity/vendor/vendorState';
8
- import { RecurringBillConfigLocalData } from '../editBillView/editBillViewState';
9
8
  import { PaymentDetailsSectionView } from '../editBillView/editBillViewSelector';
10
9
  import { Amount } from '../../../../commonStateTypes/amount';
11
10
  import { BillPayConfig } from '../billPayConfig/billPayConfigState';
@@ -21,9 +20,6 @@ export interface BillPayReviewSelectorView extends SelectorView {
21
20
  toAccountVendorEmail?: string;
22
21
  isCollectToAccountInfoFromVendorContact: boolean;
23
22
  billPayConfigList: BillPayConfig[];
24
- isRecurring: boolean;
25
- recurringBillInstance?: number;
26
- recurringConfig?: RecurringBillConfigLocalData;
27
23
  }
28
24
  export interface DuplicateBillsSelectorView extends SelectorView {
29
25
  bills: BillTransaction[];
@@ -35,8 +35,8 @@ const getDuplicateBills = (state, billId) => {
35
35
  };
36
36
  exports.getDuplicateBills = getDuplicateBills;
37
37
  const getReviewPageBillDetail = (state, billId) => {
38
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
39
- const { accountListState, accountState, setupViewState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, recurringBillState, } = state;
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
39
+ const { accountListState, accountState, setupViewState, billTransactionState, classListState, editBillDetailViewState, paymentAccountState, vendorState, contactState, billPayConfigState, } = state;
40
40
  const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId !== null && billId !== void 0 ? billId : '');
41
41
  const sourceBillDetail = billId != null
42
42
  ? (_a = editBillDetailViewState.editBillStateById) === null || _a === void 0 ? void 0 : _a[key]
@@ -49,31 +49,18 @@ const getReviewPageBillDetail = (state, billId) => {
49
49
  const withdrawFromList = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, setupViewState.accountDetails.paymentAccountIds);
50
50
  let fetchState = 'Not-Started';
51
51
  let sourceBillDetailFetchState = 'Not-Started';
52
- const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'billPayAccountList');
52
+ const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
53
53
  let toAccountVendorEmail = undefined;
54
54
  let isCollectToAccountInfoFromVendorContact = false;
55
- let isRecurring = false;
56
- let recurringBillInstance;
57
- let recurringConfig;
58
55
  if (billId != null) {
59
56
  const transaction = (0, get_1.default)(billTransactionState.transactionById, billId, undefined);
60
57
  toAccountVendorEmail = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.toAccountVendorEmail;
61
58
  isCollectToAccountInfoFromVendorContact =
62
59
  (_b = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.isCollectToAccountInfoFromVendorContact) !== null && _b !== void 0 ? _b : false;
63
- isRecurring = (_c = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _c !== void 0 ? _c : false;
64
- if (isRecurring &&
65
- (transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillConfigId) != null &&
66
- transaction.recurringBillInstance != null) {
67
- recurringBillInstance = (_d = transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillInstance) !== null && _d !== void 0 ? _d : 1;
68
- const recurringBillDetail = (0, get_1.default)(recurringBillState.recurringBillDetailByConfigId, transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillConfigId, undefined);
69
- if (recurringBillDetail != null) {
70
- recurringConfig = Object.assign({}, recurringBillDetail.recurringBillConfig);
71
- }
72
- }
73
60
  if (sourceBillDetail != null) {
74
61
  sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)([
75
62
  sourceBillDetail.fetchStatus,
76
- accountListState.byReportId['billPayAccountList'],
63
+ accountListState.byReportId['accountList'],
77
64
  classListState,
78
65
  ]).fetchState;
79
66
  }
@@ -103,12 +90,6 @@ const getReviewPageBillDetail = (state, billId) => {
103
90
  isCollectToAccountInfoFromVendorContact =
104
91
  sourceBillDetail.billDetailLocalData
105
92
  .isCollectToAccountInfoFromVendorContact;
106
- isRecurring = (_e = sourceBillDetail.billDetailLocalData.isRecurring) !== null && _e !== void 0 ? _e : false;
107
- recurringConfig = sourceBillDetail.billDetailLocalData.recurringConfig;
108
- if (isRecurring) {
109
- recurringBillInstance =
110
- (_g = (_f = sourceBillDetail.billDetailLocalData.recurringConfig) === null || _f === void 0 ? void 0 : _f.currentInstance) !== null && _g !== void 0 ? _g : 1;
111
- }
112
93
  //add paymentToOption on initial bill load for collect from email
113
94
  if (isCollectToAccountInfoFromVendorContact &&
114
95
  toAccountVendorEmail != null &&
@@ -121,7 +102,7 @@ const getReviewPageBillDetail = (state, billId) => {
121
102
  }
122
103
  }
123
104
  const lineDetailSection = {};
124
- 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 : {};
105
+ const lineDetailSectionUpdatesByLineId = (_d = (_c = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData) === null || _c === void 0 ? void 0 : _c.updatesByLineId) !== null && _d !== void 0 ? _d : {};
125
106
  if (accountList.fetchState === 'Completed') {
126
107
  Object.keys(lineDetailSectionUpdatesByLineId).forEach((lineId) => {
127
108
  var _a;
@@ -139,9 +120,9 @@ const getReviewPageBillDetail = (state, billId) => {
139
120
  const { bills, fetchState: duplicateBillFetchState } = (0, exports.getDuplicateBills)(state, billId);
140
121
  fetchState = duplicateBillFetchState;
141
122
  const totalAmount = {
142
- amount: (_l = (_k = sourceBillDetail.billDetailLocalData.totalAmount) === null || _k === void 0 ? void 0 : _k.amount) !== null && _l !== void 0 ? _l : 0,
143
- currencyCode: (_o = (_m = sourceBillDetail.billDetailLocalData.totalAmount) === null || _m === void 0 ? void 0 : _m.currencyCode) !== null && _o !== void 0 ? _o : 'USD',
144
- currencySymbol: (_q = (_p = sourceBillDetail.billDetailLocalData.totalAmount) === null || _p === void 0 ? void 0 : _p.currencySymbol) !== null && _q !== void 0 ? _q : '$',
123
+ amount: (_f = (_e = sourceBillDetail.billDetailLocalData.totalAmount) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0,
124
+ currencyCode: (_h = (_g = sourceBillDetail.billDetailLocalData.totalAmount) === null || _g === void 0 ? void 0 : _g.currencyCode) !== null && _h !== void 0 ? _h : 'USD',
125
+ currencySymbol: (_k = (_j = sourceBillDetail.billDetailLocalData.totalAmount) === null || _j === void 0 ? void 0 : _j.currencySymbol) !== null && _k !== void 0 ? _k : '$',
145
126
  };
146
127
  return {
147
128
  version: 0,
@@ -154,12 +135,9 @@ const getReviewPageBillDetail = (state, billId) => {
154
135
  paymentDetailsSection,
155
136
  file: file,
156
137
  billPayConfigList: (0, editBillViewSelector_1.getBillPayConfigList)(billPayConfigState),
157
- saveStatus: (_r = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.saveStatus) !== null && _r !== void 0 ? _r : undefined,
138
+ saveStatus: (_l = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.saveStatus) !== null && _l !== void 0 ? _l : undefined,
158
139
  toAccountVendorEmail,
159
140
  isCollectToAccountInfoFromVendorContact,
160
- isRecurring,
161
- recurringBillInstance,
162
- recurringConfig,
163
141
  };
164
142
  };
165
143
  exports.getReviewPageBillDetail = getReviewPageBillDetail;
@@ -9,7 +9,6 @@ import { VendorPayload } from '../../../../entity/vendor/vendorPayload';
9
9
  import { ZeniAPIResponse } from '../../../../responsePayload';
10
10
  import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
11
11
  import { LineItemRecommendationsLocalData } from './editBillViewSelector';
12
- import { RecurringBillConfigResponsePayload, RecurringBillDataPayload } from '../../../../entity/billPay/recurringBills/recurringBillsPayload';
13
12
  export interface BillDetailPayload {
14
13
  transaction: BillTransactionPayload;
15
14
  bank_accounts: BankAccountPayload[];
@@ -28,9 +27,6 @@ export interface BillDetailQuery {
28
27
  }
29
28
  export interface BillSavePayload {
30
29
  transactions: BillTransactionPayload[];
31
- recurring_bill_configs?: RecurringBillConfigResponsePayload[] | null;
32
- recurring_bill_instances?: RecurringBillDataPayload[] | null;
33
- future_recurring_bill_instances?: RecurringBillDataPayload[] | null;
34
30
  }
35
31
  export declare type BillDetailResponse = ZeniAPIResponse<BillDetailPayload>;
36
32
  export declare type BillSaveResponse = ZeniAPIResponse<BillSavePayload>;
@@ -6,7 +6,6 @@ const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const editBillViewState_1 = require("./editBillViewState");
7
7
  const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
8
8
  const amount_1 = require("../../../../commonStateTypes/amount");
9
- const helpers_1 = require("../../helpers");
10
9
  exports.initialState = {
11
10
  newBillState: editBillViewState_1.initialBillDetail,
12
11
  editBillStateById: {},
@@ -83,23 +82,14 @@ const editBillView = (0, toolkit_1.createSlice)({
83
82
  },
84
83
  },
85
84
  saveBillUpdatesToLocalStore(draft, action) {
86
- const recurringLocalConfig = action.payload.billDetailLocalData.recurringConfig;
87
85
  if (action.payload.billId != null) {
88
86
  const billId = action.payload.billId;
89
87
  const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
90
- const prevRecurringConfig = draft.editBillStateById[key].billDetailLocalData.recurringConfig;
91
88
  draft.editBillStateById[key].billDetailLocalData = Object.assign(Object.assign({}, draft.editBillStateById[key].billDetailLocalData), action.payload.billDetailLocalData);
92
89
  draft.editBillStateById[key].billId = billId;
93
- if (recurringLocalConfig != null) {
94
- doUpdateRecurringBillLocalData(draft.editBillStateById[key].billDetailLocalData, recurringLocalConfig, prevRecurringConfig);
95
- }
96
90
  }
97
91
  else {
98
- const prevRecurringConfig = draft.newBillState.billDetailLocalData.recurringConfig;
99
92
  draft.newBillState.billDetailLocalData = Object.assign(Object.assign({}, draft.newBillState.billDetailLocalData), action.payload.billDetailLocalData);
100
- if (recurringLocalConfig != null) {
101
- doUpdateRecurringBillLocalData(draft.newBillState.billDetailLocalData, recurringLocalConfig, prevRecurringConfig);
102
- }
103
93
  }
104
94
  },
105
95
  discardBillUpdatesInLocalStore(draft, action) {
@@ -313,10 +303,3 @@ const editBillView = (0, toolkit_1.createSlice)({
313
303
  });
314
304
  _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;
315
305
  exports.default = editBillView.reducer;
316
- function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
317
- var _a, _b, _c, _d;
318
- const recurringBillDetail = (0, helpers_1.updateRecurringBillDetails)(currentConfig, prevConfig, billDetail.recurringBillInstances, (_a = billDetail.totalAmount) === null || _a === void 0 ? void 0 : _a.amount);
319
- billDetail.recurringConfig = Object.assign({ id: (_b = prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.id) !== null && _b !== void 0 ? _b : (_c = billDetail.recurringConfig) === null || _c === void 0 ? void 0 : _c.id }, recurringBillDetail.recurringConfig);
320
- billDetail.recurringBillInstances =
321
- (_d = recurringBillDetail.recurringInstances) !== null && _d !== void 0 ? _d : [];
322
- }
@@ -2,7 +2,7 @@ import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
2
2
  import { RootState } from '../../../../reducer';
3
3
  import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { Amount } from '../../../../commonStateTypes/amount';
5
- import { BillPayInfo, BillPaymentMethod, BillStageCodeType, BillTransaction, InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/billTransactionState';
5
+ import { BillPayInfo, BillPaymentMethod, BillStageCodeType, InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/billTransactionState';
6
6
  import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
7
7
  import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
8
8
  import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
@@ -11,7 +11,7 @@ import { ZeniDate } from '../../../../zeniDayJS';
11
11
  import { AccountListSelectorView } from '../../../accountList/accountListSelector';
12
12
  import { ClassListSelectorView } from '../../../classList/classListSelector';
13
13
  import { PreviousBillsSelectorView } from '../previousBills/previousBillsSelector';
14
- import { AddBillAutoFields, WhatForSection, PaymentModeType, PaymentMode, RecurringBillConfigLocalData, RecurringBillInstance } from './editBillViewState';
14
+ import { AddBillAutoFields, WhatForSection, PaymentModeType, PaymentMode } from './editBillViewState';
15
15
  import { BillActivity } from '../billDetailView/billDetailViewSelector';
16
16
  import { BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
17
17
  import { User } from '../../../../entity/user/userState';
@@ -25,7 +25,6 @@ import { RecommendationByLineId } from '../../../../entity/transaction/stateType
25
25
  import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vendorViewState';
26
26
  import { AccountBase, RecommendedAccountBase } from '../../../../entity/account/accountState';
27
27
  import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classState';
28
- import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
29
28
  export declare type PaymentToOption = {
30
29
  id: ID;
31
30
  type: PaymentModeType;
@@ -99,9 +98,6 @@ export interface EditBillDetailSelectorView extends SelectorView {
99
98
  recommendationByLineID?: RecommendationByLineId;
100
99
  vendorDetailLocalData?: VendorDetailLocalData;
101
100
  recommendedVendor?: Vendor;
102
- isRecurring: boolean;
103
- recurringConfig?: RecurringBillConfigLocalData;
104
- recurringBillInstances?: RecurringBillInstance[];
105
101
  }
106
102
  export interface EditBillInitialDetails {
107
103
  vendor?: Vendor;
@@ -124,7 +120,3 @@ export interface PaymentDetailsSectionView {
124
120
  internationalTransferFeeBearerPaymentMethod?: InternationalTransferFeeBearerPaymentMethod;
125
121
  conversionRate?: number;
126
122
  }
127
- export declare const getRecurringBillLocalData: (recurringBillState: RecurringBillState, transaction: BillTransaction) => {
128
- recurringBillInstancesLocalData: RecurringBillInstance[];
129
- recurringConfigLocalData?: RecurringBillConfigLocalData | undefined;
130
- };