@zeniai/client-epic-state 4.14.13 → 4.14.14

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 (87) hide show
  1. package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +0 -1
  2. package/lib/entity/billPay/billTransaction/billTransactionPayload.js +0 -3
  3. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +3 -6
  4. package/lib/entity/billPay/billTransaction/billTransactionState.js +1 -18
  5. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  6. package/lib/entity/snackbar/snackbarTypes.js +0 -4
  7. package/lib/entity/tenant/epic/signInUserEpic.js +7 -13
  8. package/lib/entity/tenant/tenantReducer.d.ts +0 -1
  9. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  10. package/lib/index.d.ts +13 -14
  11. package/lib/index.js +15 -26
  12. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  13. package/lib/view/bankAccountView/bankAccountViewReducer.d.ts +2 -2
  14. package/lib/view/billPayCard/fetchBillPayCardEpic.js +0 -1
  15. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  16. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  17. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  18. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  19. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  20. package/lib/view/dashboard/dashboardEpic.js +8 -7
  21. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +4 -7
  22. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -2
  23. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
  24. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -2
  25. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
  26. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -1
  27. package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +3 -3
  28. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +27 -76
  29. package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -1
  30. package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -3
  31. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +3 -1
  32. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +12 -2
  33. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +12 -13
  34. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -0
  35. package/lib/view/expenseAutomationView/helpers/helpers.d.ts +0 -3
  36. package/lib/view/expenseAutomationView/helpers/helpers.js +1 -4
  37. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +2 -1
  38. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -12
  39. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -6
  40. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -5
  41. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +65 -102
  42. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +2 -1
  43. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -20
  44. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -4
  45. package/lib/view/financeStatement/financeStatementEpic.d.ts +4 -4
  46. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +5 -4
  47. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  48. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  49. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  50. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  51. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  52. package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +1 -1
  53. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  54. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +2 -9
  55. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +8 -35
  56. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  57. package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -3
  58. package/lib/view/spendManagement/billPay/billList/billListSelector.js +18 -55
  59. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  60. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  61. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +2 -7
  62. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +6 -18
  63. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -6
  64. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +4 -9
  65. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +4 -18
  66. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +1 -2
  67. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -2
  68. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +4 -8
  69. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +5 -27
  70. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +2 -4
  71. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -33
  72. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -6
  73. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +5 -16
  74. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +13 -27
  75. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +3 -7
  76. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +28 -48
  77. package/lib/view/spendManagement/billPay/magicLinkView/magicLinkViewReducer.d.ts +2 -2
  78. package/lib/view/spendManagement/helpers.d.ts +0 -2
  79. package/lib/view/spendManagement/helpers.js +1 -9
  80. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +1 -6
  81. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +2 -12
  82. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  83. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  84. package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.d.ts +1 -1
  85. package/package.json +1 -1
  86. package/lib/commonStateTypes/reimbursementTypeCode.d.ts +0 -2
  87. package/lib/commonStateTypes/reimbursementTypeCode.js +0 -5
@@ -11,8 +11,6 @@ const getSubCodePayload = (subCode) => {
11
11
  return 'same-day';
12
12
  case 'usDomestic':
13
13
  return 'us-domestic';
14
- case 'outsideZeni':
15
- return 'outside-zeni';
16
14
  default:
17
15
  return subCode;
18
16
  }
@@ -24,8 +22,6 @@ const getBillPaymentSubConfigCodeKey = (subCode) => {
24
22
  return 'sameDay';
25
23
  case 'us-domestic':
26
24
  return 'usDomestic';
27
- case 'outside-zeni':
28
- return 'outsideZeni';
29
25
  default:
30
26
  return subCode;
31
27
  }
@@ -84,7 +80,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
84
80
  };
85
81
  let description = '';
86
82
  let internationalFee;
87
- if (code === 'ach' && accType != null) {
83
+ if (code === 'ach') {
88
84
  feeAmount = {
89
85
  amount: fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType].amount,
90
86
  currencyCode: fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
@@ -95,7 +91,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
95
91
  description =
96
92
  fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType].description;
97
93
  }
