@zeniai/client-epic-state 4.7.77 → 4.7.79

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 (101) hide show
  1. package/lib/entity/account/accountPayload.d.ts +1 -1
  2. package/lib/entity/chargeCard/chargeCard.d.ts +0 -1
  3. package/lib/entity/chargeCard/chargeCardPayload.d.ts +14 -4
  4. package/lib/entity/chargeCard/chargeCardPayload.js +0 -1
  5. package/lib/entity/depositAccount/depositAccountPayload.d.ts +5 -2
  6. package/lib/entity/paymentAccount/paymentAccountPayload.d.ts +0 -1
  7. package/lib/entity/paymentAccount/paymentAccountPayload.js +1 -2
  8. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -2
  9. package/lib/entity/paymentAccount/paymentAccountSelector.js +1 -14
  10. package/lib/entity/paymentAccount/paymentAccountState.d.ts +0 -1
  11. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  12. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  13. package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
  14. package/lib/entity/tenant/clearAllEpic.js +0 -4
  15. package/lib/entity/transaction/payloadTypes/transactionLinePayload.d.ts +2 -2
  16. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +2 -2
  17. package/lib/epic.d.ts +10 -9
  18. package/lib/epic.js +10 -9
  19. package/lib/index.d.ts +11 -21
  20. package/lib/index.js +22 -31
  21. package/lib/reducer.d.ts +0 -6
  22. package/lib/reducer.js +0 -6
  23. package/lib/view/accountList/fetchAccountListEpic.js +7 -16
  24. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.d.ts +7 -0
  25. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewResendOtpEpic.js +24 -0
  26. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.d.ts +7 -0
  27. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewSendOtpEpic.js +26 -0
  28. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.d.ts +7 -0
  29. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/vendorViewVerifyOtpEpic.js +28 -0
  30. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.d.ts +2 -2
  31. package/lib/view/commonVendorView/vendorView/epics/twoFactorAuth/verifyUserEpic.js +2 -2
  32. package/lib/view/commonVendorView/vendorView/vendorViewReducer.d.ts +9 -4
  33. package/lib/view/commonVendorView/vendorView/vendorViewReducer.js +70 -41
  34. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.d.ts +7 -0
  35. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/resendOnboardingOfficerOtpEpic.js +24 -0
  36. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.d.ts +7 -0
  37. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/sendOnboardingOfficerOtpEpic.js +27 -0
  38. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.d.ts +7 -0
  39. package/lib/view/onboardingView/customerView/epic/twoFactorAuthentication/verifyOnboardingOfficerOtpEpic.js +30 -0
  40. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +9 -2
  41. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +102 -70
  42. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  43. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  44. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  45. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  46. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  47. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +1 -0
  48. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +8 -0
  49. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -0
  50. package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.js +1 -1
  51. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +1 -2
  52. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +1 -4
  53. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -2
  54. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -1
  55. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +0 -4
  56. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +0 -7
  57. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +2 -25
  58. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -3
  59. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +1 -6
  60. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.d.ts +7 -0
  61. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/resendOtpEpic.js +23 -0
  62. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.d.ts +7 -0
  63. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/sendOtpEpic.js +26 -0
  64. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.d.ts +7 -0
  65. package/lib/view/spendManagement/commonSetup/epic/twoFactorAuthentication/verifyOtpEpic.js +27 -0
  66. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +9 -2
  67. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +104 -72
  68. package/lib/view/spendManagement/commonSetup/types/twoFactorAuthentication.d.ts +10 -0
  69. package/package.json +1 -1
  70. package/lib/view/settingsView/epic/fetchBankAccountsListEpic.d.ts +0 -22
  71. package/lib/view/settingsView/epic/fetchBankAccountsListEpic.js +0 -30
  72. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +0 -6
  73. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +0 -14
  74. package/lib/view/settingsView/epic/fetchMyProfileEpic.d.ts +0 -43
  75. package/lib/view/settingsView/epic/fetchMyProfileEpic.js +0 -50
  76. package/lib/view/settingsView/epic/fetchMyProfileViewEpic.d.ts +0 -7
  77. package/lib/view/settingsView/epic/fetchMyProfileViewEpic.js +0 -17
  78. package/lib/view/settingsView/settingsViewPayload.d.ts +0 -8
  79. package/lib/view/settingsView/settingsViewPayload.js +0 -2
  80. package/lib/view/settingsView/settingsViewReducer.d.ts +0 -13
  81. package/lib/view/settingsView/settingsViewReducer.js +0 -71
  82. package/lib/view/settingsView/settingsViewSelector.d.ts +0 -14
  83. package/lib/view/settingsView/settingsViewSelector.js +0 -119
  84. package/lib/view/settingsView/settingsViewState.d.ts +0 -12
  85. package/lib/view/settingsView/settingsViewState.js +0 -2
  86. package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +0 -29
  87. package/lib/view/settingsView/types/settingsViewSelectorTypes.js +0 -2
  88. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.d.ts +0 -11
  89. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardDetailEpic.js +0 -60
  90. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +0 -10
  91. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +0 -90
  92. package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +0 -10
  93. package/lib/view/twoFactorAuthentication/sendOtpEpic.js +0 -93
  94. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +0 -16
  95. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +0 -19
  96. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +0 -11
  97. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +0 -21
  98. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +0 -101
  99. package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +0 -10
  100. package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +0 -90
  101. /package/lib/view/{twoFactorAuthentication → spendManagement/commonSetup/types}/twoFactorAuthentication.js +0 -0
