@zeniai/client-epic-state 5.0.82-betaAS1 → 5.0.83-betaRR0
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.
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +140 -1
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +328 -5
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +13 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +28 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +225 -4
- package/lib/entity/aiCfo/aiCfoState.js +30 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +175 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +99 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +68 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +23 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +104 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -2
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/entity/tenant/tenantPayload.d.ts +0 -3
- package/lib/entity/tenant/tenantReducer.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.js +3 -23
- package/lib/entity/tenant/tenantState.d.ts +0 -3
- package/lib/epic.d.ts +11 -3
- package/lib/epic.js +11 -3
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +328 -5
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +26 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +27 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +171 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +75 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +64 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +100 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/entity/tenant/tenantReducer.js +2 -22
- package/lib/esm/epic.js +11 -3
- package/lib/esm/index.js +29 -11
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/esm/view/dashboard/dashboardReducer.js +5 -1
- package/lib/esm/view/dashboard/dashboardSelector.js +2 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +70 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +49 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +42 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +72 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +45 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +62 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +47 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +62 -4
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +61 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +69 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -45
- package/lib/index.d.ts +28 -11
- package/lib/index.js +154 -29
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.js +6 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +1 -0
- package/lib/view/dashboard/dashboardSelector.js +2 -1
- package/lib/view/dashboard/dashboardState.d.ts +1 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +74 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +53 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +16 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +76 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +49 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +32 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +45 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +57 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +29 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +79 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +66 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +26 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +51 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +12 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +63 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +42 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +68 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +73 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -46
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -2
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearIssueChargeCard = exports.updateDepositAccountListForCardsFetchStatus = exports.fetchDepositAccountListForCards = exports.updateDepositAccountsInCards = exports.fetchIssueCardPage = exports.updateDebitCardCount = exports.updateChargeCardCount = exports.updateCustomAddressId = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateLastSelfIssuedDebitCardId = exports.updateChargeCardsLocalStore = exports.issueChargeCards = exports.initialState = void 0;
|
|
4
|
+
exports.clearIssueChargeCard = exports.clearAiCardCreationFormDraft = exports.updateAiCardCreationFormDraft = exports.seedAiCardCreationFormDraft = exports.updateDepositAccountListForCardsFetchStatus = exports.fetchDepositAccountListForCards = exports.updateDepositAccountsInCards = exports.fetchIssueCardPage = exports.updateDebitCardCount = exports.updateChargeCardCount = exports.updateCustomAddressId = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateLastIssuedCardIds = exports.updateLastSelfIssuedDebitCardId = exports.updateChargeCardsLocalStore = exports.issueChargeCards = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const buildAiCardCreationFormDraftSeed_1 = require("./buildAiCardCreationFormDraftSeed");
|
|
7
|
+
const deriveAiCardRowsFromTeams_1 = require("./deriveAiCardRowsFromTeams");
|
|
6
8
|
exports.initialState = {
|
|
7
9
|
depositAccountIds: [],
|
|
8
10
|
depositAccountsFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
@@ -18,6 +20,7 @@ exports.initialState = {
|
|
|
18
20
|
},
|
|
19
21
|
activeChargeCardCount: {},
|
|
20
22
|
activeDebitCardCountByDepositAccountId: {},
|
|
23
|
+
lastIssuedCardIds: [],
|
|
21
24
|
};
|
|
22
25
|
const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
23
26
|
name: 'issueChargeCard',
|
|
@@ -38,14 +41,19 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
38
41
|
},
|
|
39
42
|
},
|
|
40
43
|
issueChargeCards: {
|
|
41
|
-
prepare() {
|
|
42
|
-
return { payload: {} };
|
|
44
|
+
prepare(payload) {
|
|
45
|
+
return { payload: payload ?? {} };
|
|
43
46
|
},
|
|
44
|
-
reducer(draft) {
|
|
47
|
+
reducer(draft, action) {
|
|
45
48
|
draft.saveStatus.fetchState = 'In-Progress';
|
|
46
49
|
draft.saveStatus.error = undefined;
|
|
50
|
+
draft.lastIssueSourceChatSessionId = action.payload.sourceChatSessionId;
|
|
51
|
+
draft.lastIssuedCardIds = [];
|
|
47
52
|
},
|
|
48
53
|
},
|
|
54
|
+
updateLastIssuedCardIds(draft, action) {
|
|
55
|
+
draft.lastIssuedCardIds = action.payload;
|
|
56
|
+
},
|
|
49
57
|
updateChargeCardsLocalStore(draft, action) {
|
|
50
58
|
draft.localData = action.payload;
|
|
51
59
|
},
|
|
@@ -53,6 +61,8 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
53
61
|
draft.localData = [...exports.initialState.localData];
|
|
54
62
|
draft.saveStatus = exports.initialState.saveStatus;
|
|
55
63
|
draft.lastSelfIssuedDebitCardId = undefined;
|
|
64
|
+
draft.lastIssueSourceChatSessionId = undefined;
|
|
65
|
+
draft.lastIssuedCardIds = [];
|
|
56
66
|
},
|
|
57
67
|
updateLastSelfIssuedDebitCardId(draft, action) {
|
|
58
68
|
draft.lastSelfIssuedDebitCardId = action.payload;
|
|
@@ -128,10 +138,58 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
128
138
|
draft.depositAccountsFetchState.fetchState = action.payload.fetchState;
|
|
129
139
|
draft.depositAccountsFetchState.error = action.payload.error;
|
|
130
140
|
},
|
|
141
|
+
/**
|
|
142
|
+
* Seed the AI card-creation form draft + companion context from the
|
|
143
|
+
* AI's `interactive_form` payload. Dispatched once when the
|
|
144
|
+
* `CardsCreationInteractiveForm` mounts (or the AI payload arrives).
|
|
145
|
+
*/
|
|
146
|
+
seedAiCardCreationFormDraft: {
|
|
147
|
+
reducer(draft, action) {
|
|
148
|
+
const { draft: nextDraft, context } = (0, buildAiCardCreationFormDraftSeed_1.buildAiCardCreationFormDraftSeed)({
|
|
149
|
+
allUsers: action.payload.allUsers,
|
|
150
|
+
initialData: action.payload.initialData,
|
|
151
|
+
});
|
|
152
|
+
draft.aiCardCreationFormDraft = nextDraft;
|
|
153
|
+
draft.aiCardCreationFormDraftContext = context;
|
|
154
|
+
},
|
|
155
|
+
prepare(allUsers, initialData) {
|
|
156
|
+
return { payload: { allUsers, initialData } };
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Replace the form draft from the component's `watchHandler`. In
|
|
161
|
+
* `review` mode, step-2 `cardRows` is re-derived from `teamRows`
|
|
162
|
+
* selections so user step-1 edits propagate into step 2 without the
|
|
163
|
+
* component owning a separate transition handler. The action's own
|
|
164
|
+
* `cardRows` is passed in as `prevCardRows` (RHF holds the user's
|
|
165
|
+
* latest step-2 edits) so derivation preserves them for teams that
|
|
166
|
+
* are still checked and drops rows whose team got unchecked.
|
|
167
|
+
*/
|
|
168
|
+
updateAiCardCreationFormDraft(draft, action) {
|
|
169
|
+
const context = draft.aiCardCreationFormDraftContext;
|
|
170
|
+
if (context == null || context.mode === 'create') {
|
|
171
|
+
draft.aiCardCreationFormDraft = action.payload;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
draft.aiCardCreationFormDraft = {
|
|
175
|
+
teamRows: action.payload.teamRows,
|
|
176
|
+
cardRows: (0, deriveAiCardRowsFromTeams_1.deriveAiCardRowsFromTeams)({
|
|
177
|
+
teamRows: action.payload.teamRows,
|
|
178
|
+
prevCardRows: action.payload.cardRows,
|
|
179
|
+
allUsers: context.allUsers,
|
|
180
|
+
defaultCardOptionId: context.defaultCardOptionId,
|
|
181
|
+
suggestedOwnerUserIdByTeamId: context.suggestedOwnerUserIdByTeamId,
|
|
182
|
+
}),
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
clearAiCardCreationFormDraft(draft) {
|
|
186
|
+
draft.aiCardCreationFormDraft = undefined;
|
|
187
|
+
draft.aiCardCreationFormDraftContext = undefined;
|
|
188
|
+
},
|
|
131
189
|
clearIssueChargeCard(draft) {
|
|
132
190
|
Object.assign(draft, exports.initialState);
|
|
133
191
|
},
|
|
134
192
|
},
|
|
135
193
|
});
|
|
136
|
-
_a = issueChargeCard.actions, exports.issueChargeCards = _a.issueChargeCards, exports.updateChargeCardsLocalStore = _a.updateChargeCardsLocalStore, exports.updateLastSelfIssuedDebitCardId = _a.updateLastSelfIssuedDebitCardId, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateCustomAddressId = _a.updateCustomAddressId, exports.updateChargeCardCount = _a.updateChargeCardCount, exports.updateDebitCardCount = _a.updateDebitCardCount, exports.fetchIssueCardPage = _a.fetchIssueCardPage, exports.updateDepositAccountsInCards = _a.updateDepositAccountsInCards, exports.fetchDepositAccountListForCards = _a.fetchDepositAccountListForCards, exports.updateDepositAccountListForCardsFetchStatus = _a.updateDepositAccountListForCardsFetchStatus, exports.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
194
|
+
_a = issueChargeCard.actions, exports.issueChargeCards = _a.issueChargeCards, exports.updateChargeCardsLocalStore = _a.updateChargeCardsLocalStore, exports.updateLastSelfIssuedDebitCardId = _a.updateLastSelfIssuedDebitCardId, exports.updateLastIssuedCardIds = _a.updateLastIssuedCardIds, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateCustomAddressId = _a.updateCustomAddressId, exports.updateChargeCardCount = _a.updateChargeCardCount, exports.updateDebitCardCount = _a.updateDebitCardCount, exports.fetchIssueCardPage = _a.fetchIssueCardPage, exports.updateDepositAccountsInCards = _a.updateDepositAccountsInCards, exports.fetchDepositAccountListForCards = _a.fetchDepositAccountListForCards, exports.updateDepositAccountListForCardsFetchStatus = _a.updateDepositAccountListForCardsFetchStatus, exports.seedAiCardCreationFormDraft = _a.seedAiCardCreationFormDraft, exports.updateAiCardCreationFormDraft = _a.updateAiCardCreationFormDraft, exports.clearAiCardCreationFormDraft = _a.clearAiCardCreationFormDraft, exports.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
137
195
|
exports.default = issueChargeCard.reducer;
|
|
@@ -7,6 +7,7 @@ import { RootState } from '../../../../reducer';
|
|
|
7
7
|
import { Person } from '../../../people/peopleSelectorTypes';
|
|
8
8
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
9
9
|
import { CreditAccount } from '../chargeCardList/chargeCardList';
|
|
10
|
+
import { CardsFormDraft } from './aiCardCreationFormDraftTypes';
|
|
10
11
|
import { ActiveChargeCardCount, ActiveDebitCardCountByUserId, IssueChargeCardLocalData } from './issueChargeCardState';
|
|
11
12
|
export interface IssueChargeCardSelectorView extends SelectorView {
|
|
12
13
|
activeChargeCardCount: Record<ID, ActiveChargeCardCount>;
|
|
@@ -25,3 +26,44 @@ export interface IssueChargeCardSelectorView extends SelectorView {
|
|
|
25
26
|
lastSelfIssuedDebitCardId?: ID;
|
|
26
27
|
}
|
|
27
28
|
export declare const getIssueChargeCardView: (state: RootState, isCreditCardEnabled: boolean, isDebitCardEnabled: boolean) => IssueChargeCardSelectorView;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the AI CFO chat session id that triggered the most recent
|
|
31
|
+
* `issueChargeCards` dispatch (if any). Used by the cards list screen to
|
|
32
|
+
* decide whether the in-flight bulk-create originated from an AI CFO
|
|
33
|
+
* interactive form submission and should therefore render a pending
|
|
34
|
+
* placeholder + synthetic AI CFO drawer bubble.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getLastIssueChargeCardsSourceChatSessionId: (state: RootState) => ID | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the ids of the cards created by the most recent successful
|
|
39
|
+
* `issueChargeCards` call. Used by the AI CFO drawer's "Created" success
|
|
40
|
+
* bubble to map back to the actual created entities.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getLastIssuedChargeCardIds: (state: RootState) => ID[];
|
|
43
|
+
/**
|
|
44
|
+
* Returns the save-status fetch state for the most recent `issueChargeCards`
|
|
45
|
+
* dispatch. Useful for gating pending placeholder rows on `In-Progress` /
|
|
46
|
+
* swapping them out on `Completed`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const getIssueChargeCardsSaveStatus: (state: RootState) => FetchStateAndError;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the number of card rows currently being bulk-issued via the most
|
|
51
|
+
* recent `issueChargeCards` dispatch. Mirrors `localData.length` while the
|
|
52
|
+
* call is in flight so the cards list screen can render N skeleton rows at
|
|
53
|
+
* the top of the table.
|
|
54
|
+
*/
|
|
55
|
+
export declare const getInFlightIssueChargeCardsCount: (state: RootState) => number;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the current AI card-creation form draft, or `undefined` before
|
|
58
|
+
* `seedAiCardCreationFormDraft` runs / after `clearAiCardCreationFormDraft`.
|
|
59
|
+
* Used by the connected screens to hydrate the
|
|
60
|
+
* `CardsCreationInteractiveForm`'s RHF.
|
|
61
|
+
*/
|
|
62
|
+
export declare const getAiCardCreationFormDraft: (state: RootState) => CardsFormDraft | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Project the AI card-creation form draft into the wire-ready
|
|
65
|
+
* `IssueChargeCardLocalData[]` payload `issueChargeCardEpic` expects.
|
|
66
|
+
* Returns an empty array when the draft is absent so callers can
|
|
67
|
+
* short-circuit submission without dispatching a no-op bulk POST.
|
|
68
|
+
*/
|
|
69
|
+
export declare const selectIssueChargeCardLocalDataFromDraft: (state: RootState) => IssueChargeCardLocalData[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIssueChargeCardView = void 0;
|
|
3
|
+
exports.selectIssueChargeCardLocalDataFromDraft = exports.getAiCardCreationFormDraft = exports.getInFlightIssueChargeCardsCount = exports.getIssueChargeCardsSaveStatus = exports.getLastIssuedChargeCardIds = exports.getLastIssueChargeCardsSourceChatSessionId = exports.getIssueChargeCardView = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
6
6
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
@@ -8,6 +8,7 @@ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depo
|
|
|
8
8
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
9
|
const addressViewSelector_1 = require("../../../addressView/addressViewSelector");
|
|
10
10
|
const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
|
|
11
|
+
const toIssueChargeCardLocalDataFromDraft_1 = require("./toIssueChargeCardLocalDataFromDraft");
|
|
11
12
|
const getIssueChargeCardView = (state, isCreditCardEnabled, isDebitCardEnabled) => {
|
|
12
13
|
const { issueChargeCardState, userState, userRoleState, userListViewState, chargeCardConfigState, chargeCardListState, addressState, classState, depositAccountState, classListState, } = state;
|
|
13
14
|
const userListSelectorView = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'cardHolderCandidate');
|
|
@@ -97,3 +98,69 @@ const getIssueChargeCardView = (state, isCreditCardEnabled, isDebitCardEnabled)
|
|
|
97
98
|
};
|
|
98
99
|
};
|
|
99
100
|
exports.getIssueChargeCardView = getIssueChargeCardView;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the AI CFO chat session id that triggered the most recent
|
|
103
|
+
* `issueChargeCards` dispatch (if any). Used by the cards list screen to
|
|
104
|
+
* decide whether the in-flight bulk-create originated from an AI CFO
|
|
105
|
+
* interactive form submission and should therefore render a pending
|
|
106
|
+
* placeholder + synthetic AI CFO drawer bubble.
|
|
107
|
+
*/
|
|
108
|
+
const getLastIssueChargeCardsSourceChatSessionId = (state) => {
|
|
109
|
+
return state.issueChargeCardState.lastIssueSourceChatSessionId;
|
|
110
|
+
};
|
|
111
|
+
exports.getLastIssueChargeCardsSourceChatSessionId = getLastIssueChargeCardsSourceChatSessionId;
|
|
112
|
+
/**
|
|
113
|
+
* Returns the ids of the cards created by the most recent successful
|
|
114
|
+
* `issueChargeCards` call. Used by the AI CFO drawer's "Created" success
|
|
115
|
+
* bubble to map back to the actual created entities.
|
|
116
|
+
*/
|
|
117
|
+
const getLastIssuedChargeCardIds = (state) => {
|
|
118
|
+
return state.issueChargeCardState.lastIssuedCardIds;
|
|
119
|
+
};
|
|
120
|
+
exports.getLastIssuedChargeCardIds = getLastIssuedChargeCardIds;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the save-status fetch state for the most recent `issueChargeCards`
|
|
123
|
+
* dispatch. Useful for gating pending placeholder rows on `In-Progress` /
|
|
124
|
+
* swapping them out on `Completed`.
|
|
125
|
+
*/
|
|
126
|
+
const getIssueChargeCardsSaveStatus = (state) => {
|
|
127
|
+
return state.issueChargeCardState.saveStatus;
|
|
128
|
+
};
|
|
129
|
+
exports.getIssueChargeCardsSaveStatus = getIssueChargeCardsSaveStatus;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the number of card rows currently being bulk-issued via the most
|
|
132
|
+
* recent `issueChargeCards` dispatch. Mirrors `localData.length` while the
|
|
133
|
+
* call is in flight so the cards list screen can render N skeleton rows at
|
|
134
|
+
* the top of the table.
|
|
135
|
+
*/
|
|
136
|
+
const getInFlightIssueChargeCardsCount = (state) => {
|
|
137
|
+
if (state.issueChargeCardState.saveStatus.fetchState !== 'In-Progress') {
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
return state.issueChargeCardState.localData.length;
|
|
141
|
+
};
|
|
142
|
+
exports.getInFlightIssueChargeCardsCount = getInFlightIssueChargeCardsCount;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the current AI card-creation form draft, or `undefined` before
|
|
145
|
+
* `seedAiCardCreationFormDraft` runs / after `clearAiCardCreationFormDraft`.
|
|
146
|
+
* Used by the connected screens to hydrate the
|
|
147
|
+
* `CardsCreationInteractiveForm`'s RHF.
|
|
148
|
+
*/
|
|
149
|
+
const getAiCardCreationFormDraft = (state) => {
|
|
150
|
+
return state.issueChargeCardState.aiCardCreationFormDraft;
|
|
151
|
+
};
|
|
152
|
+
exports.getAiCardCreationFormDraft = getAiCardCreationFormDraft;
|
|
153
|
+
/**
|
|
154
|
+
* Project the AI card-creation form draft into the wire-ready
|
|
155
|
+
* `IssueChargeCardLocalData[]` payload `issueChargeCardEpic` expects.
|
|
156
|
+
* Returns an empty array when the draft is absent so callers can
|
|
157
|
+
* short-circuit submission without dispatching a no-op bulk POST.
|
|
158
|
+
*/
|
|
159
|
+
const selectIssueChargeCardLocalDataFromDraft = (state) => {
|
|
160
|
+
const draft = state.issueChargeCardState.aiCardCreationFormDraft;
|
|
161
|
+
if (draft == null) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
return (0, toIssueChargeCardLocalDataFromDraft_1.toIssueChargeCardLocalDataFromDraft)(draft);
|
|
165
|
+
};
|
|
166
|
+
exports.selectIssueChargeCardLocalDataFromDraft = selectIssueChargeCardLocalDataFromDraft;
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
2
|
import { FetchStateAndError, FetchedState, ID } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { ChargeCardType, CreditCardCodeType, CreditLimitFrequencyCodeType, DebitCardCodeType, ShippingAddressType } from '../../../../entity/chargeCard/chargeCard';
|
|
4
|
+
import { AiCardCreationFormDraftSeedContext, CardsFormDraft } from './aiCardCreationFormDraftTypes';
|
|
4
5
|
export interface IssueChargeCardState extends FetchedState {
|
|
5
6
|
activeChargeCardCount: Record<ID, ActiveChargeCardCount>;
|
|
6
7
|
activeDebitCardCountByDepositAccountId: Record<ID, ActiveDebitCardCountByUserId>;
|
|
7
8
|
depositAccountIds: ID[];
|
|
8
9
|
depositAccountsFetchState: FetchStateAndError;
|
|
10
|
+
lastIssuedCardIds: ID[];
|
|
9
11
|
localData: IssueChargeCardLocalData[];
|
|
10
12
|
saveStatus: FetchStateAndError;
|
|
13
|
+
/**
|
|
14
|
+
* Current AI CFO card-creation form draft. Hydrates the
|
|
15
|
+
* `CardsCreationInteractiveForm` and is replaced wholesale on every
|
|
16
|
+
* `watchHandler` tick via `updateAiCardCreationFormDraft`. `undefined`
|
|
17
|
+
* before `seedAiCardCreationFormDraft` runs and after
|
|
18
|
+
* `clearAiCardCreationFormDraft`.
|
|
19
|
+
*/
|
|
20
|
+
aiCardCreationFormDraft?: CardsFormDraft;
|
|
21
|
+
/**
|
|
22
|
+
* Companion seed context for `aiCardCreationFormDraft`. The reducer
|
|
23
|
+
* uses this to re-derive step-2 `cardRows` from step-1 `teamRows`
|
|
24
|
+
* selections on subsequent `updateAiCardCreationFormDraft` dispatches
|
|
25
|
+
* without the component re-passing the AI's full universe.
|
|
26
|
+
*/
|
|
27
|
+
aiCardCreationFormDraftContext?: AiCardCreationFormDraftSeedContext;
|
|
28
|
+
lastIssueSourceChatSessionId?: ID;
|
|
11
29
|
lastSelfIssuedDebitCardId?: ID;
|
|
12
30
|
}
|
|
13
31
|
export interface ActiveChargeCardCount {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardsFormDraft } from './aiCardCreationFormDraftTypes';
|
|
2
|
+
import { IssueChargeCardLocalData } from './issueChargeCardState';
|
|
3
|
+
/**
|
|
4
|
+
* Convert a `CardsFormDraft` into the `IssueChargeCardLocalData[]`
|
|
5
|
+
* payload `issueChargeCardEpic` expects in
|
|
6
|
+
* `state.issueChargeCardState.localData`.
|
|
7
|
+
*
|
|
8
|
+
* Returns an empty array when `cardRows` is empty so callers can
|
|
9
|
+
* short-circuit without dispatching a no-op bulk POST.
|
|
10
|
+
*/
|
|
11
|
+
export declare const toIssueChargeCardLocalDataFromDraft: (draft: CardsFormDraft) => IssueChargeCardLocalData[];
|
package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toIssueChargeCardLocalDataFromDraft = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Default credit limit frequency emitted on the wire when the AI CFO
|
|
6
|
+
* card creation form is submitted. The interactive form has no
|
|
7
|
+
* frequency field today (v1 product decision: AI CFO only ever issues
|
|
8
|
+
* monthly virtual credit cards).
|
|
9
|
+
*/
|
|
10
|
+
const DEFAULT_FREQUENCY = 'monthly';
|
|
11
|
+
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
12
|
+
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
13
|
+
/**
|
|
14
|
+
* Map a single AI card-creation row to the `IssueChargeCardLocalData`
|
|
15
|
+
* shape consumed by `issueChargeCardEpic`.
|
|
16
|
+
*
|
|
17
|
+
* AI CFO only issues `business_virtual_credit_card`s in v1, so:
|
|
18
|
+
* - `chargeCardType` is hard-coded to `'credit_card'`
|
|
19
|
+
* - `creditCard.cardType` is hard-coded to `'business_virtual_credit_card'`
|
|
20
|
+
* - the physicalCard / debitCard.* slots are populated with empty
|
|
21
|
+
* defaults that the epic ignores.
|
|
22
|
+
*
|
|
23
|
+
* The form's `cardOptionId` is intentionally ignored: it's a UI-only
|
|
24
|
+
* selector ("physical" / "virtual") that the AI uses to suggest a
|
|
25
|
+
* flavour, but the bulk-create wire contract only supports the virtual
|
|
26
|
+
* branch in this iteration.
|
|
27
|
+
*/
|
|
28
|
+
const mapCardRow = (row) => {
|
|
29
|
+
const ownerUserId = row.owner.selectedUser?.userId;
|
|
30
|
+
return {
|
|
31
|
+
lineId: row.id,
|
|
32
|
+
chargeCardType: 'credit_card',
|
|
33
|
+
creditCard: {
|
|
34
|
+
cardType: 'business_virtual_credit_card',
|
|
35
|
+
virtualCard: {
|
|
36
|
+
cardName: row.label,
|
|
37
|
+
frequency: DEFAULT_FREQUENCY,
|
|
38
|
+
userIds: ownerUserId != null ? [ownerUserId] : [],
|
|
39
|
+
amount: {
|
|
40
|
+
amount: row.recommendedLimit ?? 0,
|
|
41
|
+
currencyCode: DEFAULT_CURRENCY_CODE,
|
|
42
|
+
currencySymbol: DEFAULT_CURRENCY_SYMBOL,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
physicalCard: {
|
|
46
|
+
cardName: '',
|
|
47
|
+
frequency: DEFAULT_FREQUENCY,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
debitCard: {
|
|
51
|
+
cardType: 'business_virtual_debit_card',
|
|
52
|
+
virtualCard: {
|
|
53
|
+
cardName: '',
|
|
54
|
+
frequency: DEFAULT_FREQUENCY,
|
|
55
|
+
userIds: [],
|
|
56
|
+
},
|
|
57
|
+
physicalCard: {
|
|
58
|
+
cardName: '',
|
|
59
|
+
frequency: DEFAULT_FREQUENCY,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Convert a `CardsFormDraft` into the `IssueChargeCardLocalData[]`
|
|
66
|
+
* payload `issueChargeCardEpic` expects in
|
|
67
|
+
* `state.issueChargeCardState.localData`.
|
|
68
|
+
*
|
|
69
|
+
* Returns an empty array when `cardRows` is empty so callers can
|
|
70
|
+
* short-circuit without dispatching a no-op bulk POST.
|
|
71
|
+
*/
|
|
72
|
+
const toIssueChargeCardLocalDataFromDraft = (draft) => draft.cardRows.map(mapCardRow);
|
|
73
|
+
exports.toIssueChargeCardLocalDataFromDraft = toIssueChargeCardLocalDataFromDraft;
|
|
@@ -15,6 +15,6 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
|
|
|
15
15
|
}, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
16
|
allocation_percentages: Record<string, number>;
|
|
17
17
|
custom_corporate_id: string | null;
|
|
18
|
-
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">,
|
|
18
|
+
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">;
|
|
19
19
|
declare const _default: import("redux").Reducer<TreasurySetupViewState>;
|
|
20
20
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewed = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
10
10
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -40,14 +40,6 @@ exports.initialState = {
|
|
|
40
40
|
fetchState: 'Not-Started',
|
|
41
41
|
error: undefined,
|
|
42
42
|
},
|
|
43
|
-
updateTreasuryPromoIntroClosedByOutsideClickStatus: {
|
|
44
|
-
fetchState: 'Not-Started',
|
|
45
|
-
error: undefined,
|
|
46
|
-
},
|
|
47
|
-
updateTreasuryPromoRemindMeLaterClickedStatus: {
|
|
48
|
-
fetchState: 'Not-Started',
|
|
49
|
-
error: undefined,
|
|
50
|
-
},
|
|
51
43
|
updateTreasuryVideoViewedStatus: {
|
|
52
44
|
fetchState: 'Not-Started',
|
|
53
45
|
error: undefined,
|
|
@@ -305,48 +297,12 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
|
|
|
305
297
|
error: action.payload,
|
|
306
298
|
};
|
|
307
299
|
},
|
|
308
|
-
updateTreasuryPromoRemindMeLaterClicked(draft) {
|
|
309
|
-
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
310
|
-
fetchState: 'In-Progress',
|
|
311
|
-
error: undefined,
|
|
312
|
-
};
|
|
313
|
-
},
|
|
314
|
-
updateTreasuryPromoRemindMeLaterClickedSuccess(draft) {
|
|
315
|
-
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
316
|
-
fetchState: 'Completed',
|
|
317
|
-
error: undefined,
|
|
318
|
-
};
|
|
319
|
-
},
|
|
320
|
-
updateTreasuryPromoRemindMeLaterClickedFailure(draft, action) {
|
|
321
|
-
draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
|
|
322
|
-
fetchState: 'Error',
|
|
323
|
-
error: action.payload,
|
|
324
|
-
};
|
|
325
|
-
},
|
|
326
|
-
updateTreasuryPromoIntroClosedByOutsideClick(draft) {
|
|
327
|
-
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
328
|
-
fetchState: 'In-Progress',
|
|
329
|
-
error: undefined,
|
|
330
|
-
};
|
|
331
|
-
},
|
|
332
|
-
updateTreasuryPromoIntroClosedByOutsideClickSuccess(draft) {
|
|
333
|
-
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
334
|
-
fetchState: 'Completed',
|
|
335
|
-
error: undefined,
|
|
336
|
-
};
|
|
337
|
-
},
|
|
338
|
-
updateTreasuryPromoIntroClosedByOutsideClickFailure(draft, action) {
|
|
339
|
-
draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
|
|
340
|
-
fetchState: 'Error',
|
|
341
|
-
error: action.payload,
|
|
342
|
-
};
|
|
343
|
-
},
|
|
344
300
|
clearTreasurySetupView(draft) {
|
|
345
301
|
Object.assign(draft, exports.initialState);
|
|
346
302
|
},
|
|
347
303
|
},
|
|
348
304
|
});
|
|
349
|
-
_a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.
|
|
305
|
+
_a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure;
|
|
350
306
|
exports.default = treasurySetupView.reducer;
|
|
351
307
|
function mapTreasuryFundsPayloadToFundData(fundsPayload) {
|
|
352
308
|
return fundsPayload.funds.map((fund) => ({
|
|
@@ -16,8 +16,6 @@ export interface TreasurySetupViewState extends FetchedState {
|
|
|
16
16
|
fundAllocationOptions: FundAllocationOption[];
|
|
17
17
|
fundsDetails: FundData[];
|
|
18
18
|
};
|
|
19
|
-
updateTreasuryPromoIntroClosedByOutsideClickStatus: FetchStateAndError;
|
|
20
|
-
updateTreasuryPromoRemindMeLaterClickedStatus: FetchStateAndError;
|
|
21
19
|
updateTreasuryVideoViewedStatus: FetchStateAndError;
|
|
22
20
|
treasuryTermsDetails?: {
|
|
23
21
|
fetchStatus: FetchStateAndError;
|
|
@@ -14,7 +14,7 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
14
14
|
archived?: TaskPayload[];
|
|
15
15
|
deleted?: TaskPayload[];
|
|
16
16
|
snoozed?: TaskPayload[];
|
|
17
|
-
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "
|
|
17
|
+
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "archived" | "live" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
18
|
fetchState: FetchState;
|
|
19
19
|
error?: ZeniAPIStatus;
|
|
20
20
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.83-betaRR0",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
|
|
5
|
-
import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess, } from '../treasurySetupViewReducer';
|
|
6
|
-
export const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoIntroClosedByOutsideClick.match), switchMap(() => {
|
|
7
|
-
return zeniAPI
|
|
8
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
|
|
9
|
-
.pipe(mergeMap((response) => {
|
|
10
|
-
if (isSuccessStatus(response)) {
|
|
11
|
-
return of(updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser(), updateTreasuryPromoIntroClosedByOutsideClickSuccess());
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return of(updateTreasuryPromoIntroClosedByOutsideClickFailure(response.status));
|
|
15
|
-
}
|
|
16
|
-
}), catchError((error) => of(updateTreasuryPromoIntroClosedByOutsideClickFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
|
|
17
|
-
JSON.stringify(error))))));
|
|
18
|
-
}));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
|
|
5
|
-
import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess, } from '../treasurySetupViewReducer';
|
|
6
|
-
export const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoRemindMeLaterClicked.match), switchMap(() => {
|
|
7
|
-
return zeniAPI
|
|
8
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
|
|
9
|
-
.pipe(mergeMap((response) => {
|
|
10
|
-
if (isSuccessStatus(response)) {
|
|
11
|
-
return of(updateTreasuryPromoRemindMeLaterClickedForLoggedInUser(), updateTreasuryPromoRemindMeLaterClickedSuccess());
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return of(updateTreasuryPromoRemindMeLaterClickedFailure(response.status));
|
|
15
|
-
}
|
|
16
|
-
}), catchError((error) => of(updateTreasuryPromoRemindMeLaterClickedFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
|
|
17
|
-
JSON.stringify(error))))));
|
|
18
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
-
import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess } from '../treasurySetupViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClick> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickSuccess> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickFailure>;
|
|
8
|
-
export declare const updateTreasuryPromoIntroClosedByOutsideClickEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
-
const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
return zeniAPI
|
|
11
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
|
|
12
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
-
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickSuccess)());
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)(response.status));
|
|
18
|
-
}
|
|
19
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
|
|
20
|
-
JSON.stringify(error))))));
|
|
21
|
-
}));
|
|
22
|
-
exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = updateTreasuryPromoIntroClosedByOutsideClickEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
-
import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess } from '../treasurySetupViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof updateTreasuryPromoRemindMeLaterClicked> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedForLoggedInUser> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedSuccess> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedFailure>;
|
|
8
|
-
export declare const updateTreasuryPromoRemindMeLaterClickedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTreasuryPromoRemindMeLaterClickedEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
9
|
-
const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
return zeniAPI
|
|
11
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
|
|
12
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
14
|
-
return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoRemindMeLaterClickedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedSuccess)());
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)(response.status));
|
|
18
|
-
}
|
|
19
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
|
|
20
|
-
JSON.stringify(error))))));
|
|
21
|
-
}));
|
|
22
|
-
exports.updateTreasuryPromoRemindMeLaterClickedEpic = updateTreasuryPromoRemindMeLaterClickedEpic;
|