98
- else if (subCode === 'international' && accType != null) {
94
+ else if (subCode === 'international') {
99
95
  if (internationalMethod === 'usd-to-local-currency') {
100
96
  feeAmount = {
101
97
  amount: fees.wire[subCode][accType][internationalMethod].amount,
@@ -119,7 +115,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
119
115
  .description;
120
116
  }
121
117
  }
122
- else if (subCode === 'us-domestic' && accType != null) {
118
+ else if (subCode === 'us-domestic') {
123
119
  feeAmount = {
124
120
  amount: fees.wire[subCode][accType].amount,
125
121
  currencyCode: fees.wire[subCode][accType].currency_code,
@@ -138,7 +134,7 @@ const getTimelineDetail = (paymentTimeline, code, subCode, accType) => {
138
134
  value: 0,
139
135
  units: 'days',
140
136
  };
141
- if (code === 'ach' && accType != null) {
137
+ if (code === 'ach') {
142
138
  minPeriod = {
143
139
  value: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
144
140
  .min.value,
@@ -152,7 +148,7 @@ const getTimelineDetail = (paymentTimeline, code, subCode, accType) => {
152
148
  .max.units,
153
149
  };
154
150
  }
155
- else if (code === 'wire' && accType != null) {
151
+ else if (code === 'wire') {
156
152
  minPeriod = {
157
153
  value: paymentTimeline[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)][accType].min.value,
158
154
  units: paymentTimeline[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)][accType].min.units,
@@ -177,10 +173,6 @@ const getAccountDetail = (account, code, subCode) => {
177
173
  accountBasePayload =
178
174
  account[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)];
179
175
  }
180
- else if (code === 'outside-zeni') {
181
- accountBasePayload =
182
- account['outside-zeni'][(0, billPayConfigState_1.toBillPaymentOutsideZeniSubMethodCodeType)(subCode)];
183
- }
184
176
  return accountBasePayload;
185
177
  };
186
178
  const getClassDetail = (classConfig, code, subCode) => {
@@ -196,10 +188,6 @@ const getClassDetail = (classConfig, code, subCode) => {
196
188
  classBasePayload =
197
189
  classConfig[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)];
198
190
  }
199
- else if (code === 'outside-zeni') {
200
- classBasePayload =
201
- classConfig['outside-zeni'][(0, billPayConfigState_1.toBillPaymentOutsideZeniSubMethodCodeType)(subCode)];
202
- }
203
191
  return classBasePayload;
204
192
  };
205
193
  const mapBillPayConfigPayloadToBillPayConfig = (paymentProcessor, isEnabled, isVerified, code, subCode, accType, internationalMethod, internationalSubMethod) => {
@@ -209,7 +197,7 @@ const mapBillPayConfigPayloadToBillPayConfig = (paymentProcessor, isEnabled, isV
209
197
  return {
210
198
  minPeriod: minPeriod,
211
199
  maxPeriod: maxPeriod,
212
- method: (0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigState_1.toBillPaymentSubConfigCodeKeyType)((0, exports.getBillPaymentSubConfigCodeKey)(subCode)), accType != null ? (0, exports.getAccountTypeSubConfigCodeKey)(accType) : undefined, internationalMethod != null
200
+ method: (0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigState_1.toBillPaymentSubConfigCodeKeyType)((0, exports.getBillPaymentSubConfigCodeKey)(subCode)), (0, exports.getAccountTypeSubConfigCodeKey)(accType), internationalMethod != null
213
201
  ? (0, exports.getInternationalWireMethodCodeKey)(internationalMethod)
214
202
  : undefined, internationalSubMethod != null
215
203
  ? (0, exports.getInternationalSubConfigCodeKey)(internationalSubMethod)
@@ -84,12 +84,6 @@ const billPayConfig = (0, toolkit_1.createSlice)({
84
84
  });
85
85
  break;
86
86
  }
87
- case 'outside-zeni': {
88
- billPayConfigState_1.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES.forEach((subCode) => {
89
- draft.methodById[(0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentSubConfigCodeKey)(subCode))] = (0, billPayConfigPayload_1.mapBillPayConfigPayloadToBillPayConfig)(payload.payment_processor, payload.is_outside_zeni_payment_enabled, true, code, subCode);
90
- });
91
- break;
92
- }
93
87
  }
94
88
  });
95
89
  draft.fetchState = 'Completed';
@@ -50,8 +50,8 @@ export interface ConfigPeriod {
50
50
  value: number;
51
51
  units: string;
52
52
  }
53
- export declare const BILL_PAYMENT_METHOD_CODE: readonly ["ach", "wire", "outside-zeni"];
54
- export declare const toBillPaymentMethodCodeType: (v: string) => "ach" | "wire" | "outside-zeni";
53
+ export declare const BILL_PAYMENT_METHOD_CODE: readonly ["ach", "wire"];
54
+ export declare const toBillPaymentMethodCodeType: (v: string) => "ach" | "wire";
55
55
  export declare type BillPaymentConfigCodeType = ReturnType<typeof toBillPaymentMethodCodeType>;
56
56
  export declare const PAYMENT_ACH_SUB_CODES: readonly ["standard", "same-day"];
57
57
  export declare const toPaymentAchSubMethodCodeType: (v: string) => "standard" | "same-day";
@@ -63,11 +63,6 @@ export declare const toBillPaymentWireSubMethodCodeType: (v: string) => "interna
63
63
  export declare type BillPaymentWireSubConfigCodeType = ReturnType<typeof toBillPaymentWireSubMethodCodeType>;
64
64
  declare const toBillPaymentWireSubMethodCodeKeyType: (v: string) => "usDomestic" | "international";
65
65
  export declare type BillPaymentWireSubConfigCodeKeyType = ReturnType<typeof toBillPaymentWireSubMethodCodeKeyType>;
66
- export declare const BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES: readonly ["outside-zeni"];
67
- export declare const toBillPaymentOutsideZeniSubMethodCodeType: (v: string) => "outside-zeni";
68
- export declare type BillPaymentOutsideZeniSubConfigCodeType = ReturnType<typeof toBillPaymentOutsideZeniSubMethodCodeType>;
69
- declare const toBillPaymentOutsideZeniSubMethodCodeKeyType: (v: string) => "outsideZeni";
70
- export declare type BillPaymentOutsideZeniSubMethodCodeKeyType = ReturnType<typeof toBillPaymentOutsideZeniSubMethodCodeKeyType>;
71
66
  export declare const INTERNATIONAL_CODES: readonly ["usd-to-local-currency", "usd-to-usd"];
72
67
  declare const toInternationalWireMethodCodeType: (v: string) => "usd-to-local-currency" | "usd-to-usd";
73
68
  export declare type InternationalWireMethodCodeType = ReturnType<typeof toInternationalWireMethodCodeType>;
@@ -78,8 +73,8 @@ declare const toInternationalSubMethodCodeType: (v: string) => "swift_our" | "sw
78
73
  export declare type InternationalSubConfigCodeType = ReturnType<typeof toInternationalSubMethodCodeType>;
79
74
  declare const toInternationalSubMethodCodeKeyType: (v: string) => "swiftOur" | "swiftSha";
80
75
  export declare type InternationalSubConfigCodeKeyType = ReturnType<typeof toInternationalSubMethodCodeKeyType>;
81
- export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType | BillPaymentWireSubConfigCodeType | BillPaymentOutsideZeniSubConfigCodeType;
82
- export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType | BillPaymentOutsideZeniSubMethodCodeKeyType;
76
+ export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType | BillPaymentWireSubConfigCodeType;
77
+ export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType;
83
78
  export declare const toBillPaymentSubConfigCodeKeyType: (v: string) => BillPaymentSubConfigCodeKeyType;
84
79
  export declare const toBillPaymentSubConfigCodeType: (v: string) => BillPaymentSubConfigCodeType;
85
80
  export declare const ACCOUNT_TYPE_CODES: readonly ["deposit_account", "payment_account"];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.INTERNATIONAL_SUB_CODES = exports.INTERNATIONAL_CODES = exports.toBillPaymentOutsideZeniSubMethodCodeType = exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
3
+ exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.INTERNATIONAL_SUB_CODES = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
4
4
  const common_1 = require("../../../../commonStateTypes/common");
5
5
  const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
6
6
  const getBillPayConfigKey = (method, subMethod) => {
@@ -10,7 +10,7 @@ const getBillPayConfigKey = (method, subMethod) => {
10
10
  exports.getBillPayConfigKey = getBillPayConfigKey;
11
11
  const getBillPayConfigMethodKey = (method, subMethod, accType, internationalMethod, internationalSubMethod) => {
12
12
  const keys = ['billPay', method, subMethod];
13
- if (method !== 'outside-zeni' && accType != null) {
13
+ if (accType != null) {
14
14
  keys.push(accType);
15
15
  }
16
16
  if (internationalMethod != null) {
@@ -25,11 +25,7 @@ exports.getBillPayConfigMethodKey = getBillPayConfigMethodKey;
25
25
  const DYNAMIC_FEE_TYPE = ['percent', 'fixed'];
26
26
  const toDynamicFeeType = (v) => (0, stringToUnion_1.stringToUnion)(v, DYNAMIC_FEE_TYPE);
27
27
  exports.toDynamicFeeType = toDynamicFeeType;
28
- exports.BILL_PAYMENT_METHOD_CODE = [
29
- 'ach',
30
- 'wire',
31
- 'outside-zeni',
32
- ];
28
+ exports.BILL_PAYMENT_METHOD_CODE = ['ach', 'wire'];
33
29
  const toBillPaymentMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_METHOD_CODE);
34
30
  exports.toBillPaymentMethodCodeType = toBillPaymentMethodCodeType;
35
31
  exports.PAYMENT_ACH_SUB_CODES = ['standard', 'same-day'];
@@ -48,11 +44,6 @@ const BILL_PAYMENT_WIRE_SUB_CODES_KEYS = [
48
44
  'international',
49
45
  ];
50
46
  const toBillPaymentWireSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, BILL_PAYMENT_WIRE_SUB_CODES_KEYS);
51
- exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES = ['outside-zeni'];
52
- const toBillPaymentOutsideZeniSubMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES);
53
- exports.toBillPaymentOutsideZeniSubMethodCodeType = toBillPaymentOutsideZeniSubMethodCodeType;
54
- const BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS = ['outsideZeni'];
55
- const toBillPaymentOutsideZeniSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS);
56
47
  exports.INTERNATIONAL_CODES = [
57
48
  'usd-to-local-currency',
58
49
  'usd-to-usd',
@@ -67,14 +58,9 @@ const toInternationalSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToU
67
58
  const toBillPaymentSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
68
59
  ...PAYMENT_ACH_SUB_CODES_KEYS,
69
60
  ...BILL_PAYMENT_WIRE_SUB_CODES_KEYS,
70
- ...BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS,
71
61
  ]);
72
62
  exports.toBillPaymentSubConfigCodeKeyType = toBillPaymentSubConfigCodeKeyType;
73
- const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
74
- ...exports.PAYMENT_ACH_SUB_CODES,
75
- ...exports.BILL_PAYMENT_WIRE_SUB_CODES,
76
- ...exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES,
77
- ]);
63
+ const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [...exports.PAYMENT_ACH_SUB_CODES, ...exports.BILL_PAYMENT_WIRE_SUB_CODES]);
78
64
  exports.toBillPaymentSubConfigCodeType = toBillPaymentSubConfigCodeType;