@@ -32,7 +32,7 @@ export declare const inviteZeniPeopleEpic: (actions$: ActionsObservable<ActionTy
32
32
  type: string;
33
33
  } | {
34
34
  payload: {
35
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "update_charge_card";
35
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term";
36
36
  messageText: "failed" | "success";
37
37
  type: import("../..").SnackbarMessageType;
38
38
  showStatusIcon?: boolean | undefined;
@@ -13,7 +13,7 @@ export declare const resendInviteEpic: (actions$: ActionsObservable<ActionType>,
13
13
  type: string;
14
14
  } | {
15
15
  payload: {
16
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "update_charge_card";
16
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term";
17
17
  messageText: "failed" | "success";
18
18
  type: import("../..").SnackbarMessageType;
19
19
  showStatusIcon?: boolean | undefined;
@@ -18,6 +18,7 @@ export interface BillPayConfigPayload {
18
18
  vendor: {
19
19
  supported_currencies: SupportedCurrencyPayload;
20
20
  supported_countries: CountryPayload[];
21
+ local_currency_supported_countries: CountryPayload[];
21
22
  };
22
23
  }
23
24
  export interface SupportedCurrencyPayload {
@@ -9,6 +9,7 @@ exports.initialState = {
9
9
  methodById: {},
10
10
  vendor: {
11
11
  supportedCountries: [],
12
+ localCurrencySupportedCountries: [],
12
13
  supportedCurrencies: {},
13
14
  currencyListByCountryId: {},
14
15
  },
@@ -72,6 +73,13 @@ const billPayConfig = (0, toolkit_1.createSlice)({
72
73
  countryName: country.country_name,
73
74
  };
74
75
  });
76
+ draft.vendor.localCurrencySupportedCountries =
77
+ vendor.local_currency_supported_countries.map((country) => {
78
+ return {
79
+ countryCode: country.country_code,
80
+ countryName: country.country_name,
81
+ };
82
+ });
75
83
  const countryCodes = Object.keys(vendor.supported_currencies.by_country);
76
84
  countryCodes.forEach((countryCode) => {
77
85
  const currencyPayload = vendor.supported_currencies.by_country[countryCode];
@@ -13,6 +13,7 @@ export interface BillPayConfigState extends FetchedState {
13
13
  methodById: Record<string, BillPayConfig>;
14
14
  vendor: {
15
15
  supportedCountries: Country[];
16
+ localCurrencySupportedCountries: Country[];
16
17
  supportedCurrencies: VendorCurrencyConfig;
17
18
  currencyListByCountryId: Record<ID, VendorCurrency[]>;
18
19
  };
@@ -27,7 +27,7 @@ const getInternationalWireView = (state, vendorType, billId) => {
27
27
  dynamicFormFields =
28
28
  dynamicFormDetails.supportedDynamicFormByTypes[localData.accountType.type];
29
29
  }
30
- const supportedCountries = billPayConfigState.vendor.supportedCountries;
30
+ const supportedCountries = billPayConfigState.vendor.localCurrencySupportedCountries;
31
31
  const selectedCountry = localData === null || localData === void 0 ? void 0 : localData.countryCode;
32
32
  const supportedCurrencies = selectedCountry != null
33
33
  ? billPayConfigState.vendor.currencyListByCountryId[selectedCountry]
@@ -1,8 +1,7 @@
1
- import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue';
2
1
  import { ZeniAPIResponse } from '../../../../responsePayload';
3
2
  import { CreditTerm, RePaymentInfo } from './chargeCardConfigState';
4
3
  export interface ChargeCardConfigPayload {
5
- allowed_credit_limit_span_options: AllowedValueWithCode[];
4
+ allowed_credit_limit_span_options: string[];
6
5
  credit_terms: CreditTermsPayload;
7
6
  repayment_info: RePaymentInfoPayload;
8
7
  }
@@ -30,10 +30,7 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
30
30
  updateChargeCardConfig(draft, action) {
31
31
  const { payload } = action;
32
32
  draft.creditLimitFrequency =
33
- payload.allowed_credit_limit_span_options.map((fequency) => ({
34
- code: (0, chargeCard_1.toCreditLimitFrequencyCodeType)(fequency.code),
35
- name: fequency.name,
36
- }));
33
+ payload.allowed_credit_limit_span_options.map((v) => (0, chargeCard_1.toCreditLimitFrequencyCodeType)(v));
37
34
  draft.creditTerm = (0, chargeCardConfigPayload_1.toCreditTerm)(payload.credit_terms);
38
35
  draft.rePaymentInfo = (0, chargeCardConfigPayload_1.toRePaymentInfo)(payload.repayment_info);
39
36
  draft.fetchState = 'Completed';
@@ -1,9 +1,9 @@
1
1
  import { FetchedState, ID } from '../../../../commonStateTypes/common';
2
2
  import { TimeframeTick } from '../../../../commonStateTypes/timeframeTick';
3
- import { CreditLimitFrequency } from '../../../../entity/chargeCard/chargeCard';
3
+ import { CreditLimitFrequencyCodeType } from '../../../../entity/chargeCard/chargeCard';
4
4
  import { ZeniDate } from '../../../../zeniDayJS';
5
5
  export interface ChargeCardConfigState extends FetchedState {
6
- creditLimitFrequency: CreditLimitFrequency[];
6
+ creditLimitFrequency: CreditLimitFrequencyCodeType[];
7
7
  creditTerm: CreditTerm;
8
8
  rePaymentInfo?: RePaymentInfo;
9
9
  }
@@ -7,7 +7,6 @@ export interface ChargeCardDetailState {
7
7
  export interface ChargeCardDetail extends FetchedState {
8
8
  id: ID;
9
9
  transactionList: ChargeCardDetailTransactionList;
10
- updateStatus: FetchStateAndError;
11
10
  }
12
11
  export interface ChargeCardDetailTransactionList extends FetchStateAndError {
13
12
  transactionIds: ID[];
@@ -20,8 +20,4 @@ exports.emptyChargeCardDetail = {
20
20
  hasValidState() {
21
21
  return this.fetchState == 'Completed';
22
22
  },
23
- updateStatus: {
24
- fetchState: 'Not-Started',
25
- error: undefined,
26
- },
27
23
  };
@@ -23,13 +23,6 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
23
23
  }, string>, updateChargeCardTransactionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
24
24
  chargeCardId: ID;
25
25
  error: ZeniAPIStatus;
26
- }, string>, updateChargeCardDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, colorCode: string], {
27
- chargeCardId: string;
28
- colorCode: string;
29
- }, string, never, never>, updateChargeCardDetailUpdateStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
30
- chargeCardId: ID;
31
- fetchState: FetchState;
32
- error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
33
26
  }, string>, clearChargeCardDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
34
27
  declare const _default: import("@reduxjs/toolkit").Reducer<ChargeCardDetailState, import("@reduxjs/toolkit").AnyAction>;
35
28
  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.clearChargeCardDetail = exports.updateChargeCardDetailUpdateStatus = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionList = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
4
+ exports.clearChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionList = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const chargeCardDetail_1 = require("./chargeCardDetail");
7
7
  const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
@@ -76,33 +76,10 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
76
76
  const existingCardDetail = draft.detailById[chargeCardId];
77
77
  draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { transactionList: Object.assign(Object.assign({}, existingCardDetail.transactionList), { fetchState: 'Error', error }) });
78
78
  },
79
- updateChargeCardDetail: {
80
- reducer(draft, action) {
81
- const { chargeCardId } = action.payload;
82
- const existingCardDetail = draft.detailById[chargeCardId];
83
- draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updateStatus: {
84
- fetchState: 'In-Progress',
85
- error: undefined,
86
- } });
87
- },
88
- prepare(chargeCardId, colorCode) {
89
- return {
90
- payload: { chargeCardId, colorCode },
91
- };
92
- },
93
- },
94
- updateChargeCardDetailUpdateStatus(draft, action) {
95
- const { chargeCardId, fetchState, error } = action.payload;
96
- const existingCardDetail = draft.detailById[chargeCardId];
97
- draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updateStatus: {
98
- fetchState,
99
- error,
100
- } });
101
- },
102
79
  clearChargeCardDetail(draft) {
103
80
  Object.assign(draft, exports.initialState);
104
81
  },
105
82
  },
