@zeniai/client-epic-state 4.14.6 → 4.14.7

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 (50) hide show
  1. package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +1 -0
  2. package/lib/entity/billPay/billTransaction/billTransactionPayload.js +3 -0
  3. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +6 -3
  4. package/lib/entity/billPay/billTransaction/billTransactionState.js +18 -1
  5. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  6. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  7. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  8. package/lib/index.d.ts +9 -9
  9. package/lib/index.js +22 -14
  10. package/lib/view/bankAccountView/bankAccountViewReducer.d.ts +2 -2
  11. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  12. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  13. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  14. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  15. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  16. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  17. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  18. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  19. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  20. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  21. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +5 -1
  22. package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +22 -6
  23. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  24. package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +3 -2
  25. package/lib/view/spendManagement/billPay/billList/billListSelector.js +54 -17
  26. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  27. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  28. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +7 -2
  29. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +18 -6
  30. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +6 -0
  31. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +9 -4
  32. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +18 -4
  33. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +2 -1
  34. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -0
  35. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +8 -4
  36. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +27 -5
  37. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -2
  38. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +33 -2
  39. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +6 -1
  40. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +16 -5
  41. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +27 -13
  42. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +7 -3
  43. package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +48 -28
  44. package/lib/view/spendManagement/billPay/magicLinkView/magicLinkViewReducer.d.ts +2 -2
  45. package/lib/view/spendManagement/helpers.d.ts +2 -0
  46. package/lib/view/spendManagement/helpers.js +9 -1
  47. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  48. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  49. package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.d.ts +1 -1
  50. package/package.json +1 -1
@@ -3,13 +3,14 @@ import { Currency } from '../../../../commonStateTypes/amount';
3
3
  import { AccountBasePayload } from '../../../../entity/account/accountPayload';
4
4
  import { ClassBasePayload } from '../../../../entity/class/classPayload';
5
5
  import { ZeniAPIResponse } from '../../../../responsePayload';