79
65
  exports.ACCOUNT_TYPE_CODES = [
80
66
  'deposit_account',
@@ -5,7 +5,7 @@ import { BillPayInfo, BillTransaction } from '../../../../entity/billPay/billTra
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, OutsideZeniPaymentLocalData } from '../editBillView/editBillViewState';
8
+ import { RecurringBillConfigLocalData } from '../editBillView/editBillViewState';
9
9
  import { PaymentDetailsSectionView } from '../editBillView/editBillViewSelector';
10
10
  import { Amount } from '../../../../commonStateTypes/amount';
11
11
  import { BillPayConfig } from '../billPayConfig/billPayConfigState';
@@ -29,7 +29,6 @@ export interface BillPayReviewSelectorView extends SelectorView {
29
29
  recurringBillInstance?: number;
30
30
  recurringConfig?: RecurringBillConfigLocalData;
31
31
  isBillMarkedForRetry?: boolean;
32
- outsideZeniPaymentInfo?: OutsideZeniPaymentLocalData;
33
32
  }
34
33
  export interface DuplicateBillsSelectorView extends SelectorView {
35
34
  bills: BillTransaction[];
@@ -158,7 +158,6 @@ const getReviewPageBillDetail = (state, billId) => {
158
158
  currencyCode: (_u = (_t = sourceBillDetail.billDetailLocalData.recipientTotalAmount) === null || _t === void 0 ? void 0 : _t.currencyCode) !== null && _u !== void 0 ? _u : 'USD',
159
159
  currencySymbol: (_w = (_v = sourceBillDetail.billDetailLocalData.recipientTotalAmount) === null || _v === void 0 ? void 0 : _v.currencySymbol) !== null && _w !== void 0 ? _w : '$',
160
160
  };
161
- const outsideZeniPaymentInfo = sourceBillDetail.billDetailLocalData.outsideZeniPaymentLocalData;
162
161
  return {
163
162
  version: 0,
164
163
  duplicateBillTransactions: bills,
@@ -181,7 +180,6 @@ const getReviewPageBillDetail = (state, billId) => {
181
180
  isBillMarkedForRetry,
182
181
  zeniAssistRetryStatus,
183
182
  billPayInfo,
184
- outsideZeniPaymentInfo,
185
183
  };
186
184
  };
187
185
  exports.getReviewPageBillDetail = getReviewPageBillDetail;
@@ -1,5 +1,5 @@
1
1
  import { ZeniAPIStatus } from '../../../../responsePayload';
2
- import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData, OutsideZeniPaymentLocalData } from './editBillViewState';
2
+ import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData } from './editBillViewState';
3
3
  import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
