@zeniai/client-epic-state 4.16.1 → 4.16.2

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 (174) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +1 -1
  3. package/lib/entity/chargeCard/chargeCard.d.ts +26 -8
  4. package/lib/entity/chargeCard/chargeCard.js +25 -6
  5. package/lib/entity/chargeCard/chargeCardPayload.d.ts +41 -5
  6. package/lib/entity/chargeCard/chargeCardPayload.js +20 -8
  7. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  8. package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +5 -1
  9. package/lib/entity/company/companyPayload.d.ts +12 -1
  10. package/lib/entity/company/companyPayload.js +14 -0
  11. package/lib/entity/company/companyStateTypes.d.ts +11 -0
  12. package/lib/entity/connectedAccount/connectedAccount.d.ts +19 -0
  13. package/lib/entity/connectedAccount/connectedAccount.js +10 -0
  14. package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +11 -0
  15. package/lib/entity/connectedAccount/connectedAccountPayload.js +15 -0
  16. package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +6 -0
  17. package/lib/entity/connectedAccount/connectedAccountReducer.js +27 -0
  18. package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +4 -0
  19. package/lib/entity/connectedAccount/connectedAccountSelector.js +17 -0
  20. package/lib/entity/depositAccount/depositAccount.d.ts +20 -2
  21. package/lib/entity/depositAccount/depositAccountPayload.d.ts +22 -1
  22. package/lib/entity/depositAccount/depositAccountPayload.js +39 -1
  23. package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
  24. package/lib/entity/depositAccount/depositAccountReducer.js +8 -2
  25. package/lib/entity/depositAccount/depositAccountSelector.d.ts +3 -1
  26. package/lib/entity/depositAccount/depositAccountSelector.js +10 -0
  27. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  28. package/lib/entity/snackbar/snackbarTypes.js +2 -0
  29. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  30. package/lib/entity/tenant/clearAllEpic.js +2 -0
  31. package/lib/entity/tenant/tenantSelector.d.ts +6 -2
  32. package/lib/entity/tenant/tenantSelector.js +10 -2
  33. package/lib/epic.d.ts +5 -1
  34. package/lib/epic.js +5 -1
  35. package/lib/index.d.ts +18 -18
  36. package/lib/index.js +26 -17
  37. package/lib/reducer.d.ts +3 -0
  38. package/lib/reducer.js +3 -0
  39. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +8 -0
  40. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +16 -0
  41. package/lib/view/addressView/addressViewState.d.ts +1 -1
  42. package/lib/view/dashboard/dashboardSelector.js +7 -6
  43. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +5 -4
  44. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +1 -2
  45. package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +18 -6
  46. package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +1 -4
  47. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +7 -1
  48. package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -2
  49. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
  50. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +3 -3
  51. package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
  52. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  53. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +27 -24
  54. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +22 -9
  55. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
  56. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +13 -5
  57. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +245 -115
  58. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -3
  59. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -19
  60. package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +29 -9
  61. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +108 -40
  62. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
  63. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +40 -15
  64. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
  65. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
  66. package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -0
  67. package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
  68. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +2 -1
  69. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
  70. package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
  71. package/lib/view/settingsView/settingsViewHelpers.js +9 -8
  72. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
  73. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +6 -1
  74. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +20 -2
  75. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -0
  76. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +9 -2
  77. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
  78. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +4 -3
  79. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +5 -3
  80. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +4 -2
  81. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +8 -3
  82. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +4 -2
  83. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +12 -0
  84. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +26 -0
  85. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
  86. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +43 -4
  87. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +104 -9
  88. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +15 -0
  89. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +70 -16
  90. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -1
  91. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +12 -3
  92. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +2 -1
  93. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +8 -0
  94. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +41 -0
  95. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
  96. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +11 -0
  97. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +42 -0
  98. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +11 -1
  99. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +20 -1
  100. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +16 -1
  101. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -4
  102. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +30 -4
  103. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +5 -2
  104. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +26 -14
  105. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
  106. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +20 -5
  107. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +7 -0
  108. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +23 -0
  109. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +2 -1
  110. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +4 -2
  111. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
  112. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -0
  113. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +19 -2
  114. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +6 -0
  115. package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +2 -0
  116. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +8 -0
  117. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +31 -0
  118. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
  119. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +15 -3
  120. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
  121. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +65 -25
  122. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +11 -3
  123. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +45 -11
  124. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +6 -3
  125. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +33 -18
  126. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +41 -8
  127. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +0 -21
  128. package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +9 -0
  129. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +8 -3
  130. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
  131. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
  132. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
  133. package/lib/view/spendManagement/commonSetup/setupViewState.js +13 -1
  134. package/lib/view/spendManagement/helpers.d.ts +3 -0
  135. package/lib/view/spendManagement/helpers.js +13 -1
  136. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
  137. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
  138. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +2 -1
  139. package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
  140. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
  141. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +6 -1
  142. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
  143. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
  144. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
  145. package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
  146. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
  147. package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
  148. package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
  149. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
  150. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
  151. package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.d.ts +4 -3
  152. package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +25 -1
  153. package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +1 -1
  154. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
  155. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +4 -2
  156. package/lib/view/transactionDetail/transactionDetailReducer.js +4 -2
  157. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -2
  158. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +44 -19
  159. package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +2 -1
  160. package/lib/view/twoFactorAuthentication/sendOtpEpic.js +45 -18
  161. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +17 -5
  162. package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +33 -0
  163. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
  164. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
  165. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +22 -6
  166. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +176 -60
  167. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +5 -3
  168. package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +13 -2
  169. package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +5 -2
  170. package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +46 -5
  171. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
  172. package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -3
  173. package/lib/view/userListView/userListViewPayload.d.ts +11 -0
  174. package/package.json +5 -4