106
83
  });
107
- _a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
84
+ _a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
108
85
  exports.default = chargeCardDetail.reducer;
@@ -5,14 +5,11 @@ import { RootState } from '../../../../reducer';
5
5
  import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
6
6
  import { ChargeCardWithUser } from '../chargeCardList/chargeCardListSelector';
7
7
  import { ChargeCardDetailUiState } from './chargeCardDetail';
8
- import { TwoFactorAuthenticationState } from '../../../twoFactorAuthentication/twoFactorAuthentication';
9
8
  export interface ChargeCardDetailSelectorView extends SelectorView {
10
9
  chargeCardConfig: ChargeCardConfigState;
11
10
  transactions: ChargeCardTransaction[];
12
11
  uiState: ChargeCardDetailUiState;
13
12
  transactionListFetchState: FetchStateAndError;
14
- twoFAView: TwoFactorAuthenticationState;
15
- loggedInUserPhone: string;
16
13
  chargeCard?: ChargeCardWithUser;
17
14
  }
18
15
  export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID) => ChargeCardDetailSelectorView;
@@ -14,10 +14,7 @@ const userSelector_1 = require("../../../../entity/user/userSelector");
14
14
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
15
15
  const chargeCardDetail_1 = require("./chargeCardDetail");
16
16
  const getChargeCardDetailView = (state, chargeCardId) => {
17
- var _a, _b, _c, _d, _e;
18
- const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, twoFactorAuthenticationState, } = state;
19
- const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
20
- const loggedInUserPhone = (_e = (_c = twoFactorAuthenticationState.phone) !== null && _c !== void 0 ? _c : (_d = (0, userSelector_1.getUserByUserId)(userState, loggedInUserId)) === null || _d === void 0 ? void 0 : _d.phone) !== null && _e !== void 0 ? _e : '';
17
+ const { addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, } = state;
21
18
  let chargeCardWithUser = undefined;