4
4
  import { InvoiceProcessingPayload } from './editBillViewPayload';
5
5
  import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
@@ -26,10 +26,11 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
26
26
  billId?: string | undefined;
27
27
  }, string>, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
28
28
  billId?: string | undefined;
29
- }, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, billId?: string | undefined], {
29
+ }, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isVendorRecommendationEnabled: boolean, billId?: string | undefined, isLocalCurrencyEnabled?: boolean | undefined], {
30
30
  billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
31
- isForMarkAsPaid: boolean;
31
+ isVendorRecommendationEnabled: boolean;
32
32
  billId: string | undefined;
33
+ isLocalCurrencyEnabled: boolean | undefined;
33
34
  }, string, never, never>, saveBillSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, billId?: string | undefined, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
34
35
  fetchState: FetchState;
35
36
  billId: string | undefined;
@@ -76,11 +77,6 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
76
77
  billId: string | undefined;
77
78
  }, string, never, never>, markBillForRetry: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
78
79
  billId: ID;
79
- }, string>, updateOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
80
- data: OutsideZeniPaymentLocalData;
81
- billId?: string | undefined;
82
- }, string>, discardOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
83
- billId?: string | undefined;
84
80
  }, string>;
85
81
  declare const _default: import("@reduxjs/toolkit").Reducer<EditBillDetailViewState, import("@reduxjs/toolkit").AnyAction>;
86
82
  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.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = 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;
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");
@@ -131,29 +131,6 @@ const editBillView = (0, toolkit_1.createSlice)({
131
131
  delete draft.newBillState.suggestedVendorIdFromParsedInvoice;
132
132
  }
133
133
  },
134
- updateOutsideZeniPaymentLocalData(draft, action) {
135
- const { billId, data } = action.payload;
136
- if (billId != null) {
137
- const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
138
- draft.editBillStateById[key].billDetailLocalData.outsideZeniPaymentLocalData = Object.assign({}, data);
139
- }
140
- else {
141
- draft.newBillState.billDetailLocalData.outsideZeniPaymentLocalData = Object.assign({}, data);
142
- }
143
- },
144
- discardOutsideZeniPaymentLocalData(draft, action) {
145
- const { billId } = action.payload;
146
- if (billId != null) {
147
- const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
148
- delete draft.editBillStateById[key].billDetailLocalData
149
- .outsideZeniPaymentLocalData;
150
- }
151
- else {
152
- draft.newBillState = editBillViewState_1.initialBillDetail;
153
- delete draft.newBillState.billDetailLocalData
154
- .outsideZeniPaymentLocalData;
155
- }
156
- },
157
134
  // Fire this action to save the latest bill data in ZENI Platform.
158
135
  saveBillDetail: {
159
136
  reducer(draft, action) {
@@ -172,12 +149,13 @@ const editBillView = (0, toolkit_1.createSlice)({
172
149
  } });
173
150
  }
174
151
  },