@@ -3,24 +3,33 @@ 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.getChargeCardTransactionAttachmentView = exports.getChargeCardCVVActivateView = exports.getChargeCardDetailView = void 0;
6
+ exports.getChargeCardTransactionAttachmentView = exports.getChargeCardCVVActivateView = exports.getDebitCardSetPinView = exports.getChargeCardDetailView = void 0;
7
7
  const get_1 = __importDefault(require("lodash/get"));
8
8
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
9
9
  const addressSelector_1 = require("../../../../entity/address/addressSelector");
10
10
  const chargeCardSelector_1 = require("../../../../entity/chargeCard/chargeCardSelector");
11
11
  const chargeCardTransactionSelector_1 = require("../../../../entity/chargeCardTransaction/chargeCardTransactionSelector");
12
12
  const classSelector_1 = require("../../../../entity/class/classSelector");
13
+ const connectedAccountSelector_1 = require("../../../../entity/connectedAccount/connectedAccountSelector");
14
+ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
13
15
  const userSelector_1 = require("../../../../entity/user/userSelector");
14
16
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
17
+ const twoFactorAuthentication_1 = require("../../../twoFactorAuthentication/twoFactorAuthentication");
15
18
  const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
16
19
  const chargeCardDetail_1 = require("./chargeCardDetail");
17
20
  const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo) => {
18
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19
- const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, chargeCardListState, } = state;
20
- const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationView)(state);
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
22
+ const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, chargeCardListState, connectedAccountState, depositAccountState, } = state;
23
+ const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId);
21
24
  const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
22
25
  const loggedInUserPhone = (_e = (_c = twoFactorAuthenticationView.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 : '';
23
26
  let chargeCardWithUser = undefined;
27
+ let connectedAccount = undefined;
28
+ let depositAccountLimitFetchState = {
29
+ fetchState: 'Not-Started',
30
+ error: undefined,
31
+ };
32
+ let depositAccountLimit = undefined;
24
33
  const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
25
34
  const chargeCard = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, chargeCardId);
26
35
  let reducedFetchState = {
@@ -58,6 +67,7 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
58
67
  ? (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.mailingAddressId)
59
68
  : undefined;
60
69
  const billingAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.billingAddressId);
70
+ connectedAccount = (0, connectedAccountSelector_1.getConnectedAccountByConnectedAccountId)(connectedAccountState, chargeCard.connectedAccountId);
61
71
  if (cardCreatedByUser == null ||
62
72
  cardHolderUser == null ||
63
73
  cardHolderUserRole == null ||
@@ -75,6 +85,9 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
75
85
  error: chargeCardDetail.transactionList.error,
76
86
  };
77
87
  uiState = chargeCardDetail.transactionList.uiState;
88
+ depositAccountLimitFetchState =
89
+ chargeCardDetail.depositAccountLimitFetchState;
90
+ depositAccountLimit = (0, depositAccountSelector_1.getDepositAccountLimitForChargeCardByDepositAccountId)(depositAccountState, chargeCard.connectedAccountId);
78
91
  }
79
92
  return {
80
93
  fetchState: reducedFetchState.fetchState,
@@ -82,34 +95,76 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
82
95
  fetchState: 'Not-Started',
83
96
  error: undefined,
84
97
  },