22
19
  const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
23
20
  const chargeCard = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, chargeCardId);
@@ -65,8 +62,6 @@ const getChargeCardDetailView = (state, chargeCardId) => {
65
62
  transactions,
66
63
  uiState,
67
64
  transactionListFetchState,
68
- twoFAView: twoFactorAuthenticationState,
69
- loggedInUserPhone,
70
65
  version: '1.0',
71
66
  };
72
67
  };
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../../reducer';
4
+ import { ZeniAPI } from '../../../../../zeniAPI';
5
+ import { resendOtp, sendOtpSuccess, sendOtpFailure } from '../../setupViewReducer';
6
+ export declare type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure>;
7
+ export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resendOtpEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../../responsePayload");
7
+ const setupViewReducer_1 = require("../../setupViewReducer");
8
+ const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(setupViewReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
9
+ const payload = {
10
+ otp_challenge: action.payload.otpChallenge,
11
+ };
12
+ return zeniAPI
13
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
14
+ .pipe((0, operators_1.mergeMap)((response) => {
15
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
16
+ return (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpSuccess)(response.data.otp_challenge));
17
+ }
18
+ else {
19
+ return (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpFailure)(response.status));
20
+ }
21
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend otp api errored out' + JSON.stringify(error))))));
22
+ }));
23
+ exports.resendOtpEpic = resendOtpEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../../reducer';
4
+ import { ZeniAPI } from '../../../../../zeniAPI';
5
+ import { sendOtp, sendOtpSuccess, sendOtpFailure } from '../../setupViewReducer';
6
+ export declare type ActionType = ReturnType<typeof sendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure>;
7
+ export declare const sendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendOtpEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../../responsePayload");
7
+ const setupViewReducer_1 = require("../../setupViewReducer");
8
+ const sendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(setupViewReducer_1.sendOtp.match), (0, operators_1.mergeMap)((action) => {
9
+ const payload = {
10
+ channel_type: 'phone',
11
+ channel_info: {
12
+ phone_number: action.payload.phoneNumber,
13
+ },
14
+ };
15
+ return zeniAPI
16
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/send`, payload)
17
+ .pipe((0, operators_1.mergeMap)((response) => {
18
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
19
+ return (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpSuccess)(response.data.otp_challenge));
20
+ }
21
+ else {
22
+ return (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpFailure)(response.status));
23
+ }
24
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, setupViewReducer_1.sendOtpFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Send otp api errored out' + JSON.stringify(error))))));
25
+ }));
26
+ exports.sendOtpEpic = sendOtpEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../../reducer';
4
+ import { ZeniAPI } from '../../../../../zeniAPI';
5
+ import { verifyOtp, verifyOtpSuccess, verifyOtpFailure } from '../../setupViewReducer';
6
+ export declare type ActionType = ReturnType<typeof verifyOtp> | ReturnType<typeof verifyOtpSuccess> | ReturnType<typeof verifyOtpFailure>;
7
+ export declare const verifyOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifyOtpEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../../responsePayload");
7
+ const setupViewReducer_1 = require("../../setupViewReducer");
8
+ const verifyOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(setupViewReducer_1.verifyOtp.match), (0, operators_1.mergeMap)((action) => {
9
+ const payload = {
10
+ otp_code: action.payload.otpCode,
11
+ otp_challenge: action.payload.otpChallenge,
12
+ };
13
+ return zeniAPI
14
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/verify`, payload)
15
+ .pipe((0, operators_1.mergeMap)((response) => {
16
+ if ((0, responsePayload_1.isSuccessResponse)(response) &&
17
+ response.data != null &&
18
+ response.data.is_verified === true) {
19
+ const actions = [(0, setupViewReducer_1.verifyOtpSuccess)()];
20
+ return (0, rxjs_1.from)(actions);
21
+ }
22
+ else {
23
+ return (0, rxjs_1.of)((0, setupViewReducer_1.verifyOtpFailure)(response.status));
24
+ }
25
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, setupViewReducer_1.verifyOtpFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Verify otp api errored out' + JSON.stringify(error))))));
26
+ }));
27
+ exports.verifyOtpEpic = verifyOtpEpic;
@@ -80,9 +80,16 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
80
80
  }, string>, updateSetupViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[]], {
81
81
  allBankAccountIds: string[];
82
82
  paymentAccountIds: string[];
83
- }, string, never, never>, sendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
83
+ }, string, never, never>, sendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[phoneNumber: string], {
84
+ phoneNumber: string;
85
+ }, string, never, never>, resendOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpChallenge: string], {
84
86
  otpChallenge: string;
85
- }, string>, sendOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, verifyOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
+ }, string, never, never>, sendOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpChallenge: string], {
88
+ otpChallenge: string;
89
+ }, string, never, never>, sendOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, verifyOtp: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[otpCode: string, otpChallenge: string], {
90
+ otpCode: string;
91
+ otpChallenge: string;
92
+ }, string, never, never>, verifyOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, verifyOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, string, never, never>, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
86
93
  industry: string;