175
- prepare(billStageCode, isForMarkAsPaid, billId) {
152
+ prepare(billStageCode, isVendorRecommendationEnabled, billId, isLocalCurrencyEnabled) {
176
153
  return {
177
154
  payload: {
178
155
  billStageCode,
179
- isForMarkAsPaid,
156
+ isVendorRecommendationEnabled,
180
157
  billId,
158
+ isLocalCurrencyEnabled,
181
159
  },
182
160
  };
183
161
  },
@@ -371,7 +349,7 @@ const editBillView = (0, toolkit_1.createSlice)({
371
349
  },
372
350
  },
373
351
  });
374
- _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, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData;
352
+ _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;
375
353
  exports.default = editBillView.reducer;
376
354
  function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
377
355
  var _a, _b, _c, _d;
@@ -12,7 +12,7 @@ import { ClassListSelectorView } from '../../../classList/classListSelector';
12
12
  import { PreviousBillsSelectorView } from '../previousBills/previousBillsSelector';
13
13
  import { AddBillAutoFields, PaymentDetailsSection, WhatForSection, PaymentModeType, PaymentMode, RecurringBillConfigLocalData, RecurringBillInstance } from './editBillViewState';
14
14
  import { BillActivity } from '../billDetailView/billDetailViewSelector';
15
- import { ApprovalRuleWithUser, BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
15
+ import { BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
16
16
  import { User } from '../../../../entity/user/userState';
17
17
  import { BillPayConfig, BillPayConfigState, AccountTypeSubConfigCodeKeyType } from '../billPayConfig/billPayConfigState';
18
18
  import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
@@ -27,7 +27,6 @@ import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classS
27
27
  import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
28
28
  import { FundingAccount } from '../../commonSetup/setupViewSelector';
29
29
  import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue';
30
- import { LoggedInUser } from '../../../../entity/tenant/tenantState';
31
30
  export declare type PaymentToOption = {
32
31
  id: ID;
33
32
  type: PaymentModeType;
@@ -121,7 +120,7 @@ export interface EditBillInitialDetails {
121
120
  }
122
121
  export declare const getEditBillDetail: (state: RootState, isVendorRecommendationFeatureEnabled: boolean, isZeniAccountsEnabled: boolean, billId?: string | undefined) => EditBillDetailSelectorView;
123
122
  export declare const getBillPayConfigList: (billPayConfigState: BillPayConfigState) => BillPayConfig[];
124
- export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType?: "depositAccount" | "paymentAccount" | undefined, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
123
+ export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType: AccountTypeSubConfigCodeKeyType, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
125
124
  export declare function getWhatForSection(updatedWhatForSection: WhatForSection | undefined): WhatForSection;
126
125
  export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection, companyId?: string, billPayInfo?: BillPayInfo): PaymentDetailsSectionView;
127
126
  export declare function toPaymentToOption(paymentMode: PaymentMode): PaymentToOption;
@@ -149,4 +148,3 @@ export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAc
149
148
  accountId: ID;
150
149
  accountType: AccountTypeSubConfigCodeKeyType;
151
150
  } | undefined) => FundingAccount | undefined;
152
- export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser | undefined) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.checkIfCreatorIsApprover = exports.getDefaultWithdrawFromAccount = exports.getWithdrawFrom = exports.getDueDate = exports.getInvoiceDate = exports.getRecurringBillLocalData = exports.toPaymentToOption = exports.getPaymentSection = exports.getWhatForSection = exports.getPaymentMethodType = exports.getBillPayConfigList = exports.getEditBillDetail = void 0;
6
+ exports.getDefaultWithdrawFromAccount = exports.getWithdrawFrom = exports.getDueDate = exports.getInvoiceDate = exports.getRecurringBillLocalData = exports.toPaymentToOption = exports.getPaymentSection = exports.getWhatForSection = exports.getPaymentMethodType = exports.getBillPayConfigList = exports.getEditBillDetail = void 0;
7
7
  const get_1 = __importDefault(require("lodash/get"));
8
8
  const has_1 = __importDefault(require("lodash/has"));
9
9
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
@@ -406,10 +406,6 @@ const getBillPayConfigList = (billPayConfigState) => {
406
406
  });
407
407
  break;
408
408
  }
409
- case 'outside-zeni': {
410
- billPayConfigState_1.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES.forEach((subCode) => billPayConfigKeys.push((0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentSubConfigCodeKey)(subCode))));
411
- break;
412
- }
413
409
  }
414
410
  });
415
411
  return (0, billPayConfigSelector_1.getBillPayConfigByKeys)(billPayConfigState, billPayConfigKeys);
