@zeniai/client-epic-state 4.10.47 → 4.10.48

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 (69) hide show
  1. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
  2. package/lib/entity/paymentAccount/paymentAccountSelector.js +5 -1
  3. package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
  4. package/lib/entity/tenant/clearAllEpic.js +0 -2
  5. package/lib/epic.d.ts +6 -6
  6. package/lib/epic.js +6 -6
  7. package/lib/index.d.ts +3 -6
  8. package/lib/index.js +15 -18
  9. package/lib/reducer.d.ts +0 -3
  10. package/lib/reducer.js +0 -3
  11. package/lib/view/onboardingView/customerView/epic/plaidConnection/getOnboardingPlaidLinkTokenEpic.js +1 -1
  12. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
  13. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -2
  14. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +1 -2
  15. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +1 -1
  16. package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +2 -2
  17. package/lib/view/settingsView/settingsViewSelector.js +3 -3
  18. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -3
  19. package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
  20. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +2 -3
  21. package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -5
  22. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -3
  23. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +1 -1
  24. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +5 -5
  25. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +1 -1
  26. package/lib/view/spendManagement/billPay/internationalWire/epics/initializeInternationalWireLocalDataEpic.js +2 -2
  27. package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.js +2 -2
  28. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
  29. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +2 -3
  30. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -5
  31. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/getPaymentAccountsEpic.d.ts +1 -1
  32. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/getPaymentAccountsEpic.js +6 -6
  33. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountEpic.d.ts +1 -1
  34. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountEpic.js +6 -6
  35. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.d.ts +1 -1
  36. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +7 -7
  37. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountStatusEpic.d.ts +1 -1
  38. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +7 -7
  39. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -2
  40. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/establishPlaidConnectionEpic.js +7 -7
  41. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/getPlaidLinkTokenEpic.d.ts +2 -2
  42. package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/getPlaidLinkTokenEpic.js +6 -6
  43. package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +1 -1
  44. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +59 -3
  45. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +334 -2
  46. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -3
  47. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -12
  48. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +14 -0
  49. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +2 -3
  50. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +4 -5
  51. package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/updateMileageDetailsEpic.d.ts +2 -3
  52. package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
  53. package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListPayload.d.ts +1 -1
  54. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +1 -1
  55. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
  56. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +2 -3
  57. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +4 -5
  58. package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
  59. package/package.json +1 -1
  60. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +0 -85
  61. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -332
  62. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +0 -2
  63. package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +0 -7
  64. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +0 -21
  65. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +0 -29
  66. /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/paymentAccount.d.ts +0 -0
  67. /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/paymentAccount.js +0 -0
  68. /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/plaidConnection.d.ts +0 -0
  69. /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/plaidConnection.js +0 -0