6
- import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, VendorCurrency, PaymentAchSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, AccountTypeSubConfigCodeKeyType, AccType } from './billPayConfigState';
6
+ import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, VendorCurrency, PaymentAchSubConfigCodeType, BillPaymentOutsideZeniSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, AccountTypeSubConfigCodeKeyType, AccType } from './billPayConfigState';
7
7
  export interface BillPayConfigPayload {
8
8
  bill_pay_bot_email: string;
9
9
  is_us_domestic_wire_enabled: boolean;
10
10
  is_same_day_ach_enabled: boolean;
11
11
  is_international_wire_enabled: boolean;
12
12
  is_international_wires_verified: boolean;
13
+ is_outside_zeni_payment_enabled: boolean;
13
14
  payment_processor: BillPayConfigPaymentProcessorPayload;
14
15
  max_bills_allowed_for_bulk_action: number;
15
16
  required_fields: {
@@ -46,15 +47,18 @@ interface CountryPayload {
46
47
  }
47
48
  interface PaymentTimeline {
48
49
  ach: Record<PaymentAchSubConfigCodeType, ConfigTimelineForAccTypePayload>;
50
+ 'outside-zeni': Record<BillPaymentOutsideZeniSubConfigCodeType, ConfigTimelineForAccTypePayload>;
49
51
  wire: Record<BillPaymentWireSubConfigCodeType, ConfigTimelineForAccTypePayload>;
50
52
  }
51
53
  interface ClassConfig {
52
54
  ach: Record<PaymentAchSubConfigCodeType, ClassBasePayload>;
53
55
  wire: Record<BillPaymentWireSubConfigCodeType, ClassBasePayload>;
56
+ 'outside-zeni': Record<BillPaymentOutsideZeniSubConfigCodeType, ClassBasePayload>;
54
57
  }
55
58
  interface AccountConfig {
56
59
  ach: Record<PaymentAchSubConfigCodeType, AccountBasePayload>;
57
60
  wire: Record<BillPaymentWireSubConfigCodeType, AccountBasePayload>;
61
+ 'outside-zeni': Record<BillPaymentOutsideZeniSubConfigCodeType, AccountBasePayload>;
58
62
  }
59
63
  interface BillPayConfigPaymentProcessorPayload {
60
64
  payment_timeline: PaymentTimeline;
@@ -73,6 +77,7 @@ interface WireConfig {
73
77
  interface FeesConfig {
74
78
  ach: Record<PaymentAchSubConfigCodeType, BillPayConfigFeeForAccTypePayload>;
75
79
  wire: WireConfig;
80
+ 'outside-zeni': Record<BillPaymentOutsideZeniSubConfigCodeType, BillPayConfigFeeForAccTypePayload>;
76
81
  }
77
82
  declare type BillPayConfigFeeForAccTypePayload = Record<AccType, BillPayConfigFeePayload>;
78
83
  interface BillPayConfigFeePayload {
@@ -101,7 +106,7 @@ export declare const getBillPaymentWireSubConfigCodeKey: (subCode: BillPaymentWi
101
106
  export declare const getInternationalSubConfigCodeKey: (subCode: InternationalSubConfigCodeType) => InternationalSubConfigCodeKeyType;
102
107
  export declare const getInternationalWireMethodCodeKey: (subCode: InternationalWireMethodCodeType) => InternationalWireMethodCodeKeyType;
103
108
  export declare const getAccountTypeSubConfigCodeKey: (subCode: AccType) => AccountTypeSubConfigCodeKeyType;
104
- export declare const mapBillPayConfigPayloadToBillPayConfig: (paymentProcessor: BillPayConfigPaymentProcessorPayload, isEnabled: boolean, isVerified: boolean, code: BillPaymentConfigCodeType, subCode: BillPaymentSubConfigCodeType, accType: AccType, internationalMethod?: "usd-to-local-currency" | "usd-to-usd" | undefined, internationalSubMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig;
109
+ export declare const mapBillPayConfigPayloadToBillPayConfig: (paymentProcessor: BillPayConfigPaymentProcessorPayload, isEnabled: boolean, isVerified: boolean, code: BillPaymentConfigCodeType, subCode: BillPaymentSubConfigCodeType, accType?: "deposit_account" | "payment_account" | undefined, internationalMethod?: "usd-to-local-currency" | "usd-to-usd" | undefined, internationalSubMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig;
105
110
  export declare const mapBillPayVendorConfigPayloadToBillPayVendorConfig: (payload: BillPayConfigPayload, code: BillPaymentConfigCodeType, subCode: BillPaymentSubConfigCodeType) => Currency[];
106
111
  export declare const toVendorCurrency: (payload: VendorCurrencyPayload) => VendorCurrency;
107
112
  export declare type BillPayConfigResponse = ZeniAPIResponse<BillPayConfigPayload>;
@@ -11,6 +11,8 @@ const getSubCodePayload = (subCode) => {
11
11
  return 'same-day';
12
12
  case 'usDomestic':
13
13
  return 'us-domestic';
14
+ case 'outsideZeni':
15
+ return 'outside-zeni';
14
16
  default:
15
17
  return subCode;
16
18
  }
@@ -22,6 +24,8 @@ const getBillPaymentSubConfigCodeKey = (subCode) => {
22
24
  return 'sameDay';
23
25
  case 'us-domestic':
24
26
  return 'usDomestic';
27
+ case 'outside-zeni':
28
+ return 'outsideZeni';
25
29
  default:
26
30
  return subCode;
27
31
  }
@@ -80,7 +84,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
80
84
  };
81
85
  let description = '';
82
86
  let internationalFee;
83
- if (code === 'ach') {
87
+ if (code === 'ach' && accType != null) {
84
88
  feeAmount = {
85
89
  amount: fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType].amount,
86
90
  currencyCode: fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
@@ -91,7 +95,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
91
95
  description =
92
96
  fees[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType].description;
93
97
  }
94
- else if (subCode === 'international') {
98
+ else if (subCode === 'international' && accType != null) {
95
99
  if (internationalMethod === 'usd-to-local-currency') {
96
100
  feeAmount = {
97
101
  amount: fees.wire[subCode][accType][internationalMethod].amount,
@@ -115,7 +119,7 @@ const getFeeDetail = (fees, code, subCode, accType, internationalMethod, interna
115
119
  .description;
116
120
  }
117
121
  }
118
- else if (subCode === 'us-domestic') {
122
+ else if (subCode === 'us-domestic' && accType != null) {
119
123
  feeAmount = {
120
124
  amount: fees.wire[subCode][accType].amount,
121
125
  currencyCode: fees.wire[subCode][accType].currency_code,
@@ -134,7 +138,7 @@ const getTimelineDetail = (paymentTimeline, code, subCode, accType) => {
134
138
  value: 0,
135
139
  units: 'days',
136
140
  };
137
- if (code === 'ach') {
141
+ if (code === 'ach' && accType != null) {
138
142
  minPeriod = {
139
143
  value: paymentTimeline[code][(0, billPayConfigState_1.toPaymentAchSubMethodCodeType)(subCode)][accType]
140
144
  .min.value,
@@ -148,7 +152,7 @@ const getTimelineDetail = (paymentTimeline, code, subCode, accType) => {
148
152
  .max.units,
149
153
  };
150
154
  }
151
- else if (code === 'wire') {
155
+ else if (code === 'wire' && accType != null) {
152
156
  minPeriod = {
153
157
  value: paymentTimeline[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)][accType].min.value,
154
158
  units: paymentTimeline[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)][accType].min.units,
@@ -173,6 +177,10 @@ const getAccountDetail = (account, code, subCode) => {
173
177
  accountBasePayload =
174
178
  account[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)];
175
179
  }
180
+ else if (code === 'outside-zeni') {
181
+ accountBasePayload =
182
+ account['outside-zeni'][(0, billPayConfigState_1.toBillPaymentOutsideZeniSubMethodCodeType)(subCode)];
183
+ }
176
184
  return accountBasePayload;
177
185
  };
178
186
  const getClassDetail = (classConfig, code, subCode) => {
@@ -188,6 +196,10 @@ const getClassDetail = (classConfig, code, subCode) => {
188
196
  classBasePayload =
189
197
  classConfig[code][(0, billPayConfigState_1.toBillPaymentWireSubMethodCodeType)(subCode)];
190
198
  }
199
+ else if (code === 'outside-zeni') {
200
+ classBasePayload =
201
+ classConfig['outside-zeni'][(0, billPayConfigState_1.toBillPaymentOutsideZeniSubMethodCodeType)(subCode)];
202
+ }
191
203
  return classBasePayload;
192
204
  };
193
205
  const mapBillPayConfigPayloadToBillPayConfig = (paymentProcessor, isEnabled, isVerified, code, subCode, accType, internationalMethod, internationalSubMethod) => {
@@ -197,7 +209,7 @@ const mapBillPayConfigPayloadToBillPayConfig = (paymentProcessor, isEnabled, isV
197
209
  return {
198
210
  minPeriod: minPeriod,
199
211
  maxPeriod: maxPeriod,
200
- method: (0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigState_1.toBillPaymentSubConfigCodeKeyType)((0, exports.getBillPaymentSubConfigCodeKey)(subCode)), (0, exports.getAccountTypeSubConfigCodeKey)(accType), internationalMethod != null
212
+ method: (0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigState_1.toBillPaymentSubConfigCodeKeyType)((0, exports.getBillPaymentSubConfigCodeKey)(subCode)), accType != null ? (0, exports.getAccountTypeSubConfigCodeKey)(accType) : undefined, internationalMethod != null
201
213
  ? (0, exports.getInternationalWireMethodCodeKey)(internationalMethod)
202
214
  : undefined, internationalSubMethod != null
203
215
  ? (0, exports.getInternationalSubConfigCodeKey)(internationalSubMethod)
@@ -84,6 +84,12 @@ 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
+ }
87
93
  }
88
94
  });
89
95
  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"];
54
- export declare const toBillPaymentMethodCodeType: (v: string) => "ach" | "wire";
53
+ export declare const BILL_PAYMENT_METHOD_CODE: readonly ["ach", "wire", "outside-zeni"];
54
+ export declare const toBillPaymentMethodCodeType: (v: string) => "ach" | "wire" | "outside-zeni";
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,6 +63,11 @@ 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>;
66
71
  export declare const INTERNATIONAL_CODES: readonly ["usd-to-local-currency", "usd-to-usd"];
67
72
  declare const toInternationalWireMethodCodeType: (v: string) => "usd-to-local-currency" | "usd-to-usd";
68
73
  export declare type InternationalWireMethodCodeType = ReturnType<typeof toInternationalWireMethodCodeType>;
@@ -73,8 +78,8 @@ declare const toInternationalSubMethodCodeType: (v: string) => "swift_our" | "sw
73
78
  export declare type InternationalSubConfigCodeType = ReturnType<typeof toInternationalSubMethodCodeType>;
74
79
  declare const toInternationalSubMethodCodeKeyType: (v: string) => "swiftOur" | "swiftSha";
75
80
  export declare type InternationalSubConfigCodeKeyType = ReturnType<typeof toInternationalSubMethodCodeKeyType>;
76
- export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType | BillPaymentWireSubConfigCodeType;
77
- export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType;
81
+ export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType | BillPaymentWireSubConfigCodeType | BillPaymentOutsideZeniSubConfigCodeType;
82
+ export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType | BillPaymentOutsideZeniSubMethodCodeKeyType;
78
83
  export declare const toBillPaymentSubConfigCodeKeyType: (v: string) => BillPaymentSubConfigCodeKeyType;
79
84
  export declare const toBillPaymentSubConfigCodeType: (v: string) => BillPaymentSubConfigCodeType;
80
85
  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.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.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;
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 (accType != null) {
13
+ if (method !== 'outside-zeni' && accType != null) {
14
14
  keys.push(accType);
15
15
  }
16
16
  if (internationalMethod != null) {
@@ -25,7 +25,11 @@ 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 = ['ach', 'wire'];
28
+ exports.BILL_PAYMENT_METHOD_CODE = [
29
+ 'ach',
30
+ 'wire',
31
+ 'outside-zeni',
32
+ ];
29
33
  const toBillPaymentMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_METHOD_CODE);
30
34
  exports.toBillPaymentMethodCodeType = toBillPaymentMethodCodeType;
31
35
  exports.PAYMENT_ACH_SUB_CODES = ['standard', 'same-day'];
@@ -44,6 +48,11 @@ const BILL_PAYMENT_WIRE_SUB_CODES_KEYS = [
44
48
  'international',
45
49
  ];
46
50
  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);
47
56
  exports.INTERNATIONAL_CODES = [
48
57
  'usd-to-local-currency',
49
58
  'usd-to-usd',
@@ -58,9 +67,14 @@ const toInternationalSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToU
58
67
  const toBillPaymentSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
59
68
  ...PAYMENT_ACH_SUB_CODES_KEYS,
60
69
  ...BILL_PAYMENT_WIRE_SUB_CODES_KEYS,
70
+ ...BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS,
61
71
  ]);
62
72
  exports.toBillPaymentSubConfigCodeKeyType = toBillPaymentSubConfigCodeKeyType;
63
- const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [...exports.PAYMENT_ACH_SUB_CODES, ...exports.BILL_PAYMENT_WIRE_SUB_CODES]);
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
+ ]);
64
78
  exports.toBillPaymentSubConfigCodeType = toBillPaymentSubConfigCodeType;
65
79
  exports.ACCOUNT_TYPE_CODES = [
66
80
  '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 } from '../editBillView/editBillViewState';
8
+ import { RecurringBillConfigLocalData, OutsideZeniPaymentLocalData } 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,6 +29,7 @@ export interface BillPayReviewSelectorView extends SelectorView {
29
29
  recurringBillInstance?: number;
30
30
  recurringConfig?: RecurringBillConfigLocalData;
31
31
  isBillMarkedForRetry?: boolean;
32
+ outsideZeniPaymentInfo?: OutsideZeniPaymentLocalData;
32
33
  }
33
34
  export interface DuplicateBillsSelectorView extends SelectorView {
34
35
  bills: BillTransaction[];
@@ -158,6 +158,7 @@ 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;
161
162
  return {
162
163
  version: 0,
163
164
  duplicateBillTransactions: bills,
@@ -180,6 +181,7 @@ const getReviewPageBillDetail = (state, billId) => {
180
181
  isBillMarkedForRetry,
181
182
  zeniAssistRetryStatus,
182
183
  billPayInfo,
184
+ outsideZeniPaymentInfo,
183
185
  };
184
186
  };
185
187
  exports.getReviewPageBillDetail = getReviewPageBillDetail;
@@ -1,5 +1,5 @@
1
1
  import { ZeniAPIStatus } from '../../../../responsePayload';
2
- import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData } from './editBillViewState';
2
+ import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData, OutsideZeniPaymentLocalData } 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,11 +26,10 @@ 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", isVendorRecommendationEnabled: boolean, billId?: string | undefined, isLocalCurrencyEnabled?: boolean | undefined], {
29
+ }, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, billId?: string | undefined], {
30
30
  billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
31
- isVendorRecommendationEnabled: boolean;
31
+ isForMarkAsPaid: boolean;
32
32
  billId: string | undefined;
33
- isLocalCurrencyEnabled: boolean | undefined;
34
33
  }, string, never, never>, saveBillSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, billId?: string | undefined, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
35
34
  fetchState: FetchState;
36
35
  billId: string | undefined;
@@ -77,6 +76,11 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
77
76
  billId: string | undefined;
78
77
  }, string, never, never>, markBillForRetry: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
79
78
  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;
80
84
  }, string>;
81
85
  declare const _default: import("@reduxjs/toolkit").Reducer<EditBillDetailViewState, import("@reduxjs/toolkit").AnyAction>;
82
86
  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.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.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;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const editBillViewState_1 = require("./editBillViewState");
7
7
  const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
@@ -131,6 +131,29 @@ 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
+ },
134
157
  // Fire this action to save the latest bill data in ZENI Platform.
135
158
  saveBillDetail: {
136
159
  reducer(draft, action) {
@@ -149,13 +172,12 @@ const editBillView = (0, toolkit_1.createSlice)({
149
172
  } });
150
173
  }
151
174
  },
152
- prepare(billStageCode, isVendorRecommendationEnabled, billId, isLocalCurrencyEnabled) {
175
+ prepare(billStageCode, isForMarkAsPaid, billId) {
153
176
  return {
154
177
  payload: {
155
178
  billStageCode,
156
- isVendorRecommendationEnabled,
179
+ isForMarkAsPaid,
157
180
  billId,
158
- isLocalCurrencyEnabled,
159
181
  },
160
182
  };
161
183
  },
@@ -349,7 +371,7 @@ const editBillView = (0, toolkit_1.createSlice)({
349
371
  },
350
372
  },
351
373
  });
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;
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;
353
375
  exports.default = editBillView.reducer;
354
376
  function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
355
377
  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 { BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
15
+ import { ApprovalRuleWithUser, 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,6 +27,7 @@ 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';
30
31
  export declare type PaymentToOption = {
31
32
  id: ID;
32
33
  type: PaymentModeType;
@@ -120,7 +121,7 @@ export interface EditBillInitialDetails {
120
121
  }
121
122
  export declare const getEditBillDetail: (state: RootState, isVendorRecommendationFeatureEnabled: boolean, isZeniAccountsEnabled: boolean, billId?: string | undefined) => EditBillDetailSelectorView;
122
123
  export declare const getBillPayConfigList: (billPayConfigState: BillPayConfigState) => BillPayConfig[];
123
- export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType: AccountTypeSubConfigCodeKeyType, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
124
+ export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType?: "depositAccount" | "paymentAccount" | undefined, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
124
125
  export declare function getWhatForSection(updatedWhatForSection: WhatForSection | undefined): WhatForSection;
125
126
  export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection, companyId?: string, billPayInfo?: BillPayInfo): PaymentDetailsSectionView;
126
127
  export declare function toPaymentToOption(paymentMode: PaymentMode): PaymentToOption;
@@ -148,3 +149,4 @@ export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAc
148
149
  accountId: ID;
149
150
  accountType: AccountTypeSubConfigCodeKeyType;
150
151
  } | 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.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.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;
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,6 +406,10 @@ 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
+ }
409
413
  }
410
414
  });