85
- updatePhysicalChargeCardAttemptFetchState: (_g = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _g !== void 0 ? _g : {
98
+ isRefreshingViewInBackground: (_g = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.isRefreshingViewInBackground) !== null && _g !== void 0 ? _g : false,
99
+ updatePhysicalChargeCardAttemptFetchState: (_h = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _h !== void 0 ? _h : {
86
100
  fetchState: 'Not-Started',
87
101
  error: undefined,
88
102
  },
89
- updateChargeCardLimitFetchState: (_h = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardLimitFetchState) !== null && _h !== void 0 ? _h : {
103
+ updateChargeCardLimitFetchState: (_j = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardLimitFetchState) !== null && _j !== void 0 ? _j : {
90
104
  fetchState: 'Not-Started',
91
105
  error: undefined,
92
106
  },
93
107
  chargeCard: chargeCardWithUser,
108
+ connectedAccount,
94
109
  error: reducedFetchState.error,
95
110
  chargeCardConfig: chargeCardConfigState,
96
111
  transactions,
97
- uploadReceiptsFetchStateByTransactionId: (_j = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsFetchStateByTransactionId) !== null && _j !== void 0 ? _j : {},
98
- uploadReceiptsShowTickByTransactionId: (_k = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsShowTickByTransactionId) !== null && _k !== void 0 ? _k : {},
99
- isViewReceiptClickedImmediatelyAfterUploadTransactionId: (_l = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.isViewReceiptClickedImmediatelyAfterUploadTransactionId) !== null && _l !== void 0 ? _l : {},
112
+ uploadReceiptsFetchStateByTransactionId: (_k = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsFetchStateByTransactionId) !== null && _k !== void 0 ? _k : {},
113
+ uploadReceiptsShowTickByTransactionId: (_l = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsShowTickByTransactionId) !== null && _l !== void 0 ? _l : {},
114
+ isViewReceiptClickedImmediatelyAfterUploadTransactionId: (_m = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.isViewReceiptClickedImmediatelyAfterUploadTransactionId) !== null && _m !== void 0 ? _m : {},
100
115
  uiState,
101
116
  transactionListFetchState,
102
117
  twoFAView: twoFactorAuthenticationView,
103
118
  loggedInUserPhone,
119
+ depositAccountLimitFetchState,
120
+ depositAccountLimit,
104
121
  version: '1.0',
105
122
  creditAccount: chargeCardListState.creditAccount,
106
123
  };
107
124
  };
108
125
  exports.getChargeCardDetailView = getChargeCardDetailView;
126
+ const getDebitCardSetPinView = (state, chargeCardId) => {
127
+ var _a, _b, _c, _d, _e;
128
+ const { chargeCardDetailState, chargeCardState, chargeCardConfigState } = state;
129
+ const twoFactorAuthenticationView = (_a = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId)) !== null && _a !== void 0 ? _a : twoFactorAuthentication_1.initialTwoFactorAuthentication;
130
+ const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
131
+ const chargeCard = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, chargeCardId);
132
+ let reducedFetchState = {
133
+ fetchState: 'Not-Started',
134
+ error: undefined,
135
+ };
136
+ if (chargeCardDetail) {
137
+ reducedFetchState = (0, reduceFetchState_1.reduceFetchState)([
138
+ chargeCardDetail,
139
+ chargeCardConfigState,
140
+ ]);
141
+ }
142
+ const debitCardSetPinWaitStatus = (_c = (_b = chargeCardDetailState.detailById[chargeCardId]) === null || _b === void 0 ? void 0 : _b.debitCardSetPinWaitStatus) !== null && _c !== void 0 ? _c : {
143
+ fetchState: 'Not-Started',
144
+ error: undefined,
145
+ };
146
+ const updateStatus = (0, reduceFetchState_1.reduceAllFetchState)([
147
+ twoFactorAuthenticationView.sendOtpStatus,
148
+ debitCardSetPinWaitStatus,
149
+ ]);
150
+ return {
151
+ fetchState: reducedFetchState.fetchState,
152
+ updateStatus,
153
+ isRefreshingViewInBackground: (_d = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.isRefreshingViewInBackground) !== null && _d !== void 0 ? _d : false,
154
+ updateDebitCardPinAttemptFetchState: (_e = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateDebitCardPinAttemptFetchState) !== null && _e !== void 0 ? _e : {
155
+ fetchState: 'Not-Started',
156
+ error: undefined,
157
+ },
158
+ chargeCard: chargeCard,
159
+ error: reducedFetchState.error,
160
+ version: '1.0',
161
+ };
162
+ };
163
+ exports.getDebitCardSetPinView = getDebitCardSetPinView;
109
164
  const getChargeCardCVVActivateView = (state, chargeCardId) => {
110
- var _a, _b, _c;
165
+ var _a, _b, _c, _d, _e;
111
166
  const { addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, } = state;
112
- const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationView)(state);
167
+ const twoFactorAuthenticationView = (_a = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId)) !== null && _a !== void 0 ? _a : twoFactorAuthentication_1.initialTwoFactorAuthentication;
113
168
  let chargeCardWithUser = undefined;
114
169
  const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
115
170
  const chargeCard = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, chargeCardId);
@@ -123,9 +178,7 @@ const getChargeCardCVVActivateView = (state, chargeCardId) => {
123
178
  chargeCardConfigState,
124
179
  ]);
125
180
  }