@@ -1,85 +0,0 @@
1
- import { ZeniAPIStatus } from '../../../responsePayload';
2
- import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
3
- export declare const initialState: PlaidAccountViewState;
4
- export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: any], {
5
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
6
- includeBalances: any;
7
- plaidAccountKeyType: PlaidAccountKeyType;
8
- }, string, never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
9
- paymentAccountIds: string[];
10
- plaidAccountKeyType: PlaidAccountKeyType;
11
- }, string, never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
12
- error: ZeniAPIStatus<Record<string, unknown>>;
13
- plaidAccountKeyType: PlaidAccountKeyType;
14
- }, string, never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType], {
15
- accountId: string;
16
- paymentAccountId: string;
17
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
18
- plaidAccountKeyType: PlaidAccountKeyType;
19
- }, string, never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
20
- paymentAccountIds: string[];
21
- plaidAccountKeyType: PlaidAccountKeyType;
22
- }, string, never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
23
- error: ZeniAPIStatus<Record<string, unknown>>;
24
- plaidAccountKeyType: PlaidAccountKeyType;
25
- }, string, never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
26
- verificationStatusCode: string;
27
- paymentAccountId: string;
28
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
29
- plaidAccountKeyType: PlaidAccountKeyType;
30
- linkTokenType: PlaidLinkTokenType;
31
- }, string, never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
32
- paymentAccountIds: string[];
33
- linkTokenType: PlaidLinkTokenType;
34
- plaidAccountKeyType: PlaidAccountKeyType;
35
- }, string, never, never>, updatePaymentAccountStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
36
- error: ZeniAPIStatus<Record<string, unknown>>;
37
- linkTokenType: PlaidLinkTokenType;
38
- plaidAccountKeyType: PlaidAccountKeyType;
39
- }, string, never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
40
- isLoginRequired: boolean;
41
- paymentAccountId: string;
42
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
43
- plaidAccountKeyType: PlaidAccountKeyType;
44
- linkTokenType: PlaidLinkTokenType;
45
- }, string, never, never>, updatePaymentAccountLoginStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
46
- paymentAccountIds: string[];
47
- linkTokenType: PlaidLinkTokenType;
48
- plaidAccountKeyType: PlaidAccountKeyType;
49
- }, string, never, never>, updatePaymentAccountLoginStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
50
- error: ZeniAPIStatus<Record<string, unknown>>;
51
- linkTokenType: PlaidLinkTokenType;
52
- plaidAccountKeyType: PlaidAccountKeyType;
53
- }, string, never, never>, getPlaidLinkToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined, paymentAccountId?: string | undefined], {
54
- linkTokenType: PlaidLinkTokenType;
55
- paymentAccountId: string | undefined;
56
- plaidAccountKeyType: PlaidAccountKeyType;
57
- }, string, never, never>, getPlaidLinkTokenSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkToken: string, expiration: string, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
58
- linkToken: string;
59
- expiration: string;
60
- linkTokenType: PlaidLinkTokenType;
61
- plaidAccountKeyType: PlaidAccountKeyType;
62
- }, string, never, never>, getPlaidLinkTokenFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
63
- error: ZeniAPIStatus<Record<string, unknown>>;
64
- linkTokenType: PlaidLinkTokenType;
65
- plaidAccountKeyType: PlaidAccountKeyType;
66
- }, string, never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
67
- publicToken: string;
68
- setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
69
- linkTokenType: PlaidLinkTokenType;
70
- plaidAccountKeyType: PlaidAccountKeyType;
71
- }, string, never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
72
- paymentAccountIds: string[];
73
- linkTokenType: PlaidLinkTokenType;
74
- plaidAccountKeyType: PlaidAccountKeyType;
75
- }, string, never, never>, establishPlaidConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
76
- error: ZeniAPIStatus<Record<string, unknown>>;
77
- linkTokenType: PlaidLinkTokenType;
78
- plaidAccountKeyType: PlaidAccountKeyType;
79
- }, string, never, never>, updatePlaidAccountViewAccountDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[allBankAccountIds: string[], paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
80
- allBankAccountIds: string[];
81
- paymentAccountIds: string[];
82
- plaidAccountKeyType: PlaidAccountKeyType;
83
- }, string, never, never>, clearPlaidAccountView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
84
- declare const _default: import("@reduxjs/toolkit").Reducer<PlaidAccountViewState, import("@reduxjs/toolkit").AnyAction>;
85
- export default _default;
@@ -1,332 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearPlaidAccountView = exports.updatePlaidAccountViewAccountDetails = 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.initialState = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const zeniDayJS_1 = require("../../../zeniDayJS");
7
- const plaidAccountViewState_1 = require("./plaidAccountViewState");
8
- exports.initialState = {
9
- spend_management_setup: plaidAccountViewState_1.initialPlaidAccountState,
10
- user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
11
- external_account: plaidAccountViewState_1.initialPlaidAccountState,
12
- };
13
- const plaidAccountView = (0, toolkit_1.createSlice)({
14
- name: 'plaidAccountView',
15
- initialState: exports.initialState,
16
- reducers: {
17
- getPaymentAccounts: {
18
- reducer(draft, action) {
19
- const { plaidAccountKeyType } = action.payload;
20
- draft[plaidAccountKeyType].accountDetails.fetchStatus = {
21
- fetchState: 'In-Progress',
22
- error: undefined,
23
- };
24
- },
25
- prepare(setupViewType, plaidAccountKeyType, includeBalances = true) {
26
- return { payload: { setupViewType, includeBalances, plaidAccountKeyType } };
27
- },
28
- },
29
- getPaymentAccountsSuccess: {
30
- reducer(draft, action) {
31
- const { paymentAccountIds, plaidAccountKeyType } = action.payload;
32
- draft[plaidAccountKeyType].accountDetails.fetchStatus = {
33
- fetchState: 'Completed',
34
- error: undefined,
35
- };
36
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
37
- paymentAccountIds;
38
- },
39
- prepare(paymentAccountIds, plaidAccountKeyType) {
40
- return {
41
- payload: { paymentAccountIds, plaidAccountKeyType },
42
- };
43
- },
44
- },
45
- getPaymentAccountsFailure: {
46
- reducer(draft, action) {
47
- const { error, plaidAccountKeyType } = action.payload;
48
- draft[plaidAccountKeyType].accountDetails.fetchStatus = {
49
- fetchState: 'Error',
50
- error,
51
- };
52
- },
53
- prepare(error, plaidAccountKeyType) {
54
- return {
55
- payload: { error, plaidAccountKeyType },
56
- };
57
- },
58
- },
59
- updatePaymentAccount: {
60
- reducer(draft, action) {
61
- const { plaidAccountKeyType } = action.payload;
62
- draft[plaidAccountKeyType].accountDetails.updateStatus = {
63
- fetchState: 'In-Progress',
64
- error: undefined,
65
- };
66
- },
67
- prepare(accountId, paymentAccountId, setupViewType, plaidAccountKeyType) {
68
- return {
69
- payload: {
70
- accountId,
71
- paymentAccountId,
72
- setupViewType,
73
- plaidAccountKeyType,
74
- },
75
- };
76
- },
77
- },
78
- updatePaymentAccountSuccess: {
79
- reducer(draft, action) {
80
- const { paymentAccountIds, plaidAccountKeyType } = action.payload;
81
- draft[plaidAccountKeyType].accountDetails.updateStatus = {
82
- fetchState: 'Completed',
83
- error: undefined,
84
- };
85
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
86
- paymentAccountIds;
87
- },
88
- prepare(paymentAccountIds, plaidAccountKeyType) {
89
- return {
90
- payload: { paymentAccountIds, plaidAccountKeyType },
91
- };
92
- },
93
- },
94
- updatePaymentAccountFailure: {
95
- reducer(draft, action) {
96
- const { error, plaidAccountKeyType } = action.payload;
97
- draft[plaidAccountKeyType].accountDetails.updateStatus = {
98
- fetchState: 'Error',
99
- error,
100
- };
101
- },
102
- prepare(error, plaidAccountKeyType) {
103
- return {
104
- payload: { error, plaidAccountKeyType },
105
- };
106
- },
107
- },
108
- updatePaymentAccountStatus: {
109
- reducer(draft, action) {
110
- const { linkTokenType, plaidAccountKeyType } = action.payload;
111
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
112
- fetchState: 'In-Progress',
113
- error: undefined,
114
- } });
115
- },
116
- prepare(verificationStatusCode, paymentAccountId, setupViewType, plaidAccountKeyType, linkTokenType) {
117
- return {
118
- payload: {
119
- verificationStatusCode,
120
- paymentAccountId,
121
- setupViewType,
122
- plaidAccountKeyType,
123
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
124
- },
125
- };
126
- },
127
- },
128
- updatePaymentAccountStatusSuccess: {
129
- reducer(draft, action) {
130
- const { paymentAccountIds, linkTokenType, plaidAccountKeyType } = action.payload;
131
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
132
- fetchState: 'Completed',
133
- error: undefined,
134
- } });
135
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
136
- paymentAccountIds;
137
- },
138
- prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
139
- return {
140
- payload: { paymentAccountIds, linkTokenType, plaidAccountKeyType },
141
- };
142
- },
143
- },
144
- updatePaymentAccountStatusFailure: {
145
- reducer(draft, action) {
146
- const { error, linkTokenType, plaidAccountKeyType } = action.payload;
147
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
148
- fetchState: 'Error',
149
- error,
150
- } });
151
- },
152
- prepare(error, linkTokenType, plaidAccountKeyType) {
153
- return {
154
- payload: { error, linkTokenType, plaidAccountKeyType },
155
- };
156
- },
157
- },
158
- updatePaymentAccountLoginStatus: {
159
- reducer(draft, action) {
160
- const { linkTokenType, plaidAccountKeyType } = action.payload;
161
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
162
- fetchState: 'In-Progress',
163
- error: undefined,
164
- } });
165
- },
166
- prepare(isLoginRequired, paymentAccountId, setupViewType, plaidAccountKeyType, linkTokenType) {
167
- return {
168
- payload: {
169
- isLoginRequired,
170
- paymentAccountId,
171
- setupViewType,
172
- plaidAccountKeyType,
173
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
174
- },
175
- };
176
- },
177
- },
178
- updatePaymentAccountLoginStatusSuccess: {
179
- reducer(draft, action) {
180
- const { paymentAccountIds, linkTokenType, plaidAccountKeyType } = action.payload;
181
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
182
- fetchState: 'Completed',
183
- error: undefined,
184
- } });
185
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
186
- paymentAccountIds;
187
- },
188
- prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
189
- return {
190
- payload: { paymentAccountIds, linkTokenType, plaidAccountKeyType },
191
- };
192
- },
193
- },
194
- updatePaymentAccountLoginStatusFailure: {
195
- reducer(draft, action) {
196
- const { error, linkTokenType, plaidAccountKeyType } = action.payload;
197
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
198
- fetchState: 'Error',
199
- error,
200
- } });
201
- },
202
- prepare(error, linkTokenType, plaidAccountKeyType) {
203
- return {
204
- payload: { error, linkTokenType, plaidAccountKeyType },
205
- };
206
- },
207
- },
208
- getPlaidLinkToken: {
209
- reducer(draft, action) {
210
- const { linkTokenType, paymentAccountId, plaidAccountKeyType } = action.payload;
211
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { fetchStatus: {
212
- fetchState: 'In-Progress',
213
- error: undefined,
214
- } });
215
- if (paymentAccountId != null) {
216
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds = [
217
- paymentAccountId,
218
- ];
219
- }
220
- },
221
- prepare(plaidAccountKeyType, linkTokenType, paymentAccountId) {
222
- return {
223
- payload: {
224
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
225
- paymentAccountId: paymentAccountId,
226
- plaidAccountKeyType,
227
- },
228
- };
229
- },
230
- },
231
- getPlaidLinkTokenSuccess: {
232
- prepare(linkToken, expiration, linkTokenType, plaidAccountKeyType) {
233
- return {
234
- payload: { linkToken, expiration, linkTokenType, plaidAccountKeyType },
235
- };
236
- },
237
- reducer(draft, action) {
238
- const { linkToken, expiration, linkTokenType, plaidAccountKeyType } = action.payload;
239
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { fetchStatus: {
240
- fetchState: 'Completed',
241
- error: undefined,
242
- }, linkToken, expiration: (0, zeniDayJS_1.date)(expiration) });
243
- },
244
- },
245
- getPlaidLinkTokenFailure: {
246
- reducer(draft, action) {
247
- const { error, linkTokenType, plaidAccountKeyType } = action.payload;
248
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { fetchStatus: {
249
- fetchState: 'Error',
250
- error,
251
- } });
252
- },
253
- prepare(error, linkTokenType, plaidAccountKeyType) {
254
- return {
255
- payload: { error, linkTokenType, plaidAccountKeyType },
256
- };
257
- },
258
- },
259
- establishPlaidConnection: {
260
- reducer(draft, action) {
261
- const { linkTokenType, plaidAccountKeyType } = action.payload;
262
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
263
- fetchState: 'In-Progress',
264
- error: undefined,
265
- } });
266
- },
267
- prepare(publicToken, plaidAccountKeyType, setupViewType, linkTokenType) {
268
- return {
269
- payload: {
270
- publicToken,
271
- setupViewType,
272
- linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
273
- plaidAccountKeyType,
274
- },
275
- };
276
- },
277
- },
278
- establishPlaidConnectionSuccess: {
279
- reducer(draft, action) {
280
- const { paymentAccountIds, linkTokenType, plaidAccountKeyType } = action.payload;
281
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
282
- fetchState: 'Completed',
283
- error: undefined,
284
- } });
285
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
286
- paymentAccountIds;
287
- },
288
- prepare(paymentAccountIds, linkTokenType, plaidAccountKeyType) {
289
- return {
290
- payload: { paymentAccountIds, linkTokenType, plaidAccountKeyType },
291
- };
292
- },
293
- },
294
- establishPlaidConnectionFailure: {
295
- reducer(draft, action) {
296
- const { linkTokenType, error, plaidAccountKeyType } = action.payload;
297
- draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType] = Object.assign(Object.assign({}, draft[plaidAccountKeyType].plaidConnectionDetails[linkTokenType]), { updateStatus: {
298
- fetchState: 'Error',
299
- error,
300
- } });
301
- },
302
- prepare(error, linkTokenType, plaidAccountKeyType) {
303
- return {
304
- payload: { error, linkTokenType, plaidAccountKeyType },
305
- };
306
- },
307
- },
308
- updatePlaidAccountViewAccountDetails: {
309
- prepare(allBankAccountIds, paymentAccountIds, plaidAccountKeyType) {
310
- return {
311
- payload: { allBankAccountIds, paymentAccountIds, plaidAccountKeyType },
312
- };
313
- },
314
- reducer(draft, action) {
315
- const { allBankAccountIds, paymentAccountIds, plaidAccountKeyType } = action.payload;
316
- draft[plaidAccountKeyType].accountDetails.allBankAccountIds =
317
- allBankAccountIds;
318
- draft[plaidAccountKeyType].accountDetails.paymentAccountIds =
319
- paymentAccountIds;
320
- draft[plaidAccountKeyType].accountDetails.fetchStatus = {
321
- fetchState: 'Completed',
322
- error: undefined,
323
- };
324
- },
325
- },
326
- clearPlaidAccountView(draft) {
327
- Object.assign(draft, exports.initialState);
328
- },
329
- },
330
- });
331
- _a = plaidAccountView.actions, 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.updatePlaidAccountViewAccountDetails = _a.updatePlaidAccountViewAccountDetails, exports.clearPlaidAccountView = _a.clearPlaidAccountView;
332
- exports.default = plaidAccountView.reducer;
@@ -1,2 +0,0 @@
1
- import { PlaidAccountKeyType, PlaidAccountState, PlaidAccountViewState } from './plaidAccountViewState';
2
- export declare function getPlaidAccountwDetails(plaidAccountViewState: PlaidAccountViewState, plaidAccountKeyType: PlaidAccountKeyType): PlaidAccountState;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPlaidAccountwDetails = void 0;
4
- function getPlaidAccountwDetails(plaidAccountViewState, plaidAccountKeyType) {
5
- return plaidAccountViewState[plaidAccountKeyType];
6
- }
7
- exports.getPlaidAccountwDetails = getPlaidAccountwDetails;
@@ -1,21 +0,0 @@
1
- import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
- import { ZeniDate } from '../../../zeniDayJS';
3
- export declare type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
4
- export declare type PlaidAccountKeyType = 'spend_management_setup' | 'user_reimbursement_account' | 'external_account';
5
- export declare type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
6
- linkToken?: string;
7
- expiration?: ZeniDate;
8
- fetchStatus: FetchStateAndError;
9
- updateStatus: FetchStateAndError;
10
- }>;
11
- export declare const initialPlaidAccountState: PlaidAccountState;
12
- export interface PlaidAccountState {
13
- accountDetails: {
14
- fetchStatus: FetchStateAndError;
15
- updateStatus: FetchStateAndError;
16
- paymentAccountIds: ID[];
17
- allBankAccountIds: ID[];
18
- };
19
- plaidConnectionDetails: PlaidConnectionDetails;
20
- }
21
- export declare type PlaidAccountViewState = Record<PlaidAccountKeyType, PlaidAccountState>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialPlaidAccountState = void 0;
4
- exports.initialPlaidAccountState = {
5
- accountDetails: {
6
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
7
- updateStatus: { fetchState: 'Not-Started', error: undefined },
8
- paymentAccountIds: [],
9
- allBankAccountIds: [],
10
- },
11
- plaidConnectionDetails: {
12
- link_account: {
13
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
14
- updateStatus: { fetchState: 'Not-Started', error: undefined },
15
- },
16
- update_account: {
17
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
18
- updateStatus: { fetchState: 'Not-Started', error: undefined },
19
- },
20
- link_account_no_microdeposit: {
21
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
22
- updateStatus: { fetchState: 'Not-Started', error: undefined },
23
- },
24
- link_external_account: {
25
- fetchStatus: { fetchState: 'Not-Started', error: undefined },
26
- updateStatus: { fetchState: 'Not-Started', error: undefined },
27
- },
28
- },
29
- };