411
415
  return (0, billPayConfigSelector_1.getBillPayConfigByKeys)(billPayConfigState, billPayConfigKeys);
@@ -455,7 +459,11 @@ function getPaymentSection(state, withdrawFromList, updatedPaymentSection, compa
455
459
  : (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);
456
460
  const withdrawFromAccountingName = undefined;
457
461
  const availablePaymentOptions = state.billPayConfigState.fetchState === 'Completed'
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 : ''); })
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
+ })
459
467
  : [];
460
468
  const isSinglePaymentTypeOption = availablePaymentOptions.length === 1;
461
469
  return {
@@ -664,3 +672,26 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
664
672
  return undefined;
665
673
  };
666
674
  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 } from '../../../../entity/billPay/billTransaction/billTransactionState';
10
+ import { InternationalTransferFeeBearerPaymentMethod, BillStage, OutsideZeniPaymentModeType } 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,6 +66,7 @@ export interface BillDetailLocalData {
66
66
  isRecurring: boolean;
67
67
  recurringConfig?: RecurringBillConfigLocalData;
68
68
  recurringBillInstances?: RecurringBillInstance[];
69
+ outsideZeniPaymentLocalData?: OutsideZeniPaymentLocalData;
69
70
  }
70
71
  export interface WhatForSection {
71
72
  invoiceNumber?: string;
@@ -111,4 +112,8 @@ export interface RecurringBillConfigLocalData {
111
112
  isActive: boolean;
112
113
  updateRecurringBills?: EditRecurringBillType;
113
114
  }
115
+ export interface OutsideZeniPaymentLocalData {
116
+ paymentMode?: OutsideZeniPaymentModeType;
117
+ paymentDate?: ZeniDate;
118
+ }
114
119
  export {};
@@ -17,6 +17,7 @@ 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");
20
21
  const isClassRecommendation = (recommendations, classObj) => {
21
22
  if (classObj == null) {
22
23
  return false;
@@ -90,7 +91,7 @@ const getLineRecommendationsLocalData = (lineId, line, recommendations, accountL
90
91
  };
91
92
  exports.getLineRecommendationsLocalData = getLineRecommendationsLocalData;
92
93
  const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.initializeBillToLocalStore.match), (0, operators_1.mergeMap)((action) => {
93
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
94
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
94
95
  const { billId } = action.payload;
95
96
  const state = state$.value;
96
97
  const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
@@ -158,10 +159,12 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
158
159
  const isPayNowEnabled = payNowCutOffTime != null
159
160
  ? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
160
161
  : 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());
161
163
  const paymentDetailsSection = {
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),
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),
165
168
  paymentTo: transaction.billPayInfo.toAccount.billAccountId != null &&
166
169
  transaction.billPayInfo.toAccount.billAccountId.length > 0
167
170
  ? transaction.billPayInfo.toAccount.billAccountId
@@ -171,7 +174,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
171
174
  const totalAmount = transaction.amount;
172
175
  const recipientTotalAmount = transaction.recipientTotalAmount;
173
176
  const isCancelled = transaction.billPayInfo.isCancelled;
174
- const file = (_m = transaction.attachments) === null || _m === void 0 ? void 0 : _m[0];
177
+ const file = (_l = transaction.attachments) === null || _l === void 0 ? void 0 : _l[0];
175
178
  const candidateVendorname = transaction.candidateVendorName;
176
179
  const toAccountVendorEmail = transaction.billPayInfo.toAccountVendorEmail;
177
180
  const isCollectToAccountInfoFromVendorContact = transaction.billPayInfo.isCollectToAccountInfoFromVendorContact;
@@ -183,6 +186,13 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
183
186
  recurringConfig = recurringConfigLocalData;
184
187
  recurringBillInstances = recurringBillInstancesLocalData;
185
188
  }
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;
186
196
  const billDetailLocalData = {
187
197
  showVendorGptRecommendationText: false,
188
198
  vendor,
@@ -199,6 +209,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
199
209
  isRecurring,
200
210
  recurringConfig,
201
211
  recurringBillInstances,
212
+ outsideZeniPaymentLocalData,
202
213
  };
203
214
  const actions = [
204
215
  (0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({ billDetailLocalData, billId }),