126
- if (chargeCardDetail &&
127
- chargeCardDetail.fetchState === 'Completed' &&
128
- chargeCard != null) {
181
+ if (chargeCardDetail && chargeCard != null) {
129
182
  const cardCreatedByUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardCreaterUserId);
130
183
  const cardHolderUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardHolderUserId);
131
184
  const cardHolderUserRole = (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, chargeCard.cardHolderUserId);
@@ -150,7 +203,7 @@ const getChargeCardCVVActivateView = (state, chargeCardId) => {
150
203
  mailingAddress,
151
204
  billingAddress });
152
205
  }
153
- const cvvActivationWaitStatus = (_b = (_a = chargeCardDetailState.detailById[chargeCardId]) === null || _a === void 0 ? void 0 : _a.cvvActivationWaitStatus) !== null && _b !== void 0 ? _b : {
206
+ const cvvActivationWaitStatus = (_c = (_b = chargeCardDetailState.detailById[chargeCardId]) === null || _b === void 0 ? void 0 : _b.cvvActivationWaitStatus) !== null && _c !== void 0 ? _c : {
154
207
  fetchState: 'Not-Started',
155
208
  error: undefined,
156
209
  };
@@ -161,7 +214,8 @@ const getChargeCardCVVActivateView = (state, chargeCardId) => {
161
214
  return {
162
215
  fetchState: reducedFetchState.fetchState,
163
216
  updateStatus,
164
- updatePhysicalChargeCardAttemptFetchState: (_c = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _c !== void 0 ? _c : {
217
+ isRefreshingViewInBackground: (_d = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.isRefreshingViewInBackground) !== null && _d !== void 0 ? _d : false,
218
+ updatePhysicalChargeCardAttemptFetchState: (_e = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _e !== void 0 ? _e : {
165
219
  fetchState: 'Not-Started',
166
220
  error: undefined,
167
221
  },
@@ -2,10 +2,11 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { updateAddress, updateAddresses } from '../../../../entity/address/addressReducer';
4
4
  import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
5
+ import { updateConnectedAccount } from '../../../../entity/connectedAccount/connectedAccountReducer';
5
6
  import { updateAllUsers } from '../../../../entity/user/userReducer';
6
7
  import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
7
8
  import { RootState } from '../../../../reducer';
8
9
  import { ZeniAPI } from '../../../../zeniAPI';
9
10
  import { fetchChargeCardDetail, updateChargeCardDetailFetchState } from './chargeCardDetailReducer';
10
- export type ActionType = ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof updateChargeCardDetailFetchState> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateChargeCard>;
11
+ export type ActionType = ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof updateChargeCardDetailFetchState> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateConnectedAccount> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateChargeCard>;
11
12
  export declare const fetchChargeCardDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -9,6 +9,7 @@ const rxjs_1 = require("rxjs");
9
9
  const operators_1 = require("rxjs/operators");
10
10
  const addressReducer_1 = require("../../../../entity/address/addressReducer");
11
11
  const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
12
+ const connectedAccountReducer_1 = require("../../../../entity/connectedAccount/connectedAccountReducer");
12
13
  const userReducer_1 = require("../../../../entity/user/userReducer");
13
14
  const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
14
15
  const responsePayload_1 = require("../../../../responsePayload");
@@ -23,15 +24,21 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
23
24
  chargeCardDetail.fetchState !== 'In-Progress') {
24
25
  chargeCardAction.push((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
25
26
  chargeCardId,
27
+ isRefreshingViewInBackground: cacheOverride,
26
28
  fetchState: 'In-Progress',
27
29
  }));
30
+ const query = {
31
+ is_include_card_activation_events: true,
32
+ is_include_connected_account_info: true,
33
+ is_include_card_pin_change_attempt_history: true,
34
+ };
28
35
  const getChargeCardDetail$ = zeniAPI
29
- .getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}?query={
30
- "is_include_card_activation_events":true}`)
36
+ .getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}?query=${JSON.stringify(query)}`)
31
37
  .pipe((0, operators_1.mergeMap)((response) => {
32
38
  if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
33
- return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
39
+ return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, connectedAccountReducer_1.updateConnectedAccount)(response.data.connected_account), (0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
34
40
  chargeCardId,
41
+ isRefreshingViewInBackground: false,
35
42
  fetchState: 'Completed',
36
43
  }));
37
44
  }
@@ -39,6 +46,7 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
39
46
  return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
40
47
  chargeCardId,
41
48
  fetchState: 'Error',
49
+ isRefreshingViewInBackground: false,
42
50
  error: response.status,
43
51
  }));
44
52
  }
@@ -46,6 +54,7 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
46
54
  return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
47
55
  chargeCardId,
48
56
  fetchState: 'Error',
57
+ isRefreshingViewInBackground: false,
49
58
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch card detail API call errored out' +
50
59
  JSON.stringify(error)),
