@zeniai/client-epic-state 5.0.83-betaRR5 → 5.0.83
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/entity/aiCfo/aiCfoPayload.d.ts +4 -1
- package/lib/entity/aiCfo/aiCfoReducer.js +17 -4
- package/lib/entity/aiCfo/aiCfoState.d.ts +19 -0
- package/lib/entity/aiCfo/aiCfoState.js +8 -1
- package/lib/entity/cardPolicy/cardPolicyReducer.js +99 -9
- package/lib/entity/cardPolicy/cardPolicySelector.js +4 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +2 -3
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +10 -4
- package/lib/epic.d.ts +12 -15
- package/lib/epic.js +12 -15
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +18 -5
- package/lib/esm/entity/aiCfo/aiCfoState.js +7 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +99 -9
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +4 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +11 -5
- package/lib/esm/epic.js +12 -15
- package/lib/esm/index.js +6 -21
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +19 -138
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -18
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +5 -38
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +0 -23
- package/lib/index.d.ts +7 -28
- package/lib/index.js +14 -68
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +1 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +20 -139
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -20
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +0 -28
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +1 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +6 -39
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +1 -26
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +0 -16
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -328
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -120
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -60
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -118
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -33
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -385
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -33
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -17
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -144
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -148
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -112
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -101
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -71
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -42
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -69
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -45
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -65
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -64
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -333
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -124
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +0 -28
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -64
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +0 -17
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -122
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +0 -23
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -37
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -391
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +0 -24
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +0 -253
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -21
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +0 -66
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -151
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +0 -30
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -152
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +0 -26
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -116
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +0 -35
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -105
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +0 -23
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -75
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -38
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +0 -76
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -46
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +0 -28
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -73
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +0 -23
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -49
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -69
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -68
package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearCreateCardPolicy = exports.
|
|
4
|
+
exports.clearCreateCardPolicy = exports.updateCreateCardPolicyTemplateRequestState = exports.createCardPolicyTemplates = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const applyAiCardPolicyFormDraftUpdate_1 = require("./applyAiCardPolicyFormDraftUpdate");
|
|
7
|
-
const applyExtractedPolicyToAiCardPolicyDraft_1 = require("./applyExtractedPolicyToAiCardPolicyDraft");
|
|
8
|
-
const applyExtractedPolicyToManualCardPolicyDraft_1 = require("./applyExtractedPolicyToManualCardPolicyDraft");
|
|
9
|
-
const applyUploadPlanToAiCardPolicyDraft_1 = require("./applyUploadPlanToAiCardPolicyDraft");
|
|
10
|
-
const buildAiCardPolicyFormDraftSeed_1 = require("./buildAiCardPolicyFormDraftSeed");
|
|
11
|
-
const buildManualCardPolicyFormDraftSeed_1 = require("./buildManualCardPolicyFormDraftSeed");
|
|
12
|
-
const cardPolicyFormDraftTypes_1 = require("./cardPolicyFormDraftTypes");
|
|
13
6
|
exports.initialState = {
|
|
14
7
|
createCardPolicyTemplateRequestState: {
|
|
15
8
|
fetchState: 'Not-Started',
|
|
@@ -22,13 +15,30 @@ const createCardPolicy = (0, toolkit_1.createSlice)({
|
|
|
22
15
|
name: 'createCardPolicy',
|
|
23
16
|
initialState: exports.initialState,
|
|
24
17
|
reducers: {
|
|
18
|
+
/**
|
|
19
|
+
* Kick off the bulk `POST /cards/1.0/policy-templates` request.
|
|
20
|
+
* Single-create callers pass a length-1 `templates` array; AI CFO
|
|
21
|
+
* multi-policy callers pass N entries in one round-trip. Setting the
|
|
22
|
+
* request state to `In-Progress` synchronously here matches how every
|
|
23
|
+
* other "create" slice in this repo wires its kickoff (see
|
|
24
|
+
* `issueChargeCards`, `fetchChargeCardConfig`, etc.).
|
|
25
|
+
*
|
|
26
|
+
* The accompanying epic listens for this action, performs the POST,
|
|
27
|
+
* dispatches one `updateCreatedCardPolicyTemplate` on the entity
|
|
28
|
+
* slice per row returned in `templates_created`, and dispatches
|
|
29
|
+
* `updateCreateCardPolicyTemplateRequestState` here to flip the
|
|
30
|
+
* lifecycle to `Completed` (with the created ids + any per-item
|
|
31
|
+
* errors) or `Error` (transport-level failure).
|
|
32
|
+
*/
|
|
25
33
|
createCardPolicyTemplates: {
|
|
26
34
|
reducer(draft, action) {
|
|
27
35
|
draft.createCardPolicyTemplateRequestState.fetchState = 'In-Progress';
|
|
28
36
|
draft.createCardPolicyTemplateRequestState.error = undefined;
|
|
29
37
|
draft.lastCreatedCardPolicyTemplateIds = [];
|
|
30
38
|
draft.lastCreateCardPolicyTemplateErrors = [];
|
|
31
|
-
//
|
|
39
|
+
// Mirror `lastIssueSourceChatSessionId` on the cards side: the list
|
|
40
|
+
// screen and AI CFO drawer both consult this to decide whether the
|
|
41
|
+
// in-flight create belongs to the active AI CFO conversation.
|
|
32
42
|
draft.lastCreateCardPolicySourceChatSessionId =
|
|
33
43
|
action.payload.sourceChatSessionId;
|
|
34
44
|
},
|
|
@@ -47,139 +57,10 @@ const createCardPolicy = (0, toolkit_1.createSlice)({
|
|
|
47
57
|
draft.lastCreateCardPolicyTemplateErrors = action.payload.perItemErrors;
|
|
48
58
|
}
|
|
49
59
|
},
|
|
50
|
-
/**
|
|
51
|
-
* Seed the AI CFO card-policy form draft + companion context from
|
|
52
|
-
* the AI's `interactive_form` payload. Dispatched by
|
|
53
|
-
* `seedAiCardPolicyFormDraftEpic` when the AI answer lands.
|
|
54
|
-
*/
|
|
55
|
-
seedAiCardPolicyFormDraft: {
|
|
56
|
-
reducer(draft, action) {
|
|
57
|
-
const { draft: nextDraft, context } = (0, buildAiCardPolicyFormDraftSeed_1.buildAiCardPolicyFormDraftSeed)({
|
|
58
|
-
initialData: action.payload.initialData,
|
|
59
|
-
cardsMasterList: action.payload.cardsMasterList,
|
|
60
|
-
categorySearchOptions: action.payload.mccCategories.map(cardPolicyFormDraftTypes_1.toMccCategoryLike),
|
|
61
|
-
suggestedAllowMerchants: action.payload.suggestedAllowMerchants,
|
|
62
|
-
suggestedBlockMerchants: action.payload.suggestedBlockMerchants,
|
|
63
|
-
suggestedAllowCategories: (action.payload.suggestedAllowCategories ?? []).map(cardPolicyFormDraftTypes_1.toMccCategoryLike),
|
|
64
|
-
suggestedBlockCategories: (action.payload.suggestedBlockCategories ?? []).map(cardPolicyFormDraftTypes_1.toMccCategoryLike),
|
|
65
|
-
});
|
|
66
|
-
draft.aiCardPolicyFormDraft = nextDraft;
|
|
67
|
-
draft.aiCardPolicyFormDraftContext = context;
|
|
68
|
-
},
|
|
69
|
-
prepare(payload) {
|
|
70
|
-
return { payload };
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* Replace the AI card-policy form draft from the component's
|
|
75
|
-
* `watchHandler`. Delegates to `applyAiCardPolicyFormDraftUpdate`
|
|
76
|
-
* which:
|
|
77
|
-
* - guided: mirrors review-chip diffs into source slices then
|
|
78
|
-
* re-derives `policiesReview` from those slices,
|
|
79
|
-
* - upload: patches "Applied to Cards" chip group from
|
|
80
|
-
* `cardSelections`,
|
|
81
|
-
* - auto: pass-through.
|
|
82
|
-
*/
|
|
83
|
-
updateAiCardPolicyFormDraft(draft, action) {
|
|
84
|
-
draft.aiCardPolicyFormDraft = (0, applyAiCardPolicyFormDraftUpdate_1.applyAiCardPolicyFormDraftUpdate)({
|
|
85
|
-
prev: draft.aiCardPolicyFormDraft,
|
|
86
|
-
next: action.payload,
|
|
87
|
-
context: draft.aiCardPolicyFormDraftContext,
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
/**
|
|
91
|
-
* Apply a fresh `wizardPlan` returned by the upload-mode
|
|
92
|
-
* recommendation API to the AI draft. No-op when the draft isn't
|
|
93
|
-
* in `upload` mode.
|
|
94
|
-
*/
|
|
95
|
-
updateAiCardPolicyFormDraftFromUploadPlan: {
|
|
96
|
-
reducer(draft, action) {
|
|
97
|
-
if (draft.aiCardPolicyFormDraft == null ||
|
|
98
|
-
draft.aiCardPolicyFormDraftContext == null) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const { draft: nextDraft, context } = (0, applyUploadPlanToAiCardPolicyDraft_1.applyUploadPlanToAiCardPolicyDraft)({
|
|
102
|
-
current: draft.aiCardPolicyFormDraft,
|
|
103
|
-
context: draft.aiCardPolicyFormDraftContext,
|
|
104
|
-
wizardPlan: action.payload.wizardPlan,
|
|
105
|
-
source: action.payload.source,
|
|
106
|
-
});
|
|
107
|
-
draft.aiCardPolicyFormDraft = nextDraft;
|
|
108
|
-
draft.aiCardPolicyFormDraftContext = context;
|
|
109
|
-
},
|
|
110
|
-
prepare(wizardPlan, source) {
|
|
111
|
-
return { payload: { wizardPlan, source } };
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
/**
|
|
115
|
-
* Apply an extracted policy document response to the AI draft.
|
|
116
|
-
* Dispatched by the extract-success bridge epic when the upload
|
|
117
|
-
* was kicked off from inside an AI CFO card-policy form.
|
|
118
|
-
*/
|
|
119
|
-
applyExtractedPolicyToAiCardPolicyDraft: {
|
|
120
|
-
reducer(draft, action) {
|
|
121
|
-
if (draft.aiCardPolicyFormDraft == null) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
draft.aiCardPolicyFormDraft = (0, applyExtractedPolicyToAiCardPolicyDraft_1.applyExtractedPolicyToAiCardPolicyDraft)({
|
|
125
|
-
current: draft.aiCardPolicyFormDraft,
|
|
126
|
-
extracted: action.payload.extracted,
|
|
127
|
-
vendorSearchOptions: action.payload.vendorSearchOptions,
|
|
128
|
-
categorySearchOptions: action.payload.categorySearchOptions,
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
prepare(payload) {
|
|
132
|
-
return { payload };
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
clearAiCardPolicyFormDraft(draft) {
|
|
136
|
-
draft.aiCardPolicyFormDraft = undefined;
|
|
137
|
-
draft.aiCardPolicyFormDraftContext = undefined;
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Seed the manual `CardPolicyCreatePage` form draft from the BE
|
|
141
|
-
* suggested merchant/category seeds + the cards master list.
|
|
142
|
-
* Dispatched on the create-page mount.
|
|
143
|
-
*/
|
|
144
|
-
seedManualCardPolicyFormDraft: {
|
|
145
|
-
reducer(draft, action) {
|
|
146
|
-
draft.manualCardPolicyFormDraft = (0, buildManualCardPolicyFormDraftSeed_1.buildManualCardPolicyFormDraftSeed)(action.payload);
|
|
147
|
-
},
|
|
148
|
-
prepare(payload) {
|
|
149
|
-
return { payload };
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
updateManualCardPolicyFormDraft(draft, action) {
|
|
153
|
-
draft.manualCardPolicyFormDraft = action.payload;
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Apply an extracted policy document response to the manual draft.
|
|
157
|
-
* Dispatched by the extract-success bridge epic when the upload was
|
|
158
|
-
* kicked off from the manual `CardPolicyCreatePage`.
|
|
159
|
-
*/
|
|
160
|
-
applyExtractedPolicyToManualCardPolicyDraft: {
|
|
161
|
-
reducer(draft, action) {
|
|
162
|
-
if (draft.manualCardPolicyFormDraft == null) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
draft.manualCardPolicyFormDraft = (0, applyExtractedPolicyToManualCardPolicyDraft_1.applyExtractedPolicyToManualCardPolicyDraft)({
|
|
166
|
-
current: draft.manualCardPolicyFormDraft,
|
|
167
|
-
extracted: action.payload.extracted,
|
|
168
|
-
vendorSearchOptions: action.payload.vendorSearchOptions,
|
|
169
|
-
categorySearchOptions: action.payload.categorySearchOptions,
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
prepare(payload) {
|
|
173
|
-
return { payload };
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
clearManualCardPolicyFormDraft(draft) {
|
|
177
|
-
draft.manualCardPolicyFormDraft = undefined;
|
|
178
|
-
},
|
|
179
60
|
clearCreateCardPolicy(draft) {
|
|
180
61
|
Object.assign(draft, exports.initialState);
|
|
181
62
|
},
|
|
182
63
|
},
|
|
183
64
|
});
|
|
184
|
-
_a = createCardPolicy.actions, exports.createCardPolicyTemplates = _a.createCardPolicyTemplates, exports.updateCreateCardPolicyTemplateRequestState = _a.updateCreateCardPolicyTemplateRequestState, exports.
|
|
65
|
+
_a = createCardPolicy.actions, exports.createCardPolicyTemplates = _a.createCardPolicyTemplates, exports.updateCreateCardPolicyTemplateRequestState = _a.updateCreateCardPolicyTemplateRequestState, exports.clearCreateCardPolicy = _a.clearCreateCardPolicy;
|
|
185
66
|
exports.default = createCardPolicy.reducer;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
2
|
import { BulkCreateCardPolicyTemplateError } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
-
import { CardPolicyCreateFormDraft, CardPolicyFormDraft } from './cardPolicyFormDraftTypes';
|
|
4
3
|
import { CreateCardPolicyState } from './createCardPolicyState';
|
|
5
4
|
export declare function getCreateCardPolicyTemplateRequestState(state: CreateCardPolicyState): FetchStateAndError;
|
|
6
5
|
/**
|
|
@@ -31,17 +30,3 @@ export declare function getLastCreateCardPolicyTemplateErrors(state: CreateCardP
|
|
|
31
30
|
* "created" placeholders to the active conversation.
|
|
32
31
|
*/
|
|
33
32
|
export declare function getLastCreateCardPolicySourceChatSessionId(state: CreateCardPolicyState): ID | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Returns the AI CFO card-policy form draft, or `undefined` before
|
|
36
|
-
* `seedAiCardPolicyFormDraft` runs / after `clearAiCardPolicyFormDraft`.
|
|
37
|
-
* Connected screens use this to hydrate the
|
|
38
|
-
* `CardPolicyInteractiveForm`'s RHF.
|
|
39
|
-
*/
|
|
40
|
-
export declare function getAiCardPolicyFormDraft(state: CreateCardPolicyState): CardPolicyFormDraft | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the manual `CardPolicyCreatePage` form draft, or `undefined`
|
|
43
|
-
* before `seedManualCardPolicyFormDraft` runs / after
|
|
44
|
-
* `clearManualCardPolicyFormDraft`. The connected screen uses this to
|
|
45
|
-
* hydrate `CardPolicyFormSections`.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getManualCardPolicyFormDraft(state: CreateCardPolicyState): CardPolicyCreateFormDraft | undefined;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js
CHANGED
|
@@ -5,8 +5,6 @@ exports.getLastCreatedCardPolicyTemplateIds = getLastCreatedCardPolicyTemplateId
|
|
|
5
5
|
exports.getLastCreatedCardPolicyTemplateId = getLastCreatedCardPolicyTemplateId;
|
|
6
6
|
exports.getLastCreateCardPolicyTemplateErrors = getLastCreateCardPolicyTemplateErrors;
|
|
7
7
|
exports.getLastCreateCardPolicySourceChatSessionId = getLastCreateCardPolicySourceChatSessionId;
|
|
8
|
-
exports.getAiCardPolicyFormDraft = getAiCardPolicyFormDraft;
|
|
9
|
-
exports.getManualCardPolicyFormDraft = getManualCardPolicyFormDraft;
|
|
10
8
|
function getCreateCardPolicyTemplateRequestState(state) {
|
|
11
9
|
return state.createCardPolicyTemplateRequestState;
|
|
12
10
|
}
|
|
@@ -46,21 +44,3 @@ function getLastCreateCardPolicyTemplateErrors(state) {
|
|
|
46
44
|
function getLastCreateCardPolicySourceChatSessionId(state) {
|
|
47
45
|
return state.lastCreateCardPolicySourceChatSessionId;
|
|
48
46
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Returns the AI CFO card-policy form draft, or `undefined` before
|
|
51
|
-
* `seedAiCardPolicyFormDraft` runs / after `clearAiCardPolicyFormDraft`.
|
|
52
|
-
* Connected screens use this to hydrate the
|
|
53
|
-
* `CardPolicyInteractiveForm`'s RHF.
|
|
54
|
-
*/
|
|
55
|
-
function getAiCardPolicyFormDraft(state) {
|
|
56
|
-
return state.aiCardPolicyFormDraft;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns the manual `CardPolicyCreatePage` form draft, or `undefined`
|
|
60
|
-
* before `seedManualCardPolicyFormDraft` runs / after
|
|
61
|
-
* `clearManualCardPolicyFormDraft`. The connected screen uses this to
|
|
62
|
-
* hydrate `CardPolicyFormSections`.
|
|
63
|
-
*/
|
|
64
|
-
function getManualCardPolicyFormDraft(state) {
|
|
65
|
-
return state.manualCardPolicyFormDraft;
|
|
66
|
-
}
|
package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
2
|
import { BulkCreateCardPolicyTemplateError } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
-
import { AiCardPolicyFormDraftSeedContext, CardPolicyCreateFormDraft, CardPolicyFormDraft } from './cardPolicyFormDraftTypes';
|
|
4
3
|
/**
|
|
5
4
|
* View-side scaffolding for the Card Policy "create" flow.
|
|
6
5
|
*
|
|
@@ -34,25 +33,6 @@ export interface CreateCardPolicyState {
|
|
|
34
33
|
* ergonomic single-create routing.
|
|
35
34
|
*/
|
|
36
35
|
lastCreatedCardPolicyTemplateIds: ID[];
|
|
37
|
-
/**
|
|
38
|
-
* AI CFO card-policy interactive form draft. Hydrates the
|
|
39
|
-
* `CardPolicyInteractiveForm` and is replaced wholesale on every
|
|
40
|
-
* `watchHandler` tick via `updateAiCardPolicyFormDraft`. `undefined`
|
|
41
|
-
* before `seedAiCardPolicyFormDraft` runs and after
|
|
42
|
-
* `clearAiCardPolicyFormDraft`.
|
|
43
|
-
*/
|
|
44
|
-
aiCardPolicyFormDraft?: CardPolicyFormDraft;
|
|
45
|
-
/**
|
|
46
|
-
* Companion seed context for `aiCardPolicyFormDraft`. Keeps the seed
|
|
47
|
-
* universes (cards master list, MCC categories, suggested seed
|
|
48
|
-
* chips, suggested policies seed) so subsequent
|
|
49
|
-
* `updateAiCardPolicyFormDraft` dispatches can re-derive the review
|
|
50
|
-
* rows / "Applied to Cards" group without the component re-passing
|
|
51
|
-
* the universe each tick. Also stores the latest `wizardPlan` so
|
|
52
|
-
* `applyUploadPlanToAiCardPolicyDraft` can re-seed the review when
|
|
53
|
-
* a late `policy-recommendation-from-upload` response lands.
|
|
54
|
-
*/
|
|
55
|
-
aiCardPolicyFormDraftContext?: AiCardPolicyFormDraftSeedContext;
|
|
56
36
|
/**
|
|
57
37
|
* Chat session id from `sourceChatSessionId` on the most recent
|
|
58
38
|
* `createCardPolicyTemplates` dispatch — i.e. the AI CFO conversation
|
|
@@ -62,12 +42,4 @@ export interface CreateCardPolicyState {
|
|
|
62
42
|
* screen (which omits `sourceChatSessionId`).
|
|
63
43
|
*/
|
|
64
44
|
lastCreateCardPolicySourceChatSessionId?: ID;
|
|
65
|
-
/**
|
|
66
|
-
* Manual `CardPolicyCreatePage` form draft. Hydrates the create
|
|
67
|
-
* page's `CardPolicyFormSections` and is replaced wholesale on every
|
|
68
|
-
* `watchHandler` tick via `updateManualCardPolicyFormDraft`.
|
|
69
|
-
* `undefined` before `seedManualCardPolicyFormDraft` runs and after
|
|
70
|
-
* `clearManualCardPolicyFormDraft`.
|
|
71
|
-
*/
|
|
72
|
-
manualCardPolicyFormDraft?: CardPolicyCreateFormDraft;
|
|
73
45
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { CardsCreationInitialData } from '../../../../entity/aiCfo/aiCfoState';
|
|
3
2
|
import { CardCodeType } from '../../../../entity/chargeCard/chargeCard';
|
|
4
3
|
import { DepositAccountWithLimitPayload } from '../../../../entity/depositAccount/depositAccountPayload';
|
|
5
|
-
import { User } from '../../../../entity/user/userState';
|
|
6
4
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
7
5
|
import { ActiveChargeCardCountPayload, ActiveDebitCardCountByUserIdPayload } from '../../../userListView/userListViewPayload';
|
|
8
|
-
import { CardsFormDraft } from './aiCardCreationFormDraftTypes';
|
|
9
6
|
import { IssueChargeCardLocalData, IssueChargeCardState } from './issueChargeCardState';
|
|
10
7
|
export declare const initialState: IssueChargeCardState;
|
|
11
8
|
export declare const issueChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
@@ -26,9 +23,6 @@ export declare const issueChargeCards: import("@reduxjs/toolkit").ActionCreatorW
|
|
|
26
23
|
}, "issueChargeCard/fetchIssueCardPage", never, never>, updateDepositAccountsInCards: import("@reduxjs/toolkit").ActionCreatorWithPayload<DepositAccountWithLimitPayload[], "issueChargeCard/updateDepositAccountsInCards">, fetchDepositAccountListForCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issueChargeCard/fetchDepositAccountListForCards">, updateDepositAccountListForCardsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
24
|
fetchState: FetchState;
|
|
28
25
|
error?: ZeniAPIStatus;
|
|
29
|
-
}, "issueChargeCard/updateDepositAccountListForCardsFetchStatus">,
|
|
30
|
-
allUsers: User[];
|
|
31
|
-
initialData: CardsCreationInitialData;
|
|
32
|
-
}, "issueChargeCard/seedAiCardCreationFormDraft", never, never>, updateAiCardCreationFormDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardsFormDraft, "issueChargeCard/updateAiCardCreationFormDraft">, clearAiCardCreationFormDraft: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issueChargeCard/clearAiCardCreationFormDraft">, clearIssueChargeCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issueChargeCard/clearIssueChargeCard">;
|
|
26
|
+
}, "issueChargeCard/updateDepositAccountListForCardsFetchStatus">, clearIssueChargeCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issueChargeCard/clearIssueChargeCard">;
|
|
33
27
|
declare const _default: import("redux").Reducer<IssueChargeCardState>;
|
|
34
28
|
export default _default;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearIssueChargeCard = exports.
|
|
4
|
+
exports.clearIssueChargeCard = 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 applyAiCardCreationFormDraftUpdate_1 = require("./applyAiCardCreationFormDraftUpdate");
|
|
7
|
-
const buildAiCardCreationFormDraftSeed_1 = require("./buildAiCardCreationFormDraftSeed");
|
|
8
6
|
exports.initialState = {
|
|
9
7
|
depositAccountIds: [],
|
|
10
8
|
depositAccountsFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
@@ -41,6 +39,10 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
41
39
|
},
|
|
42
40
|
},
|
|
43
41
|
issueChargeCards: {
|
|
42
|
+
// `sourceChatSessionId`, when provided, records which AI CFO chat
|
|
43
|
+
// session triggered this bulk create so the cards list and AI CFO
|
|
44
|
+
// drawer can correlate an in-flight create back to its conversation.
|
|
45
|
+
// The field is not sent to the backend.
|
|
44
46
|
prepare(payload) {
|
|
45
47
|
return { payload: payload ?? {} };
|
|
46
48
|
},
|
|
@@ -138,45 +140,10 @@ const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
|
138
140
|
draft.depositAccountsFetchState.fetchState = action.payload.fetchState;
|
|
139
141
|
draft.depositAccountsFetchState.error = action.payload.error;
|
|
140
142
|
},
|
|
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`. Delegates
|
|
161
|
-
* to `applyAiCardCreationFormDraftUpdate` so the same derivation rules
|
|
162
|
-
* (review-mode `cardRows` re-derivation that preserves in-place edits)
|
|
163
|
-
* are shared with the Storybook owner harness.
|
|
164
|
-
*/
|
|
165
|
-
updateAiCardCreationFormDraft(draft, action) {
|
|
166
|
-
draft.aiCardCreationFormDraft = (0, applyAiCardCreationFormDraftUpdate_1.applyAiCardCreationFormDraftUpdate)({
|
|
167
|
-
prev: draft.aiCardCreationFormDraft,
|
|
168
|
-
next: action.payload,
|
|
169
|
-
context: draft.aiCardCreationFormDraftContext,
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
clearAiCardCreationFormDraft(draft) {
|
|
173
|
-
draft.aiCardCreationFormDraft = undefined;
|
|
174
|
-
draft.aiCardCreationFormDraftContext = undefined;
|
|
175
|
-
},
|
|
176
143
|
clearIssueChargeCard(draft) {
|
|
177
144
|
Object.assign(draft, exports.initialState);
|
|
178
145
|
},
|
|
179
146
|
},
|
|
180
147
|
});
|
|
181
|
-
_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.
|
|
148
|
+
_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.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
182
149
|
exports.default = issueChargeCard.reducer;
|
|
@@ -7,7 +7,6 @@ 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';
|
|
11
10
|
import { ActiveChargeCardCount, ActiveDebitCardCountByUserId, IssueChargeCardLocalData } from './issueChargeCardState';
|
|
12
11
|
export interface IssueChargeCardSelectorView extends SelectorView {
|
|
13
12
|
activeChargeCardCount: Record<ID, ActiveChargeCardCount>;
|
|
@@ -53,17 +52,3 @@ export declare const getIssueChargeCardsSaveStatus: (state: RootState) => FetchS
|
|
|
53
52
|
* the top of the table.
|
|
54
53
|
*/
|
|
55
54
|
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.
|
|
3
|
+
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,7 +8,6 @@ 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");
|
|
12
11
|
const getIssueChargeCardView = (state, isCreditCardEnabled, isDebitCardEnabled) => {
|
|
13
12
|
const { issueChargeCardState, userState, userRoleState, userListViewState, chargeCardConfigState, chargeCardListState, addressState, classState, depositAccountState, classListState, } = state;
|
|
14
13
|
const userListSelectorView = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'cardHolderCandidate');
|
|
@@ -140,27 +139,3 @@ const getInFlightIssueChargeCardsCount = (state) => {
|
|
|
140
139
|
return state.issueChargeCardState.localData.length;
|
|
141
140
|
};
|
|
142
141
|
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,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
export interface IssueChargeCardState extends FetchedState {
|
|
6
5
|
activeChargeCardCount: Record<ID, ActiveChargeCardCount>;
|
|
7
6
|
activeDebitCardCountByDepositAccountId: Record<ID, ActiveDebitCardCountByUserId>;
|
|
@@ -10,21 +9,6 @@ export interface IssueChargeCardState extends FetchedState {
|
|
|
10
9
|
lastIssuedCardIds: ID[];
|
|
11
10
|
localData: IssueChargeCardLocalData[];
|
|
12
11
|
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
12
|
lastIssueSourceChatSessionId?: ID;
|
|
29
13
|
lastSelfIssuedDebitCardId?: ID;
|
|
30
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.83
|
|
3
|
+
"version": "5.0.83",
|
|
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",
|