@@ -459,11 +455,7 @@ function getPaymentSection(state, withdrawFromList, updatedPaymentSection, compa
459
455
  : (0, exports.getWithdrawFrom)(state, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountId, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType, companyId !== null && companyId !== void 0 ? companyId : '', state.billPayConfigState.lastSelectedFromAccount);
460
456
  const withdrawFromAccountingName = undefined;
461
457
  const availablePaymentOptions = state.billPayConfigState.fetchState === 'Completed'
462
- ? (0, exports.getBillPayConfigList)(state.billPayConfigState).filter((option) => {
463
- var _a;
464
- return (0, helpers_1.isPaymentMethodOutsideZeni)(option.method) ||
465
- option.method.includes((_a = withdrawFrom === null || withdrawFrom === void 0 ? void 0 : withdrawFrom.accType) !== null && _a !== void 0 ? _a : '');
466
- })
458
+ ? (0, exports.getBillPayConfigList)(state.billPayConfigState).filter((option) => { var _a; return option.method.includes((_a = withdrawFrom === null || withdrawFrom === void 0 ? void 0 : withdrawFrom.accType) !== null && _a !== void 0 ? _a : ''); })
467
459
  : [];
468
460
  const isSinglePaymentTypeOption = availablePaymentOptions.length === 1;
469
461
  return {
@@ -672,26 +664,3 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
672
664
  return undefined;
673
665
  };
674
666
  exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
675
- const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
676
- let isCreatorAlsoApprover = false;
677
- const approvalRule = approvalRules.find((rule) => {
678
- const { max, min } = rule.criteria[0].range;
679
- return (billAmount > min.amount &&
680
- ((max === null || max === void 0 ? void 0 : max.amount) != null ? billAmount <= (max === null || max === void 0 ? void 0 : max.amount) : true));
681
- });
682
- if (approvalRule != null) {
683
- const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
684
- if (requireApprovalSteps.length === 1) {
685
- const requiredStep = requireApprovalSteps[0];
686
- const stepOperator = requiredStep.operator;
687
- if (stepOperator === 'or' || stepOperator === 'is') {
688
- const approvers = requiredStep.actors;
689
- if (approvers.some((user) => user.userId === (signedInUser === null || signedInUser === void 0 ? void 0 : signedInUser.userId))) {
690
- isCreatorAlsoApprover = true;
691
- }
692
- }
693
- }
694
- }
695
- return isCreatorAlsoApprover;
696
- };
697
- exports.checkIfCreatorIsApprover = checkIfCreatorIsApprover;
@@ -7,7 +7,7 @@ import { Vendor } from '../../../../entity/vendor/vendorState';
7
7
  import { ZeniDate } from '../../../../zeniDayJS';
8
8
  import { BillTransactionDetailKey } from '../billDetailView/billDetailViewState';
9
9
  import { LineItemOnlyRecommendationsLocalData, LineItemRecommendationsLocalData } from './editBillViewSelector';
10
- import { InternationalTransferFeeBearerPaymentMethod, BillStage, OutsideZeniPaymentModeType } from '../../../../entity/billPay/billTransaction/billTransactionState';
10
+ import { InternationalTransferFeeBearerPaymentMethod, BillStage } from '../../../../entity/billPay/billTransaction/billTransactionState';
11
11
  import { PaymentInstrument } from '../../../../entity/paymentInstrument/paymentInstrument';
12
12
  import { BankAccount } from '../../../../entity/bankAccount/bankAccount';
13
13
  import { Contact } from '../../../../entity/billPay/contact/contact';
@@ -66,7 +66,6 @@ export interface BillDetailLocalData {
66
66
  isRecurring: boolean;
67
67
  recurringConfig?: RecurringBillConfigLocalData;
68
68
  recurringBillInstances?: RecurringBillInstance[];
69
- outsideZeniPaymentLocalData?: OutsideZeniPaymentLocalData;
70
69
  }
71
70
  export interface WhatForSection {
72
71
  invoiceNumber?: string;
@@ -112,8 +111,4 @@ export interface RecurringBillConfigLocalData {
112
111
  isActive: boolean;
113
112
  updateRecurringBills?: EditRecurringBillType;
114
113
  }
115
- export interface OutsideZeniPaymentLocalData {
116
- paymentMode?: OutsideZeniPaymentModeType;
117
- paymentDate?: ZeniDate;
118
- }
119
114
  export {};
@@ -17,7 +17,6 @@ const classListSelector_1 = require("../../../../classList/classListSelector");
17
17
  const workingDayHelper_1 = require("../../../../../commonStateTypes/workingDayHelper");
18
18
  const zeniDayJS_1 = require("../../../../../zeniDayJS");
19
19
  const companySelector_1 = require("../../../../../entity/company/companySelector");
20
- const helpers_1 = require("../../../helpers");
21
20
  const isClassRecommendation = (recommendations, classObj) => {
22
21
  if (classObj == null) {
23
22
  return false;
@@ -91,7 +90,7 @@ const getLineRecommendationsLocalData = (lineId, line, recommendations, accountL
91
90
  };
92
91
  exports.getLineRecommendationsLocalData = getLineRecommendationsLocalData;
93
92
  const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.initializeBillToLocalStore.match), (0, operators_1.mergeMap)((action) => {
94
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
93
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
95
94
  const { billId } = action.payload;
96
95
  const state = state$.value;
97
96
  const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
@@ -159,12 +158,10 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
159
158
  const isPayNowEnabled = payNowCutOffTime != null
160
159
  ? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
161
160
  : false;
162
- const paymentDate = (_h = transaction.billPayInfo.paymentDate) !== null && _h !== void 0 ? _h : (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString());
163
161
  const paymentDetailsSection = {
164
- paymentType: (0, editBillViewSelector_1.getPaymentMethodType)(state.billPayConfigState, transaction.billPayInfo.fromAccount.billAccountType, //Check default conditions if any
165
- transaction.billPayInfo.billPaymentMethodType, transaction.billPayInfo.internationalTransferFeeBearerPaymentMethod),
166
- paymentDate,
167
- withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_j = transaction.billPayInfo.fromAccount.billAccountId) !== null && _j !== void 0 ? _j : '', (_k = transaction.billPayInfo.fromAccount.billAccountType) !== null && _k !== void 0 ? _k : '', companyId),
162
+ paymentType: (0, editBillViewSelector_1.getPaymentMethodType)(state.billPayConfigState, (_h = transaction.billPayInfo.fromAccount.billAccountType) !== null && _h !== void 0 ? _h : 'depositAccount', transaction.billPayInfo.billPaymentMethodType, transaction.billPayInfo.internationalTransferFeeBearerPaymentMethod),
163
+ paymentDate: (_j = transaction.billPayInfo.paymentDate) !== null && _j !== void 0 ? _j : (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()),
164
+ withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_k = transaction.billPayInfo.fromAccount.billAccountId) !== null && _k !== void 0 ? _k : '', (_l = transaction.billPayInfo.fromAccount.billAccountType) !== null && _l !== void 0 ? _l : '', companyId),
168
165
  paymentTo: transaction.billPayInfo.toAccount.billAccountId != null &&
169
166
  transaction.billPayInfo.toAccount.billAccountId.length > 0
170
167
  ? transaction.billPayInfo.toAccount.billAccountId
@@ -174,7 +171,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
174
171
  const totalAmount = transaction.amount;
175
172
  const recipientTotalAmount = transaction.recipientTotalAmount;
176
173
  const isCancelled = transaction.billPayInfo.isCancelled;
177
- const file = (_l = transaction.attachments) === null || _l === void 0 ? void 0 : _l[0];
174
+ const file = (_m = transaction.attachments) === null || _m === void 0 ? void 0 : _m[0];
178
175
  const candidateVendorname = transaction.candidateVendorName;
179
176
  const toAccountVendorEmail = transaction.billPayInfo.toAccountVendorEmail;
180
177
  const isCollectToAccountInfoFromVendorContact = transaction.billPayInfo.isCollectToAccountInfoFromVendorContact;
@@ -186,13 +183,6 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
186
183
  recurringConfig = recurringConfigLocalData;
187
184
  recurringBillInstances = recurringBillInstancesLocalData;
188
185
  }