51
60
  }));
@@ -10,7 +10,7 @@ const chargeCardDetail_1 = require("./chargeCardDetail");
10
10
  const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
11
11
  const fetchChargeCardTransactionListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchChargeCardTransactionList.match), (0, operators_1.switchMap)((action) => {
12
12
  var _a, _b;
13
- const { chargeCardId, pageToken, pageTokenType } = action.payload;
13
+ const { chargeCardId, pageToken, pageTokenType, cacheOverride } = action.payload;
14
14
  const { uiState } = (_b = (_a = state$.value.chargeCardDetailState.detailById[chargeCardId]) === null || _a === void 0 ? void 0 : _a.transactionList) !== null && _b !== void 0 ? _b : chargeCardDetail_1.emptyChargeCardDetail.transactionList;
15
15
  const queryParam = {
16
16
  page_token: pageToken,
@@ -27,6 +27,7 @@ const fetchChargeCardTransactionListEpic = (actions$, state$, zeniAPI) => action
27
27
  return (0, rxjs_1.of)((0, chargeCardTransactionReducer_1.updateChargeCardTransactions)(response.data.transactions), (0, chargeCardDetailReducer_1.updateChargeCardTransactionList)({
28
28
  chargeCardId,
29
29
  data: response.data,
30
+ cacheOverride,
30
31
  }));
31
32
  }
32
33
  else {
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateDepositAccountLimitsForChargeCard } from '../../../../entity/depositAccount/depositAccountReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { fetchDepositAccountLimit, updateDepositAccountLimitFetchStatus } from './chargeCardDetailReducer';
7
+ export type ActionType = ReturnType<typeof fetchDepositAccountLimit> | ReturnType<typeof updateDepositAccountLimitsForChargeCard> | ReturnType<typeof updateDepositAccountLimitFetchStatus>;
8
+ export declare const fetchDepositAccountLimitEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchDepositAccountLimitEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const depositAccountReducer_1 = require("../../../../entity/depositAccount/depositAccountReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
9
+ const fetchDepositAccountLimitEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchDepositAccountLimit.match), (0, operators_1.switchMap)((action) => {
10
+ const { depositAccountId, chargeCardId } = action.payload;
11
+ const query = {
12
+ deposit_account_id: depositAccountId,
13
+ };
14
+ return zeniAPI
15
+ .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/limits?query=${JSON.stringify(query)}`)
16
+ .pipe((0, operators_1.mergeMap)((response) => {
17
+ var _a, _b;
18
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
19
+ return (0, rxjs_1.of)((0, depositAccountReducer_1.updateDepositAccountLimitsForChargeCard)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.deposit_accounts) !== null && _b !== void 0 ? _b : []), (0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
20
+ chargeCardId,
21
+ fetchState: 'Completed',
22
+ error: undefined,
23
+ }));
24
+ }
25
+ else {
26
+ return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
27
+ chargeCardId,
28
+ fetchState: 'Error',
29
+ error: response.status,
30
+ }));
31
+ }
32
+ }), (0, operators_1.catchError)((error) => {
33
+ return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
34
+ chargeCardId,
35
+ fetchState: 'Error',
36
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch deposit Accounts Limit For Card Detail REST API call errored out' +
37
+ JSON.stringify(error)),
38
+ }));
39
+ }));
40
+ }));
41
+ exports.fetchDepositAccountLimitEpic = fetchDepositAccountLimitEpic;
@@ -10,9 +10,9 @@ const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
10
10
  const updateChargeCardLimitEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.updateChargeCardSpendLimit.match), (0, operators_1.switchMap)((action) => {
11
11
  const { chargeCardId, updatedSpendLimit, frequency, formattedAmount } = action.payload;
12
12
  const payload = {
13
- credit_limit: updatedSpendLimit.amount,
13
+ purchase_limit: updatedSpendLimit.amount,
14
14
  currency_code: updatedSpendLimit.currencyCode,
15
- credit_limit_frequency: {
15
+ purchase_limit_frequency: {
16
16
  code: frequency,
17
17
  },
18
18
  };
@@ -0,0 +1,11 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateAddress, updateAddresses } from '../../../../entity/address/addressReducer';
4
+ import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
5
+ import { updateAllUsers } from '../../../../entity/user/userReducer';
6
+ import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
7
+ import { RootState } from '../../../../reducer';
8
+ import { ZeniAPI } from '../../../../zeniAPI';
9
+ import { updateDebitCardPinAttempt, updateDebitCardPinAttemptSuccessOrFailure } from './chargeCardDetailReducer';
10
+ export type ActionType = ReturnType<typeof updateDebitCardPinAttempt> | ReturnType<typeof updateDebitCardPinAttemptSuccessOrFailure> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateChargeCard>;
11
+ export declare const updateDebitCardPinAttemptEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateDebitCardPinAttemptEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
7
+ const userReducer_1 = require("../../../../entity/user/userReducer");
8
+ const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
9
+ const responsePayload_1 = require("../../../../responsePayload");
10
+ const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
11
+ const updateDebitCardPinAttemptEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.updateDebitCardPinAttempt.match), (0, operators_1.switchMap)((action) => {
12
+ const { chargeCardId, statusCode } = action.payload;
13
+ const payload = {
14
+ status_code: statusCode,
15
+ is_card_pin_change_attempted: true,
16
+ };
17
+ return zeniAPI
18
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}/pin/events`, payload)
19
+ .pipe((0, operators_1.mergeMap)((response) => {
20
+ if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
21
+ return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardDetailReducer_1.updateDebitCardPinAttemptSuccessOrFailure)({
22
+ chargeCardId,
23
+ fetchState: 'Completed',
24
+ }));
25
+ }
26
+ else {
27
+ return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDebitCardPinAttemptSuccessOrFailure)({
28
+ chargeCardId,
29
+ fetchState: 'Error',
30
+ error: response.status,
31
+ }));
32
+ }
33
+ }), (0, operators_1.catchError)((error) => {
34
+ return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDebitCardPinAttemptSuccessOrFailure)({
35
+ chargeCardId,
36
+ fetchState: 'Error',
37
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update physical card attempt API call errored out' +
38
+ JSON.stringify(error)),
39
+ }));
40
+ }));
41
+ }));
42
+ exports.updateDebitCardPinAttemptEpic = updateDebitCardPinAttemptEpic;
@@ -1,10 +1,12 @@
1
1
  import { Amount } from '../../../../commonStateTypes/amount';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../../commonStateTypes/common';