87
94
  incDate: ZeniDate;
88
95
  }, string>, clearSetupViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
4
+ exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailure = exports.verifyOtpSuccess = exports.verifyOtp = exports.sendOtpFailure = exports.sendOtpSuccess = exports.resendOtp = exports.sendOtp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const zeniDayJS_1 = require("../../../zeniDayJS");
7
7
  const initialFetchStatus = {
@@ -505,74 +505,100 @@ const setupView = (0, toolkit_1.createSlice)({
505
505
  };
506
506
  },
507
507
  },
508
- sendOtp(draft) {
509
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
510
- var _a;
511
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
512
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
513
- draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
514
- fetchState: 'In-Progress',
515
- error: undefined,
516
- };
517
- draft.companyOfficerUpdateStatus[officerType].localData =
518
- Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
519
- isPhoneVerified: false,
520
- });
521
- }
522
- });
508
+ sendOtp: {
509
+ reducer(draft) {
510
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
511
+ var _a;
512
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
513
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
514
+ draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
515
+ fetchState: 'In-Progress',
516
+ error: undefined,
517
+ };
518
+ draft.companyOfficerUpdateStatus[officerType].localData =
519
+ Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
520
+ isPhoneVerified: false,
521
+ });
522
+ }
523
+ });
524
+ },
525
+ prepare(phoneNumber) {
526
+ return { payload: { phoneNumber } };
527
+ },
523
528
  },
