@zeniai/client-epic-state 4.17.16 → 4.17.17
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/accountRecon/accountReconPayload.d.ts +0 -2
- package/lib/entity/accountRecon/accountReconPayload.js +1 -6
- package/lib/entity/accountRecon/accountReconState.d.ts +0 -2
- package/lib/entity/{aiCfo/aiCfoPayload.d.ts → aiController/aiControllerPayload.d.ts} +3 -10
- package/lib/entity/aiController/aiControllerReducer.d.ts +46 -0
- package/lib/entity/{aiCfo/aiCfoReducer.js → aiController/aiControllerReducer.js} +45 -53
- package/lib/entity/aiController/aiControllerSelector.d.ts +14 -0
- package/lib/entity/{aiCfo/aiCfoSelector.js → aiController/aiControllerSelector.js} +6 -6
- package/lib/entity/aiController/aiControllerState.d.ts +88 -0
- package/lib/entity/aiController/aiControllerState.js +49 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -4
- package/lib/entity/tenant/clearAllEpic.js +4 -4
- package/lib/epic.d.ts +8 -10
- package/lib/epic.js +8 -10
- package/lib/index.d.ts +13 -15
- package/lib/index.js +74 -83
- package/lib/reducer.d.ts +6 -6
- package/lib/reducer.js +6 -6
- package/lib/view/{aiCfoView/aiCfoViewPayload.d.ts → aiControllerView/aiControllerViewPayload.d.ts} +2 -2
- package/lib/view/aiControllerView/aiControllerViewReducer.d.ts +73 -0
- package/lib/view/{aiCfoView/aiCfoViewReducer.js → aiControllerView/aiControllerViewReducer.js} +10 -10
- package/lib/view/{aiCfoView/aiCfoViewSelector.d.ts → aiControllerView/aiControllerViewSelector.d.ts} +5 -5
- package/lib/view/{aiCfoView/aiCfoViewSelector.js → aiControllerView/aiControllerViewSelector.js} +6 -6
- package/lib/view/{aiCfoView/aiCfoViewState.d.ts → aiControllerView/aiControllerViewState.d.ts} +3 -3
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionAndSubmitEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionAndSubmitEpic.js +9 -9
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionEpic.js +8 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatHistoryEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatHistoryEpic.js +9 -9
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatSessionsForUserEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatSessionsForUserEpic.js +9 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitEpic.js +11 -11
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitQuestionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitQuestionEpic.js +8 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/submitQuestionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/submitQuestionEpic.js +10 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +34 -49
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailPayload.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +0 -11
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.js +0 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.js +1 -7
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +1 -33
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +2 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +2 -18
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +3 -17
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +4 -34
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +36 -40
- package/lib/zeniAPI.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +0 -45
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +0 -14
- package/lib/entity/aiCfo/aiCfoState.d.ts +0 -107
- package/lib/entity/aiCfo/aiCfoState.js +0 -81
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +0 -73
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.js +0 -39
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.js +0 -23
- /package/lib/entity/{aiCfo/aiCfoPayload.js → aiController/aiControllerPayload.js} +0 -0
- /package/lib/view/{aiCfoView/aiCfoViewPayload.js → aiControllerView/aiControllerViewPayload.js} +0 -0
- /package/lib/view/{aiCfoView/aiCfoViewState.js → aiControllerView/aiControllerViewState.js} +0 -0
|
@@ -3,24 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.submitQuestionEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const
|
|
6
|
+
const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const
|
|
9
|
-
const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
8
|
+
const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
|
|
9
|
+
const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.submitQuestion.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const { questionAnswerId, userId, sessionId, questionId, createdAt, question, } = action.payload;
|
|
11
|
-
const {
|
|
12
|
-
const { uiState } =
|
|
11
|
+
const { aiControllerViewState } = state$.value;
|
|
12
|
+
const { uiState } = aiControllerViewState;
|
|
13
13
|
const agentId = uiState.agentId;
|
|
14
14
|
const payload = { chat_session_id: sessionId, message: question };
|
|
15
15
|
if (agentId == null || Boolean(question) == false) {
|
|
16
16
|
throw new Error('Invalid State');
|
|
17
17
|
}
|
|
18
18
|
return zeniAPI
|
|
19
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.
|
|
19
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/agents/${agentId}`, payload)
|
|
20
20
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
21
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
22
|
const actions = [];
|
|
23
|
-
actions.push((0,
|
|
23
|
+
actions.push((0, aiControllerReducer_1.upsertOrAddQuestionAnswerPayload)({
|
|
24
24
|
chatSessionId: sessionId,
|
|
25
25
|
questionAnswerId: questionAnswerId,
|
|
26
26
|
question: {
|
|
@@ -31,16 +31,16 @@ const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
31
31
|
answerPayload: response.data,
|
|
32
32
|
userId,
|
|
33
33
|
insertQuestionAnswer: false, // Don't insert the Q/A here after stopSubmitSuccess
|
|
34
|
-
}), (0,
|
|
34
|
+
}), (0, aiControllerViewReducer_1.submitQuestionSuccess)(sessionId));
|
|
35
35
|
return (0, rxjs_1.of)(...actions);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
return (0, rxjs_1.of)((0,
|
|
38
|
+
return (0, rxjs_1.of)((0, aiControllerViewReducer_1.submitQuestionFailure)({
|
|
39
39
|
sessionId,
|
|
40
40
|
error: response.status,
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
43
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.submitQuestionFailure)({
|
|
44
44
|
sessionId,
|
|
45
45
|
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Submit question REST API call errored out' +
|
|
46
46
|
JSON.stringify(error)),
|
|
@@ -62,8 +62,6 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
payload = Object.assign(Object.assign({}, payload), { is_recommendation_operation_selected: queryParam.review_action ===
|
|
66
|
-
(updatedTransaction === null || updatedTransaction === void 0 ? void 0 : updatedTransaction.recommendedAction.action) });
|
|
67
65
|
const messageSection = getToastMessageSection(updatedTransaction);
|
|
68
66
|
return zeniAPI
|
|
69
67
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/review?query=${encodeURIComponent(JSON.stringify(queryParam))}`, payload)
|
|
@@ -7,7 +7,6 @@ const transactionDetailLocalDataHelper_2 = require("../../transactionDetail/tran
|
|
|
7
7
|
const transactionsViewState_1 = require("../types/transactionsViewState");
|
|
8
8
|
exports.MAX_SELECTION_LIMIT = 5;
|
|
9
9
|
const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTransactionIds, uncategorizedIncomeExpense) => {
|
|
10
|
-
var _a, _b, _c;
|
|
11
10
|
const transactionLocal = Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData);
|
|
12
11
|
transactionLocal.memo = transaction.memo;
|
|
13
12
|
transactionLocal.transactionDate = transaction.date;
|
|
@@ -55,30 +54,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
|
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
else {
|
|
58
|
-
|
|
59
|
-
const recommendations = (firstLine === null || firstLine === void 0 ? void 0 : firstLine.id) != null
|
|
60
|
-
? (_b = transaction.recommendations) === null || _b === void 0 ? void 0 : _b[firstLine === null || firstLine === void 0 ? void 0 : firstLine.id]
|
|
61
|
-
: undefined;
|
|
62
|
-
const vendor = (_c = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _c === void 0 ? void 0 : _c.vendor;
|
|
63
|
-
if (vendor != null && Boolean(vendor.id)) {
|
|
64
|
-
const vendorId = vendor.id;
|
|
65
|
-
transactionLocal.selectedEntity = {
|
|
66
|
-
id: vendorId,
|
|
67
|
-
name: vendor.name,
|
|
68
|
-
type: 'vendor',
|
|
69
|
-
qboId: vendorId,
|
|
70
|
-
zeniId: vendorId,
|
|
71
|
-
logo: vendor.logo,
|
|
72
|
-
};
|
|
73
|
-
transactionLocal.vendor = {
|
|
74
|
-
id: vendorId,
|
|
75
|
-
name: vendor.name,
|
|
76
|
-
logo: vendor.logo,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
transactionLocal.selectedEntity = undefined;
|
|
81
|
-
}
|
|
57
|
+
transactionLocal.selectedEntity = undefined;
|
|
82
58
|
}
|
|
83
59
|
}
|
|
84
60
|
transactionLocal.vendorUpdates = undefined;
|
|
@@ -120,13 +96,14 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
120
96
|
logo: accountLine.vendor.logo,
|
|
121
97
|
}
|
|
122
98
|
: undefined;
|
|
123
|
-
const customer = accountLine.customer;
|
|
124
99
|
record.customer =
|
|
125
|
-
customer != null &&
|
|
100
|
+
accountLine.customer != null &&
|
|
101
|
+
Boolean(accountLine.customer.id) === true &&
|
|
102
|
+
Boolean(accountLine.customer.name) === true
|
|
126
103
|
? {
|
|
127
|
-
id: customer.id,
|
|
128
|
-
name: customer.name,
|
|
129
|
-
logo: customer.logo,
|
|
104
|
+
id: accountLine.customer.id,
|
|
105
|
+
name: accountLine.customer.name,
|
|
106
|
+
logo: accountLine.customer.logo,
|
|
130
107
|
}
|
|
131
108
|
: undefined;
|
|
132
109
|
record.selectedEntityLine =
|
|
@@ -164,20 +141,18 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
164
141
|
(higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.class) != null) {
|
|
165
142
|
record.class = (_e = higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.class) !== null && _e !== void 0 ? _e : record.class;
|
|
166
143
|
}
|
|
167
|
-
if (record.selectedEntityLine == null
|
|
168
|
-
record.selectedEntityLine.qboId === '') {
|
|
144
|
+
if (record.selectedEntityLine == null) {
|
|
169
145
|
const vendor = higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.vendor;
|
|
170
|
-
if (vendor != null &&
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
record.vendor = { id: vendorId, name, logo };
|
|
146
|
+
if (vendor != null && vendor.id != null) {
|
|
147
|
+
const { id, name, logo } = vendor;
|
|
148
|
+
record.vendor = { id, name, logo };
|
|
174
149
|
record.selectedEntityLine = {
|
|
175
|
-
id
|
|
150
|
+
id,
|
|
176
151
|
name,
|
|
177
152
|
logo,
|
|
178
153
|
type: 'vendor',
|
|
179
|
-
qboId:
|
|
180
|
-
zeniId:
|
|
154
|
+
qboId: id,
|
|
155
|
+
zeniId: id,
|
|
181
156
|
};
|
|
182
157
|
}
|
|
183
158
|
}
|
|
@@ -386,20 +361,30 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
386
361
|
const lineItems = Object.values(transactionDetailLocalData.lineItemById);
|
|
387
362
|
const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
|
|
388
363
|
return lineItems.every((lineItem) => {
|
|
389
|
-
var _a, _b, _c
|
|
390
|
-
return
|
|
391
|
-
Boolean(
|
|
392
|
-
|
|
364
|
+
var _a, _b, _c;
|
|
365
|
+
return lineItem.account != null &&
|
|
366
|
+
Boolean(lineItem.account.qboId) === true &&
|
|
367
|
+
lineItem.class != null &&
|
|
368
|
+
Boolean(lineItem.class.qboId) === true &&
|
|
369
|
+
!(((_a = lineItem.account) === null || _a === void 0 ? void 0 : _a.qboId) != null &&
|
|
393
370
|
[
|
|
394
|
-
(
|
|
395
|
-
(
|
|
371
|
+
(_b = uncategorizedAccounts.expense) === null || _b === void 0 ? void 0 : _b.qboId,
|
|
372
|
+
(_c = uncategorizedAccounts.income) === null || _c === void 0 ? void 0 : _c.qboId,
|
|
396
373
|
].includes(lineItem.account.qboId)) &&
|
|
397
374
|
((isVendorTransactionAvailable
|
|
398
|
-
?
|
|
399
|
-
|
|
375
|
+
? transactionDetailLocalData.vendor != null &&
|
|
376
|
+
transactionDetailLocalData.vendor.id != null &&
|
|
377
|
+
Boolean(transactionDetailLocalData.vendor.id) === true
|
|
378
|
+
: lineItem.vendor != null &&
|
|
379
|
+
lineItem.vendor.id != null &&
|
|
380
|
+
Boolean(lineItem.vendor.id) === true) ||
|
|
400
381
|
(isVendorTransactionAvailable
|
|
401
|
-
?
|
|
402
|
-
|
|
382
|
+
? transactionDetailLocalData.customer != null &&
|
|
383
|
+
transactionDetailLocalData.customer.id != null &&
|
|
384
|
+
Boolean(transactionDetailLocalData.customer.id) === true
|
|
385
|
+
: lineItem.customer != null &&
|
|
386
|
+
lineItem.customer.id != null &&
|
|
387
|
+
Boolean(lineItem.customer.id) === true));
|
|
403
388
|
});
|
|
404
389
|
};
|
|
405
390
|
exports.checkIfAllLineItemsAreCategoryClassFilled = checkIfAllLineItemsAreCategoryClassFilled;
|
|
@@ -5,12 +5,6 @@ interface CashbackPeriodPayload {
|
|
|
5
5
|
amount: number;
|
|
6
6
|
period: string;
|
|
7
7
|
}
|
|
8
|
-
export interface CashbackAnalyticsPayload {
|
|
9
|
-
credit_card_cashback_offer: number;
|
|
10
|
-
credit_card_cashback_redemption_mode: string;
|
|
11
|
-
debit_card_cashback_offer: number;
|
|
12
|
-
debit_card_cashback_redemption_mode: string;
|
|
13
|
-
}
|
|
14
8
|
export interface ChargeCardCashbackPayload extends CurrencyPayload {
|
|
15
9
|
cashback_by_period: CashbackPeriodPayload[];
|
|
16
10
|
cashback_summary: {
|
|
@@ -25,7 +19,6 @@ export interface ChargeCardCashbackPayload extends CurrencyPayload {
|
|
|
25
19
|
};
|
|
26
20
|
};
|
|
27
21
|
insights: InsightPayload;
|
|
28
|
-
analytics: CashbackAnalyticsPayload;
|
|
29
22
|
}
|
|
30
23
|
export type FetchCashbackDetailEpicResponse = ZeniAPIResponse<ChargeCardCashbackPayload>;
|
|
31
24
|
export {};
|
|
@@ -5,7 +5,6 @@ exports.clearCashbackDetail = exports.updateCashbackDetailUIState = exports.upda
|
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const viewAndReportPayloadv2_1 = require("../../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
7
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
8
|
-
const cashbackDetailState_1 = require("./cashbackDetailState");
|
|
9
8
|
exports.initialState = {
|
|
10
9
|
fetchState: 'Not-Started',
|
|
11
10
|
error: undefined,
|
|
@@ -20,7 +19,6 @@ exports.initialState = {
|
|
|
20
19
|
cashbackAvailable: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
21
20
|
},
|
|
22
21
|
insightId: '',
|
|
23
|
-
cashbackAnalytics: Object.assign({}, cashbackDetailState_1.initialCashbackAnalytics),
|
|
24
22
|
hasValidState() {
|
|
25
23
|
return this.fetchState == 'Completed';
|
|
26
24
|
},
|
|
@@ -37,7 +35,6 @@ const cashbackDetail = (0, toolkit_1.createSlice)({
|
|
|
37
35
|
draft.cashbackByPeriod = toCashbackByPeriod(action.payload);
|
|
38
36
|
draft.cashbackSummary = toCashbackSummary(action.payload);
|
|
39
37
|
draft.insightId = action.payload.insights.insight_id;
|
|
40
|
-
draft.cashbackAnalytics = toCashbackAnalytics(action.payload.analytics);
|
|
41
38
|
draft.fetchState = 'Completed';
|
|
42
39
|
},
|
|
43
40
|
updateCashbackDetailFailure(draft, action) {
|
|
@@ -70,11 +67,3 @@ const toCashbackSummary = (payload) => {
|
|
|
70
67
|
cashbackAvailable: (0, amount_1.toAmount)(payload.cashback_summary.cashback_available.amount, payload.currency_code, payload.currency_symbol),
|
|
71
68
|
};
|
|
72
69
|
};
|
|
73
|
-
const toCashbackAnalytics = (payload) => {
|
|
74
|
-
return {
|
|
75
|
-
creditCardCashbackOffer: payload.credit_card_cashback_offer,
|
|
76
|
-
creditCardCashbackRedemptionMode: payload.credit_card_cashback_redemption_mode,
|
|
77
|
-
debitCardCashbackOffer: payload.debit_card_cashback_offer,
|
|
78
|
-
debitCardCashbackRedemptionMode: payload.debit_card_cashback_redemption_mode,
|
|
79
|
-
};
|
|
80
|
-
};
|
|
@@ -3,7 +3,7 @@ import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAnd
|
|
|
3
3
|
import { Insight } from '../../../../entity/insights/insightState';
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
5
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
6
|
-
import {
|
|
6
|
+
import { CashbackDetailUIState, CashbackPeriod } from './cashbackDetailState';
|
|
7
7
|
export interface CashbackDetailSelectorView extends SelectorView {
|
|
8
8
|
cashbackByPeriod: CashbackPeriod[];
|
|
9
9
|
cashbackSummary: {
|
|
@@ -13,7 +13,6 @@ export interface CashbackDetailSelectorView extends SelectorView {
|
|
|
13
13
|
};
|
|
14
14
|
insight: Insight;
|
|
15
15
|
uiState: CashbackDetailUIState;
|
|
16
|
-
cashbackAnalytics: CashbackAnalytics;
|
|
17
16
|
}
|
|
18
17
|
export declare const getCashbackDetail: (state: RootState) => CashbackDetailSelectorView;
|
|
19
18
|
export declare const getZeniDateFromPeriod: (period: string) => ZeniDate;
|
|
@@ -31,7 +31,6 @@ const getCashbackDetail = (state) => {
|
|
|
31
31
|
insight: insight[0],
|
|
32
32
|
fetchState: cashbackDetailState.fetchState,
|
|
33
33
|
error: cashbackDetailState.error,
|
|
34
|
-
cashbackAnalytics: cashbackDetailState.cashbackAnalytics,
|
|
35
34
|
};
|
|
36
35
|
};
|
|
37
36
|
exports.getCashbackDetail = getCashbackDetail;
|
|
@@ -10,7 +10,6 @@ export interface CashbackDetailState extends FetchedState {
|
|
|
10
10
|
cashbackAvailable: Amount;
|
|
11
11
|
};
|
|
12
12
|
insightId: ID;
|
|
13
|
-
cashbackAnalytics: CashbackAnalytics;
|
|
14
13
|
}
|
|
15
14
|
export interface CashbackDetailUIState {
|
|
16
15
|
sortKey: CashbackViewSortKey;
|
|
@@ -22,10 +21,3 @@ export interface CashbackPeriod extends Amount {
|
|
|
22
21
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
23
22
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
24
23
|
export declare type CashbackViewSortKey = ReturnType<typeof toCashbackSortKeyType>;
|
|
25
|
-
export declare const initialCashbackAnalytics: CashbackAnalytics;
|
|
26
|
-
export interface CashbackAnalytics {
|
|
27
|
-
creditCardCashbackOffer: number;
|
|
28
|
-
creditCardCashbackRedemptionMode: string;
|
|
29
|
-
debitCardCashbackOffer: number;
|
|
30
|
-
debitCardCashbackRedemptionMode: string;
|
|
31
|
-
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.ALL_CASHBACK_SORT_KEYS = ['month', 'cashback'];
|
|
6
6
|
const toCashbackSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_CASHBACK_SORT_KEYS);
|
|
7
7
|
exports.toCashbackSortKeyType = toCashbackSortKeyType;
|
|
8
|
-
exports.initialCashbackAnalytics = {
|
|
9
|
-
creditCardCashbackOffer: 0,
|
|
10
|
-
creditCardCashbackRedemptionMode: '',
|
|
11
|
-
debitCardCashbackOffer: 0,
|
|
12
|
-
debitCardCashbackRedemptionMode: '',
|
|
13
|
-
};
|
|
@@ -2,7 +2,6 @@ import { FetchStateAndError, FetchedState, ID } from '../../../../commonStateTyp
|
|
|
2
2
|
import { SortOrder } from '../../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
5
|
-
import { ChargeCardTransactionStatisticsPayload } from './chargeCardDetailPayload';
|
|
6
5
|
export interface ChargeCardDetailState {
|
|
7
6
|
detailById: Record<ID, ChargeCardDetail>;
|
|
8
7
|
}
|
|
@@ -17,7 +16,6 @@ interface ChargeCardDetail extends FetchedState {
|
|
|
17
16
|
updateDebitCardPinAttemptFetchState: FetchStateAndError;
|
|
18
17
|
updateChargeCardLimitFetchState: FetchStateAndError;
|
|
19
18
|
depositAccountLimitFetchState: FetchStateAndError;
|
|
20
|
-
transactionStatistics: TransactionStatistics;
|
|
21
19
|
twoFAState: TwoFAState;
|
|
22
20
|
}
|
|
23
21
|
interface TwoFAState {
|
|
@@ -49,22 +47,5 @@ export interface ChargeCardDetailUiState {
|
|
|
49
47
|
sortKey: ChargeCardTransactionSortKey;
|
|
50
48
|
limit: number;
|
|
51
49
|
}
|
|
52
|
-
export declare const initialTransactionStatistics: TransactionStatistics;
|
|
53
50
|
export declare const emptyChargeCardDetail: ChargeCardDetail;
|
|
54
|
-
export interface TransactionStatistics extends FetchStateAndError {
|
|
55
|
-
statistics: ChargeCardTransactionStatistics;
|
|
56
|
-
}
|
|
57
|
-
export interface ChargeCardTransactionStatistics {
|
|
58
|
-
numberOfAuthorizedTransactionsCurrentMonth: number;
|
|
59
|
-
numberOfCanceledTransactionsCurrentMonth: number;
|
|
60
|
-
numberOfDeclinedTransactionsCurrentMonth: number;
|
|
61
|
-
numberOfPaidTransactionsCurrentMonth: number;
|
|
62
|
-
numberOfTransactionsWithReceiptsCurrentMonth: number;
|
|
63
|
-
totalNumberOfAuthorizedTransactions: number;
|
|
64
|
-
totalNumberOfCanceledTransactions: number;
|
|
65
|
-
totalNumberOfDeclinedTransactions: number;
|
|
66
|
-
totalNumberOfPaidTransactions: number;
|
|
67
|
-
totalNumberOfTransactionsWithReceipts: number;
|
|
68
|
-
}
|
|
69
|
-
export declare const mapChargeCardTransactionStatisticsPayloadToChargeCardTransactionStatistics: (statistics: ChargeCardTransactionStatisticsPayload) => ChargeCardTransactionStatistics;
|
|
70
51
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.emptyChargeCardDetail = exports.initialTransactionAttachments = exports.toChargeCardTransactionSortKeyType = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const ALL_CHARGE_CARD_TRANSACTION_SORT_KEYS = [
|
|
6
6
|
'merchant',
|
|
@@ -16,22 +16,6 @@ exports.initialTransactionAttachments = {
|
|
|
16
16
|
fetchState: 'Not-Started',
|
|
17
17
|
error: undefined,
|
|
18
18
|
};
|
|
19
|
-
exports.initialTransactionStatistics = {
|
|
20
|
-
statistics: {
|
|
21
|
-
numberOfAuthorizedTransactionsCurrentMonth: 0,
|
|
22
|
-
numberOfCanceledTransactionsCurrentMonth: 0,
|
|
23
|
-
numberOfDeclinedTransactionsCurrentMonth: 0,
|
|
24
|
-
numberOfPaidTransactionsCurrentMonth: 0,
|
|
25
|
-
numberOfTransactionsWithReceiptsCurrentMonth: 0,
|
|
26
|
-
totalNumberOfAuthorizedTransactions: 0,
|
|
27
|
-
totalNumberOfCanceledTransactions: 0,
|
|
28
|
-
totalNumberOfDeclinedTransactions: 0,
|
|
29
|
-
totalNumberOfPaidTransactions: 0,
|
|
30
|
-
totalNumberOfTransactionsWithReceipts: 0,
|
|
31
|
-
},
|
|
32
|
-
fetchState: 'Not-Started',
|
|
33
|
-
error: undefined,
|
|
34
|
-
};
|
|
35
19
|
exports.emptyChargeCardDetail = {
|
|
36
20
|
twoFAState: {
|
|
37
21
|
sendOtpStatus: {
|
|
@@ -98,20 +82,4 @@ exports.emptyChargeCardDetail = {
|
|
|
98
82
|
fetchState: 'Completed',
|
|
99
83
|
error: undefined,
|
|
100
84
|
},
|
|
101
|
-
transactionStatistics: exports.initialTransactionStatistics,
|
|
102
|
-
};
|
|
103
|
-
const mapChargeCardTransactionStatisticsPayloadToChargeCardTransactionStatistics = (statistics) => {
|
|
104
|
-
return {
|
|
105
|
-
numberOfAuthorizedTransactionsCurrentMonth: statistics.number_of_authorized_transactions_current_month,
|
|
106
|
-
numberOfCanceledTransactionsCurrentMonth: statistics.number_of_canceled_transactions_current_month,
|
|
107
|
-
numberOfDeclinedTransactionsCurrentMonth: statistics.number_of_declined_transactions_current_month,
|
|
108
|
-
numberOfPaidTransactionsCurrentMonth: statistics.number_of_paid_transactions_current_month,
|
|
109
|
-
numberOfTransactionsWithReceiptsCurrentMonth: statistics.number_of_transactions_with_receipts_current_month,
|
|
110
|
-
totalNumberOfAuthorizedTransactions: statistics.total_number_of_authorized_transactions,
|
|
111
|
-
totalNumberOfCanceledTransactions: statistics.total_number_of_canceled_transactions,
|
|
112
|
-
totalNumberOfDeclinedTransactions: statistics.total_number_of_declined_transactions,
|
|
113
|
-
totalNumberOfPaidTransactions: statistics.total_number_of_paid_transactions,
|
|
114
|
-
totalNumberOfTransactionsWithReceipts: statistics.total_number_of_transactions_with_receipts,
|
|
115
|
-
};
|
|
116
85
|
};
|
|
117
|
-
exports.mapChargeCardTransactionStatisticsPayloadToChargeCardTransactionStatistics = mapChargeCardTransactionStatisticsPayloadToChargeCardTransactionStatistics;
|
|
@@ -32,17 +32,4 @@ interface ChargeCardTrasactionQuery {
|
|
|
32
32
|
page_token: null | string;
|
|
33
33
|
}
|
|
34
34
|
export type FetchChargeCardTransactionListResponse = ZeniAPIResponse<ChargeCardTransactionListPayload>;
|
|
35
|
-
export type FetchChargeCardTransactionStatisticsResponse = ZeniAPIResponse<ChargeCardTransactionStatisticsPayload>;
|
|
36
|
-
export interface ChargeCardTransactionStatisticsPayload {
|
|
37
|
-
number_of_authorized_transactions_current_month: number;
|
|
38
|
-
number_of_canceled_transactions_current_month: number;
|
|
39
|
-
number_of_declined_transactions_current_month: number;
|
|
40
|
-
number_of_paid_transactions_current_month: number;
|
|
41
|
-
number_of_transactions_with_receipts_current_month: number;
|
|
42
|
-
total_number_of_authorized_transactions: number;
|
|
43
|
-
total_number_of_canceled_transactions: number;
|
|
44
|
-
total_number_of_declined_transactions: number;
|
|
45
|
-
total_number_of_paid_transactions: number;
|
|
46
|
-
total_number_of_transactions_with_receipts: number;
|
|
47
|
-
}
|
|
48
35
|
export {};
|
|
@@ -4,7 +4,7 @@ import { PageToken } from '../../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
4
4
|
import { AttachmentPayload } from '../../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
5
5
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
6
6
|
import { ChargeCardDetailState, ChargeCardDetailUiState } from './chargeCardDetail';
|
|
7
|
-
import { ChargeCardTransactionListPayload
|
|
7
|
+
import { ChargeCardTransactionListPayload } from './chargeCardDetailPayload';
|
|
8
8
|
export declare const initialState: ChargeCardDetailState;
|
|
9
9
|
export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, doFetchCreditAccounts: boolean, cacheOverride?: any], {
|
|
10
10
|
chargeCardId: string;
|
|
@@ -103,16 +103,7 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
|
|
|
103
103
|
chargeCardId: ID;
|
|
104
104
|
fetchState: FetchState;
|
|
105
105
|
error?: ZeniAPIStatus;
|
|
106
|
-
}, "chargeCardDetail/updateDepositAccountLimitFetchStatus">,
|
|
107
|
-
chargeCardId: ID;
|
|
108
|
-
}, "chargeCardDetail/fetchChargeCardTransactionStatistics">, updateChargeCardTransactionStatistics: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
109
|
-
chargeCardId: ID;
|
|
110
|
-
statistics: ChargeCardTransactionStatisticsPayload;
|
|
111
|
-
}, "chargeCardDetail/updateChargeCardTransactionStatistics">, updateChargeCardTransactionStatisticsFetchState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
112
|
-
chargeCardId: ID;
|
|
113
|
-
fetchState: FetchState;
|
|
114
|
-
error?: ZeniAPIStatus;
|
|
115
|
-
}, "chargeCardDetail/updateChargeCardTransactionStatisticsFetchState">, sendOtpCardHolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
106
|
+
}, "chargeCardDetail/updateDepositAccountLimitFetchStatus">, sendOtpCardHolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
116
107
|
chargeCardId: ID;
|
|
117
108
|
phone: string;
|
|
118
109
|
}, "chargeCardDetail/sendOtpCardHolder">, resendOtpCardHolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearChargeCardDetail = exports.verifyOtpCardHolderFailure = exports.verifyOtpCardHolderSuccess = exports.verifyOtpCardHolder = exports.sendOtpCardHolderFailure = exports.sendOtpCardHolderSuccess = exports.resendOtpCardHolder = exports.sendOtpCardHolder = exports.
|
|
4
|
+
exports.clearChargeCardDetail = exports.verifyOtpCardHolderFailure = exports.verifyOtpCardHolderSuccess = exports.verifyOtpCardHolder = exports.sendOtpCardHolderFailure = exports.sendOtpCardHolderSuccess = exports.resendOtpCardHolder = exports.sendOtpCardHolder = exports.updateDepositAccountLimitFetchStatus = exports.fetchDepositAccountLimit = exports.updateChargeCardSpendLimitSuccessOrFailure = exports.updateChargeCardSpendLimit = exports.updateChargeCardDetailUpdateStatus = exports.completeDebitCardSetPinWait = exports.startDebitCardSetPinWait = exports.completeCVVActivationWait = exports.startCVVActivationWait = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionAttachmentsInCardDetail = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = exports.updateDebitCardPinAttemptSuccessOrFailure = exports.updateDebitCardPinAttempt = exports.updatePhysicalChargeCardAttempt = exports.updatePhysicalChargeCardAttemptSuccessOrFailure = exports.updateChargeCardTransactionAttachmentsFailure = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.updateChargeCardTransactionList = exports.updateChargeCardDetailUIState = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
7
7
|
const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
@@ -265,22 +265,6 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
265
265
|
error,
|
|
266
266
|
} });
|
|
267
267
|
},
|
|
268
|
-
fetchChargeCardTransactionStatistics(draft, action) {
|
|
269
|
-
const { chargeCardId } = action.payload;
|
|
270
|
-
draft.detailById[chargeCardId].transactionStatistics.fetchState =
|
|
271
|
-
'In-Progress';
|
|
272
|
-
},
|
|
273
|
-
updateChargeCardTransactionStatistics(draft, action) {
|
|
274
|
-
const { chargeCardId, statistics } = action.payload;
|
|
275
|
-
draft.detailById[chargeCardId].transactionStatistics.statistics =
|
|
276
|
-
(0, chargeCardDetail_1.mapChargeCardTransactionStatisticsPayloadToChargeCardTransactionStatistics)(statistics);
|
|
277
|
-
},
|
|
278
|
-
updateChargeCardTransactionStatisticsFetchState(draft, action) {
|
|
279
|
-
const { chargeCardId, fetchState, error } = action.payload;
|
|
280
|
-
draft.detailById[chargeCardId].transactionStatistics.fetchState =
|
|
281
|
-
fetchState;
|
|
282
|
-
draft.detailById[chargeCardId].transactionStatistics.error = error;
|
|
283
|
-
},
|
|
284
268
|
fetchDepositAccountLimit(draft, action) {
|
|
285
269
|
const { chargeCardId } = action.payload;
|
|
286
270
|
draft.detailById[chargeCardId].depositAccountLimitFetchState.fetchState =
|
|
@@ -349,5 +333,5 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
349
333
|
},
|
|
350
334
|
},
|
|
351
335
|
});
|
|
352
|
-
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updatePhysicalChargeCardAttemptSuccessOrFailure = _a.updatePhysicalChargeCardAttemptSuccessOrFailure, exports.updatePhysicalChargeCardAttempt = _a.updatePhysicalChargeCardAttempt, exports.updateDebitCardPinAttempt = _a.updateDebitCardPinAttempt, exports.updateDebitCardPinAttemptSuccessOrFailure = _a.updateDebitCardPinAttemptSuccessOrFailure, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.startCVVActivationWait = _a.startCVVActivationWait, exports.completeCVVActivationWait = _a.completeCVVActivationWait, exports.startDebitCardSetPinWait = _a.startDebitCardSetPinWait, exports.completeDebitCardSetPinWait = _a.completeDebitCardSetPinWait, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.updateChargeCardSpendLimit = _a.updateChargeCardSpendLimit, exports.updateChargeCardSpendLimitSuccessOrFailure = _a.updateChargeCardSpendLimitSuccessOrFailure, exports.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.
|
|
336
|
+
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updatePhysicalChargeCardAttemptSuccessOrFailure = _a.updatePhysicalChargeCardAttemptSuccessOrFailure, exports.updatePhysicalChargeCardAttempt = _a.updatePhysicalChargeCardAttempt, exports.updateDebitCardPinAttempt = _a.updateDebitCardPinAttempt, exports.updateDebitCardPinAttemptSuccessOrFailure = _a.updateDebitCardPinAttemptSuccessOrFailure, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.startCVVActivationWait = _a.startCVVActivationWait, exports.completeCVVActivationWait = _a.completeCVVActivationWait, exports.startDebitCardSetPinWait = _a.startDebitCardSetPinWait, exports.completeDebitCardSetPinWait = _a.completeDebitCardSetPinWait, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.updateChargeCardSpendLimit = _a.updateChargeCardSpendLimit, exports.updateChargeCardSpendLimitSuccessOrFailure = _a.updateChargeCardSpendLimitSuccessOrFailure, exports.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.sendOtpCardHolder = _a.sendOtpCardHolder, exports.resendOtpCardHolder = _a.resendOtpCardHolder, exports.sendOtpCardHolderSuccess = _a.sendOtpCardHolderSuccess, exports.sendOtpCardHolderFailure = _a.sendOtpCardHolderFailure, exports.verifyOtpCardHolder = _a.verifyOtpCardHolder, exports.verifyOtpCardHolderSuccess = _a.verifyOtpCardHolderSuccess, exports.verifyOtpCardHolderFailure = _a.verifyOtpCardHolderFailure, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
353
337
|
exports.default = chargeCardDetail.reducer;
|
|
@@ -10,7 +10,7 @@ import { TwoFactorAuthenticationView } from '../../../twoFactorAuthentication/tw
|
|
|
10
10
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
11
11
|
import { CreditAccount } from '../chargeCardList/chargeCardList';
|
|
12
12
|
import { ChargeCardWithUser } from '../chargeCardList/chargeCardListSelector';
|
|
13
|
-
import { ChargeCardDetailUiState
|
|
13
|
+
import { ChargeCardDetailUiState } from './chargeCardDetail';
|
|
14
14
|
export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
15
15
|
chargeCardConfig: ChargeCardConfigState;
|
|
16
16
|
isRefreshingViewInBackground: boolean;
|
|
@@ -25,7 +25,6 @@ export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
|
25
25
|
updateFetchState: FetchStateAndError;
|
|
26
26
|
updatePhysicalChargeCardAttemptFetchState: FetchStateAndError;
|
|
27
27
|
creditAccount: CreditAccount;
|
|
28
|
-
transactionStatistics: TransactionStatistics;
|
|
29
28
|
depositAccountLimitFetchState: FetchStateAndError;
|
|
30
29
|
updateChargeCardLimitFetchState: FetchStateAndError;
|
|
31
30
|
depositAccountLimit?: DepositAccountWithLimit;
|
|
@@ -18,7 +18,7 @@ const twoFactorAuthentication_1 = require("../../../twoFactorAuthentication/twoF
|
|
|
18
18
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
19
19
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
20
20
|
const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo) => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
22
22
|
const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, chargeCardListState, connectedAccountState, depositAccountState, } = state;
|
|
23
23
|
const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId);
|
|
24
24
|
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -120,7 +120,6 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo)
|
|
|
120
120
|
depositAccountLimit,
|
|
121
121
|
version: '1.0',
|
|
122
122
|
creditAccount: chargeCardListState.creditAccount,
|
|
123
|
-
transactionStatistics: (_o = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionStatistics) !== null && _o !== void 0 ? _o : chargeCardDetail_1.initialTransactionStatistics,
|
|
124
123
|
};
|
|
125
124
|
};
|
|
126
125
|
exports.getChargeCardDetailView = getChargeCardDetailView;
|
|
@@ -6,7 +6,6 @@ export interface ChargeCardListState extends FetchedState {
|
|
|
6
6
|
cardIds: ID[];
|
|
7
7
|
uiState: ChargeCardListUIState;
|
|
8
8
|
creditAccount: CreditAccount;
|
|
9
|
-
creditAccountRepayment: CreditAccountRepayment;
|
|
10
9
|
debitCardSummaries: DebitCardSummaries;
|
|
11
10
|
searchText: string;
|
|
12
11
|
resendCardInvite: ResendRevokeCardInvite;
|
|
@@ -36,21 +35,9 @@ export interface CreditAccount extends FetchStateAndError {
|
|
|
36
35
|
limit: Amount;
|
|
37
36
|
cashback?: Amount;
|
|
38
37
|
}
|
|
39
|
-
export interface CreditAccountRepayment extends FetchStateAndError {
|
|
40
|
-
creditAccountId: ID;
|
|
41
|
-
currentBalance: Amount;
|
|
42
|
-
initiatedRepayments: Amount;
|
|
43
|
-
nextRepaymentDueDate: ZeniDate;
|
|
44
|
-
providerCreditAccountId: ID;
|
|
45
|
-
remainingAmountDue: Amount;
|
|
46
|
-
remainingAmountOverdue: Amount;
|
|
47
|
-
statementPeriodEnd: ZeniDate;
|
|
48
|
-
statementPeriodStart: ZeniDate;
|
|
49
|
-
}
|
|
50
38
|
export declare const initialCreditAcc: CreditAccount;
|
|
51
39
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
52
40
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
53
|
-
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
54
41
|
export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
55
42
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
56
43
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.
|
|
3
|
+
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.initialDebitCardSummaries = exports.initialCreditAcc = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
6
6
|
exports.initialCreditAcc = {
|
|
@@ -58,19 +58,6 @@ exports.initialResendRevokeCardInvite = {
|
|
|
58
58
|
error: undefined,
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
|
-
exports.initialCreditAccountRepayment = {
|
|
62
|
-
fetchState: 'Not-Started',
|
|
63
|
-
error: undefined,
|
|
64
|
-
creditAccountId: '',
|
|
65
|
-
currentBalance: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
66
|
-
initiatedRepayments: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
67
|
-
providerCreditAccountId: '',
|
|
68
|
-
remainingAmountOverdue: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
69
|
-
statementPeriodEnd: (0, zeniDayJS_1.dateNow)(),
|
|
70
|
-
statementPeriodStart: (0, zeniDayJS_1.dateNow)(),
|
|
71
|
-
nextRepaymentDueDate: (0, zeniDayJS_1.dateNow)(),
|
|
72
|
-
remainingAmountDue: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
|
|
73
|
-
};
|
|
74
61
|
const ALL_CHARGE_CARD_SORT_KEYS = [
|
|
75
62
|
'owner',
|
|
76
63
|
'cardName',
|
|
@@ -33,23 +33,9 @@ export interface CreditAccountPayload {
|
|
|
33
33
|
update_time: string;
|
|
34
34
|
cashback_amount?: number | null;
|
|
35
35
|
}
|
|
36
|
-
export interface CreditAccountRepaymentPayload {
|
|
37
|
-
credit_account_id: string;
|
|
38
|
-
currency_code: string;
|
|
39
|
-
currency_symbol: string;
|
|
40
|
-
current_balance: number;
|
|
41
|
-
initiated_repayments: number;
|
|
42
|
-
next_repayment_due_date: string;
|
|
43
|
-
provider_credit_account_id: string;
|
|
44
|
-
remaining_amount_due: number;
|
|
45
|
-
remaining_amount_overdue: number;
|
|
46
|
-
statement_period_end: string;
|
|
47
|
-
statement_period_start: string;
|
|
48
|
-
}
|
|
49
36
|
interface CreditAccountListPayload {
|
|
50
37
|
credit_accounts: CreditAccountPayload[];
|
|
51
38
|
}
|
|
52
|
-
export type FetchCreditAccountRepaymentResponse = ZeniAPIResponse<CreditAccountRepaymentPayload>;
|
|
53
39
|
export type FetchCreditAccountResponse = ZeniAPIResponse<CreditAccountListPayload>;
|
|
54
40
|
export interface DebitCardSummariesPayload {
|
|
55
41
|
current_month_spends: number;
|