3
+ import { ZeniDate } from '../../../../zeniDayJS';
3
4
  import { SpendManagementUIState } from '../../billPay/billList/billListState';
4
5
  export interface ChargeCardListState extends FetchedState {
5
6
  cardIds: ID[];
6
7
  uiState: ChargeCardListUIState;
7
8
  creditAccount: CreditAccount;
9
+ debitCardSummaries: DebitCardSummaries;
8
10
  searchText: string;
9
11
  unAssignedCredits?: Amount;
10
12
  resendCardInvite: ResendRevokeCardInvite;
@@ -17,6 +19,13 @@ export interface ResendRevokeCardInvite {
17
19
  export interface ChargeCardListUIState extends SpendManagementUIState {
18
20
  sortKey: ChargeCardViewSortKey;
19
21
  }
22
+ export interface DebitCardSummaries extends FetchStateAndError {
23
+ currentMonthSpends: Amount;
24
+ lastCompletedMonthSpends: Amount;
25
+ spendsPercentChange: number;
26
+ lastCompletedMonthStartTime: ZeniDate;
27
+ lastCompletedMonthEndTime: ZeniDate;
28
+ }
20
29
  export interface CreditAccount extends FetchStateAndError {
21
30
  id: ID;
22
31
  status: CreditAccountStatusType;
@@ -27,8 +36,9 @@ export interface CreditAccount extends FetchStateAndError {
27
36
  cashback?: Amount;
28
37
  }
29
38
  export declare const initialCreditAcc: CreditAccount;
39
+ export declare const initialDebitCardSummaries: DebitCardSummaries;
30
40
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
31
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "utilisation";
41
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
32
42
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
33
43
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
34
44
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.initialCreditAcc = void 0;
3
+ exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.initialDebitCardSummaries = exports.initialCreditAcc = void 0;
4
4
  const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
5
+ const zeniDayJS_1 = require("../../../../zeniDayJS");
5
6
  exports.initialCreditAcc = {
6
7
  fetchState: 'Not-Started',
7
8
  error: undefined,
@@ -33,6 +34,23 @@ exports.initialCreditAcc = {
33
34
  currencySymbol: '$',
34
35
  },
35
36
  };
37
+ exports.initialDebitCardSummaries = {
38
+ fetchState: 'Not-Started',
39
+ error: undefined,
40
+ currentMonthSpends: {
41
+ amount: 0,
42
+ currencyCode: 'USD',
43
+ currencySymbol: '$',
44
+ },
45
+ lastCompletedMonthSpends: {
46
+ amount: 0,
47
+ currencyCode: 'USD',
48
+ currencySymbol: '$',
49
+ },
50
+ spendsPercentChange: 0,
51
+ lastCompletedMonthStartTime: (0, zeniDayJS_1.dateNow)(),
52
+ lastCompletedMonthEndTime: (0, zeniDayJS_1.dateNow)(),
53
+ };
36
54
  exports.initialResendRevokeCardInvite = {
37
55
  cardId: undefined,
38
56
  saveStatus: {
@@ -44,6 +62,7 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
44
62
  'owner',
45
63
  'cardName',
46
64
  'department',
65
+ 'cardType',
47
66
  'status',
48
67
  'utilisation',
49
68
  'limit',
@@ -1,10 +1,11 @@
1
+ import { ID } from '../../../../commonStateTypes/common';
1
2
  import { AddressPayload } from '../../../../entity/address/addressPayload';
2
3
  import { ChargeCardPayload } from '../../../../entity/chargeCard/chargeCardPayload';
3
4
  import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
4
5
  import { UserPayload } from '../../../../entity/user/userPayload';
5
6
  import { UserRolePayload } from '../../../../entity/userRole/userRolePayload';
6
7
  import { ZeniAPIResponse } from '../../../../responsePayload';
7
- import { ActiveChargeCardCountPayload } from '../../../../view/userListView/userListViewPayload';
8
+ import { ActiveChargeCardCountPayload, ActiveDebitCardCountByUserIdPayload } from '../../../../view/userListView/userListViewPayload';
8
9
  export interface ChargeCardListPayload {
9
10
  cards: ChargeCardPayload[];
10
11
  unassigned_credit?: AmountPayload;
@@ -12,6 +13,7 @@ export interface ChargeCardListPayload {
12
13
  user_roles: UserRolePayload[];
13
14
  addresses: AddressPayload[];
14
15
  cards_count_by_user_id?: ActiveChargeCardCountPayload[];
16
+ debit_cards_count_by_deposit_account_id?: Record<ID, ActiveDebitCardCountByUserIdPayload>;
15
17
  }
16
18
  export type FetchChargeCardListResponse = ZeniAPIResponse<ChargeCardListPayload>;
17
19
  export interface CreditAccountPayload {
@@ -35,5 +37,18 @@ interface CreditAccountListPayload {
35
37
  credit_accounts: CreditAccountPayload[];
36
38
  }
37
39
  export type FetchCreditAccountResponse = ZeniAPIResponse<CreditAccountListPayload>;
40
+ export interface DebitCardSummariesPayload {
41
+ current_month_spends: number;
42
+ last_completed_month_spends: number;
43
+ currency_code: string;
44
+ currency_symbol: string;
45
+ spends_percent_change: number;
46
+ last_completed_month_start_time: string;
47
+ last_completed_month_end_time: string;
48
+ }
49
+ interface DebitCardSummaryPayload {
50
+ debit_card_summaries: DebitCardSummariesPayload;
51
+ }
52
+ export type FetchDebitCardSummaryResponse = ZeniAPIResponse<DebitCardSummaryPayload>;
38
53
  export type ResendInviteResponse = ZeniAPIResponse<ChargeCardPayload>;
39
54
  export {};
@@ -1,12 +1,14 @@
1
1
  import { ID } from '../../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../../responsePayload';
3
3
  import { ChargeCardListState, ChargeCardListUIState } from './chargeCardList';
4
- import { ChargeCardListPayload, CreditAccountPayload } from './chargeCardListPayload';
4
+ import { ChargeCardListPayload, CreditAccountPayload, DebitCardSummariesPayload } from './chargeCardListPayload';
5
5
  export declare const initialState: ChargeCardListState;
6
- export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[doFetchCreditAccountsAndCashback: boolean, cacheOverride?: any], {
7
- doFetchCreditAccountsAndCashback: boolean;
6
+ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[doFetchCreditAccountsDebitSummaryAndCashback: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean, cacheOverride?: any], {
7
+ doFetchCreditAccountsDebitSummaryAndCashback: boolean;
8
+ isDebitCardEnabled: boolean;
9
+ isCreditCardEnabled: boolean;
8
10
  cacheOverride: any;
9
- }, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
+ }, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchDebitCardSummary">, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
12
  chargeCardListPayload: ChargeCardListPayload;
11
13
  keepExistingListItems?: boolean;
12
14
  }, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
4
+ exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
+ const zeniDayJS_1 = require("../../../../zeniDayJS");
7
8
  const chargeCardList_1 = require("./chargeCardList");
8
9
  exports.initialState = {
9
10
  fetchState: 'Not-Started',
@@ -12,6 +13,7 @@ exports.initialState = {
12
13
  searchText: '',
13
14
  unAssignedCredits: undefined,
14
15
  creditAccount: chargeCardList_1.initialCreditAcc,
16
+ debitCardSummaries: chargeCardList_1.initialDebitCardSummaries,
15
17
  hasValidState() {
16
18
  return this.fetchState == 'Completed';
17
19
  },
@@ -30,9 +32,14 @@ const chargeCardList = (0, toolkit_1.createSlice)({
30
32
  reducer() {
31
33
  //do nothing
32
34
  },
33
- prepare(doFetchCreditAccountsAndCashback, cacheOverride = false) {
35
+ prepare(doFetchCreditAccountsDebitSummaryAndCashback, isDebitCardEnabled, isCreditCardEnabled, cacheOverride = false) {
34
36
  return {
35
- payload: { doFetchCreditAccountsAndCashback, cacheOverride },
37
+ payload: {
38
+ doFetchCreditAccountsDebitSummaryAndCashback,
39
+ isDebitCardEnabled,
40
+ isCreditCardEnabled,
41
+ cacheOverride,
42
+ },
36
43
  };
37
44
  },
38
45
  },
@@ -48,6 +55,16 @@ const chargeCardList = (0, toolkit_1.createSlice)({
48
55
  updateCreditAccountFailure(draft, action) {
49
56
  draft.creditAccount = Object.assign(Object.assign({}, chargeCardList_1.initialCreditAcc), { fetchState: 'Error', error: action.payload });
50
57
  },
58
+ fetchDebitCardSummary(draft) {
59
+ draft.debitCardSummaries.fetchState = 'In-Progress';
60
+ draft.debitCardSummaries.error = undefined;
61
+ },
62
+ updateDebitCardSummary(draft, action) {
63
+ draft.debitCardSummaries = toDebitCardSummaries(action.payload);
64
+ },
65
+ updateDebitCardSummaryFailure(draft, action) {
66
+ draft.debitCardSummaries = Object.assign(Object.assign({}, chargeCardList_1.initialDebitCardSummaries), { fetchState: 'Error', error: action.payload });
67
+ },
51
68
  fetchChargeCardList(draft) {
52
69
  draft.fetchState = 'In-Progress';
53
70
  draft.error = undefined;
@@ -128,7 +145,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
128
145
  },
129
146
  },
130
147
  });
131
- _a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure;
148
+ _a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure;
132
149
  exports.default = chargeCardList.reducer;
133
150
  // helper
134
151
  const toCreditAccount = (payload) => ({
@@ -144,3 +161,12 @@ const toCreditAccount = (payload) => ({
144
161
  fetchState: 'Completed',
145
162
  error: undefined,
146
163
  });
164
+ const toDebitCardSummaries = (payload) => ({
165
+ currentMonthSpends: (0, amount_1.toAmount)(payload.current_month_spends, payload.currency_code, payload.currency_symbol),
166
+ lastCompletedMonthSpends: (0, amount_1.toAmount)(payload.last_completed_month_spends, payload.currency_code, payload.currency_symbol),
167
+ spendsPercentChange: payload.spends_percent_change,
168
+ lastCompletedMonthStartTime: (0, zeniDayJS_1.date)(payload.last_completed_month_start_time),
169
+ lastCompletedMonthEndTime: (0, zeniDayJS_1.date)(payload.last_completed_month_end_time),
170
+ fetchState: 'Completed',
171
+ error: undefined,
172
+ });
@@ -9,7 +9,7 @@ import { UserRole } from '../../../../entity/userRole/userRoleState';
9
9
  import { RootState } from '../../../../reducer';
10
10
  import { Person } from '../../../people/peopleSelectorTypes';
11
11
  import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
12
- import { ChargeCardListUIState, CreditAccount, ResendRevokeCardInvite } from './chargeCardList';
12
+ import { ChargeCardListUIState, CreditAccount, DebitCardSummaries, ResendRevokeCardInvite } from './chargeCardList';
13
13
  export interface ChargeCardWithUser extends ChargeCard {
14
14
  cardCreatedByUser: User;
15
15
  cardHolderUser: User;
@@ -33,6 +33,9 @@ export interface ChargeCardListSelectorView extends SelectorView {
33
33
  searchText: string;
34
34
  resendCardInvite: ResendRevokeCardInvite;
35
35
  revokeCardInvite: ResendRevokeCardInvite;
36
+ hasCreditCard: boolean;
37
+ hasDebitCard: boolean;
38
+ debitCardSummary?: DebitCardSummaries;
36
39
  unAssignedCredits?: Amount;
37
40
  }
38
41
  export interface MyPendingActivationChargeCardListSelectorView extends SelectorView {
@@ -42,7 +45,7 @@ export interface MyPendingActivationChargeCardListSelectorView extends SelectorV
42
45
  export interface ChargeCardListWithShippingAddressSelectorView extends SelectorView {
43
46
  cards: ChargeCardWithUserAndShippingAddress[];
44
47
  }
45
- export declare const getChargeCardListView: (state: RootState, includeCreditAccountAndCashbackInfo: boolean) => ChargeCardListSelectorView;
48
+ export declare const getChargeCardListView: (state: RootState, includeCreditAccountDebitSummaryAndCashbackInfo: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean) => ChargeCardListSelectorView;
46
49
  export declare const getMyPendingActivationChargeCardListView: (state: RootState) => MyPendingActivationChargeCardListSelectorView;
47
50
  export declare const getMyChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView;
48
51
  /**