524
- resendOtp(draft) {
525
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
526
- var _a;
527
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
528
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
529
- draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
530
- fetchState: 'In-Progress',
531
- error: undefined,
532
- };
533
- }
534
- });
529
+ resendOtp: {
530
+ reducer(draft) {
531
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
532
+ var _a;
533
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
534
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
535
+ draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
536
+ fetchState: 'In-Progress',
537
+ error: undefined,
538
+ };
539
+ }
540
+ });
541
+ },
542
+ prepare(otpChallenge) {
543
+ return { payload: { otpChallenge } };
544
+ },
535
545
  },
536
- sendOtpSuccess(draft, action) {
537
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
538
- var _a;
539
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
540
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
541
- draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
542
- fetchState: 'Completed',
543
- error: undefined,
544
- };
545
- draft.companyOfficerUpdateStatus[officerType].localData =
546
- Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
547
- otpChallenge: action.payload.otpChallenge,
548
- });
549
- }
550
- });
546
+ sendOtpSuccess: {
547
+ reducer(draft, action) {
548
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
549
+ var _a;
550
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
551
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
552
+ draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
553
+ fetchState: 'Completed',
554
+ error: undefined,
555
+ };
556
+ draft.companyOfficerUpdateStatus[officerType].localData =
557
+ Object.assign({}, draft.companyOfficerUpdateStatus[officerType].localData, {
558
+ otpChallenge: action.payload.otpChallenge,
559
+ });
560
+ }
561
+ });
562
+ },
563
+ prepare(otpChallenge) {
564
+ return { payload: { otpChallenge } };
565
+ },
551
566
  },