189
- const isPaymentOutsideZeni = (0, helpers_1.isPaymentMethodOutsideZeni)(transaction.billPayInfo.billPaymentMethodType.code);
190
- const outsideZeniPaymentLocalData = isPaymentOutsideZeni
191
- ? {
192
- paymentMode: transaction.billPayInfo.outsideZeniTransactionPaymentMode,
193
- paymentDate: transaction.billPayInfo.paymentDate,
194
- }
195
- : undefined;
196
186
  const billDetailLocalData = {
197
187
  showVendorGptRecommendationText: false,
198
188
  vendor,
@@ -209,7 +199,6 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
209
199
  isRecurring,
210
200
  recurringConfig,
211
201
  recurringBillInstances,
212
- outsideZeniPaymentLocalData,
213
202
  };
214
203
  const actions = [
215
204
  (0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({ billDetailLocalData, billId }),
@@ -28,7 +28,6 @@ const billPayConfigPayload_1 = require("../../billPayConfig/billPayConfigPayload
28
28
  const billTransactionState_1 = require("../../../../../entity/billPay/billTransaction/billTransactionState");
29
29
  const workingDayHelper_1 = require("../../../../../commonStateTypes/workingDayHelper");
30
30
  const companySelector_1 = require("../../../../../entity/company/companySelector");
31
- const helpers_1 = require("../../../helpers");
32
31
  const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.parseInvoiceToBill.match), (0, operators_1.mergeMap)((action) => {
33
32
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
34
33
  const { invoiceProcessingPayload, isVendorRecommendationFeatureEnabled } = action.payload;
@@ -145,7 +144,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
145
144
  }));
146
145
  exports.parseInvoiceToBillEpic = parseInvoiceToBillEpic;
147
146
  const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPayload, vendor, recommendedVendorId) => {
148
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
147
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
149
148
  const currency = {
150
149
  currencyCode: (_a = billPayload.recipient_currency_code) !== null && _a !== void 0 ? _a : '',
151
150
  currencySymbol: (_b = billPayload.recipient_currency_symbol) !== null && _b !== void 0 ? _b : '', //api not returning symbol
@@ -226,18 +225,6 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
226
225
  ? (0, billPayConfigPayload_1.getInternationalSubConfigCodeKey)(internationalSubCode)
227
226
  : undefined))
228
227
  : undefined;