552
- sendOtpFailure(draft, action) {
553
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
554
- var _a;
555
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
556
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
557
- draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
558
- fetchState: 'Error',
559
- error: action.payload,
560
- };
561
- }
562
- });
567
+ sendOtpFailure: {
568
+ reducer(draft, action) {
569
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
570
+ var _a;
571
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
572
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
573
+ draft.companyOfficerUpdateStatus[officerType].sendOtpStatus = {
574
+ fetchState: 'Error',
575
+ error: action.payload,
576
+ };
577
+ }
578
+ });
579
+ },
580
+ prepare(error) {
581
+ return {
582
+ payload: error,
583
+ };
584
+ },
563
585
  },
564
- verifyOtp(draft) {
565
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
566
- var _a;
567
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
568
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
569
- draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
570
- {
586
+ verifyOtp: {
587
+ reducer(draft) {
588
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
589
+ var _a;
590
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
591
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
592
+ draft.companyOfficerUpdateStatus[officerType].otpverificationStatus = {
571
593
  fetchState: 'In-Progress',
572
594
  error: undefined,
573
595
  };
574
- }
575
- });
596
+ }
597
+ });
598
+ },
599
+ prepare(otpCode, otpChallenge) {
600
+ return { payload: { otpCode, otpChallenge } };
601
+ },
576
602
  },
577
603
  verifyOtpSuccess(draft) {
578
604
  Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
@@ -591,18 +617,24 @@ const setupView = (0, toolkit_1.createSlice)({
591
617
  }
592
618
  });
593
619
  },
594
- verifyOtpFailure(draft, action) {
595
- Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
596
- var _a;
597
- if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
598
- ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
599
- draft.companyOfficerUpdateStatus[officerType].otpverificationStatus =
600
- {
620
+ verifyOtpFailure: {
621
+ reducer(draft, action) {
622
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
623
+ var _a;
624
+ if (draft.companyOfficerUpdateStatus[officerType].localData != null &&
625
+ ((_a = draft.companyOfficerUpdateStatus[officerType].localData) === null || _a === void 0 ? void 0 : _a.isSelectedForVerification) === true) {
626
+ draft.companyOfficerUpdateStatus[officerType].otpverificationStatus = {
601
627
  fetchState: 'Error',
602
628
  error: action.payload,
603
629
  };
604
- }
605
- });
630
+ }
631
+ });
632
+ },
633
+ prepare(error) {
634
+ return {
635
+ payload: error,
636
+ };
637
+ },
606
638
  },
607
639
  saveIndustryAndIncDateInLocalStore(draft, action) {
608
640
  if (draft.companyDetails.localData != null) {
@@ -619,5 +651,5 @@ const setupView = (0, toolkit_1.createSlice)({
619
651
  },
620
652
  },
621
653
  });
622
- _a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
654
+ _a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtp = _a.sendOtp, exports.resendOtp = _a.resendOtp, exports.sendOtpSuccess = _a.sendOtpSuccess, exports.sendOtpFailure = _a.sendOtpFailure, exports.verifyOtp = _a.verifyOtp, exports.verifyOtpSuccess = _a.verifyOtpSuccess, exports.verifyOtpFailure = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
623
655
  exports.default = setupView.reducer;