229
- const isPaymentOutsideZeni = (0, helpers_1.isPaymentMethodOutsideZeni)(paymentMethodCode !== null && paymentMethodCode !== void 0 ? paymentMethodCode : '');
230
- const outsideZeniPaymentMode = (_o = billPayload.bill_pay_info) === null || _o === void 0 ? void 0 : _o.outside_zeni_transaction_payment_mode;
231
- const outsideZeniPaymentLocalData = isPaymentOutsideZeni
232
- ? {
233
- paymentMode: outsideZeniPaymentMode != null
234
- ? (0, billTransactionState_1.toOutsideZeniPaymentModeType)(outsideZeniPaymentMode)
235
- : undefined,
236
- paymentDate: ((_p = billPayload.bill_pay_info) === null || _p === void 0 ? void 0 : _p.payment_date) != null
237
- ? (0, zeniDayJS_1.date)((_q = billPayload.bill_pay_info) === null || _q === void 0 ? void 0 : _q.payment_date)
238
- : undefined,
239
- }
240
- : undefined;
241
228
  return {
242
229
  recommendedVendorId,
243
230
  showVendorGptRecommendationText,
@@ -258,31 +245,30 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
258
245
  paymentDetailsSection: {
259
246
  paymentTo: undefined,
260
247
  paymentType: paymentType,
261
- paymentDate: ((_r = billPayload.bill_pay_info) === null || _r === void 0 ? void 0 : _r.payment_date) != null
262
- ? (0, zeniDayJS_1.date)((_s = billPayload.bill_pay_info) === null || _s === void 0 ? void 0 : _s.payment_date)
248
+ paymentDate: ((_o = billPayload.bill_pay_info) === null || _o === void 0 ? void 0 : _o.payment_date) != null
249
+ ? (0, zeniDayJS_1.date)((_p = billPayload.bill_pay_info) === null || _p === void 0 ? void 0 : _p.payment_date)
263
250
  : (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()),
264
- withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_u = (_t = billPayload.bill_pay_info) === null || _t === void 0 ? void 0 : _t.from_account.account_id) !== null && _u !== void 0 ? _u : '', (_w = (_v = billPayload.bill_pay_info) === null || _v === void 0 ? void 0 : _v.from_account.account_type) !== null && _w !== void 0 ? _w : ''),
265
- internationalTransferFeeBearerPaymentMethod: ((_x = billPayload.bill_pay_info) === null || _x === void 0 ? void 0 : _x.international_transfer_fee_bearer_payment_method) != null
266
- ? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)((_y = billPayload.bill_pay_info) === null || _y === void 0 ? void 0 : _y.international_transfer_fee_bearer_payment_method)
251
+ withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_r = (_q = billPayload.bill_pay_info) === null || _q === void 0 ? void 0 : _q.from_account.account_id) !== null && _r !== void 0 ? _r : '', (_t = (_s = billPayload.bill_pay_info) === null || _s === void 0 ? void 0 : _s.from_account.account_type) !== null && _t !== void 0 ? _t : ''),
252
+ internationalTransferFeeBearerPaymentMethod: ((_u = billPayload.bill_pay_info) === null || _u === void 0 ? void 0 : _u.international_transfer_fee_bearer_payment_method) != null
253
+ ? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)((_v = billPayload.bill_pay_info) === null || _v === void 0 ? void 0 : _v.international_transfer_fee_bearer_payment_method)
267
254
  : undefined,
268
255
  },
269
256
  totalAmount: billPayload.amount != null
270
257
  ? (0, amount_1.toAmountWC)(billPayload.amount, {
271
- currencyCode: (_z = billPayload.currency_code) !== null && _z !== void 0 ? _z : 'USD',
272
- currencySymbol: (_0 = billPayload.currency_symbol) !== null && _0 !== void 0 ? _0 : '$',
258
+ currencyCode: (_w = billPayload.currency_code) !== null && _w !== void 0 ? _w : 'USD',
259
+ currencySymbol: (_x = billPayload.currency_symbol) !== null && _x !== void 0 ? _x : '$',
273
260
  })
274
261
  : undefined,
275
262
  recipientTotalAmount: billPayload.recipient_total_amount != null
276
263
  ? (0, amount_1.toAmountWC)(billPayload.recipient_total_amount, {
277
- currencyCode: (_1 = billPayload.recipient_currency_code) !== null && _1 !== void 0 ? _1 : 'USD',
278
- currencySymbol: (_2 = billPayload.recipient_currency_symbol) !== null && _2 !== void 0 ? _2 : '$',
264
+ currencyCode: (_y = billPayload.recipient_currency_code) !== null && _y !== void 0 ? _y : 'USD',
265
+ currencySymbol: (_z = billPayload.recipient_currency_symbol) !== null && _z !== void 0 ? _z : '$',
279
266
  })
280
267
  : undefined,
281
268
  isCancelled: false,
282
- toAccountVendorEmail: (_4 = (_3 = billPayload.bill_pay_info) === null || _3 === void 0 ? void 0 : _3.to_account_vendor_email) !== null && _4 !== void 0 ? _4 : undefined,
283
- isCollectToAccountInfoFromVendorContact: (_6 = (_5 = billPayload.bill_pay_info) === null || _5 === void 0 ? void 0 : _5.is_collect_to_account_info_from_vendor_contact) !== null && _6 !== void 0 ? _6 : false,
284
- isRecurring: (_7 = billPayload.is_recurring) !== null && _7 !== void 0 ? _7 : false,
285
- outsideZeniPaymentLocalData,
269
+ toAccountVendorEmail: (_1 = (_0 = billPayload.bill_pay_info) === null || _0 === void 0 ? void 0 : _0.to_account_vendor_email) !== null && _1 !== void 0 ? _1 : undefined,
270
+ isCollectToAccountInfoFromVendorContact: (_3 = (_2 = billPayload.bill_pay_info) === null || _2 === void 0 ? void 0 : _2.is_collect_to_account_info_from_vendor_contact) !== null && _3 !== void 0 ? _3 : false,
271
+ isRecurring: (_4 = billPayload.is_recurring) !== null && _4 !== void 0 ? _4 : false,
286
272
  };
287
273
  };
288
274
  exports.toBillDetailLocalData = toBillDetailLocalData;