@zeniai/client-epic-state 5.0.77-betaAS5 → 5.0.77
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/esm/view/spendManagement/commonHistoryView/commonHistoryPayload.js +3 -8
- package/lib/esm/view/spendManagement/commonHistoryView/commonHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/commonHistoryView/fetchEntityHistoryEpic.js +0 -2
- package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.d.ts +1 -1
- package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.js +2 -7
- package/lib/view/spendManagement/commonHistoryView/commonHistoryReducer.d.ts +0 -1
- package/lib/view/spendManagement/commonHistoryView/commonHistoryReducer.js +2 -3
- package/lib/view/spendManagement/commonHistoryView/fetchEntityHistoryEpic.js +0 -2
- package/package.json +1 -1
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dateLocal } from '../../../zeniDayJS';
|
|
2
2
|
import { toHistoricEventUpdateDisplayType, toHistoricEventUpdateType, } from './commonHistory';
|
|
3
|
-
export const toHistoricEvent = (payload
|
|
3
|
+
export const toHistoricEvent = (payload) => ({
|
|
4
4
|
eventText: payload.event_text,
|
|
5
5
|
eventSubText: payload.event_sub_text ?? [],
|
|
6
|
-
|
|
7
|
-
timestamp: payload.timestamp != null
|
|
8
|
-
? keepTimeInUTC
|
|
9
|
-
? dateInUTC(payload.timestamp)
|
|
10
|
-
: dateLocal(payload.timestamp)
|
|
11
|
-
: undefined,
|
|
6
|
+
timestamp: payload.timestamp != null ? dateLocal(payload.timestamp) : undefined,
|
|
12
7
|
updates: payload.updates.map((eventUpdatePayload) => toHistoricEventUpdate(eventUpdatePayload)),
|
|
13
8
|
paymentTraceId: payload.metadata?.payment_trace_id ?? null,
|
|
14
9
|
});
|
|
@@ -29,10 +29,9 @@ const commonHistory = createSlice({
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
updateCommonHistory(draft, action) {
|
|
32
|
-
const { entityId, entityType, historicEventsPayload
|
|
32
|
+
const { entityId, entityType, historicEventsPayload } = action.payload;
|
|
33
33
|
const key = getEntityHistoryDetailKey(entityId, entityType);
|
|
34
|
-
|
|
35
|
-
const historicEvents = historicEventsPayload.map((historicEventPayload) => toHistoricEvent(historicEventPayload, keepTimeInUTC));
|
|
34
|
+
const historicEvents = historicEventsPayload.map((historicEventPayload) => toHistoricEvent(historicEventPayload));
|
|
36
35
|
draft.historyById[key] = {
|
|
37
36
|
...initialCommonHistory,
|
|
38
37
|
fetchState: 'Completed',
|
|
@@ -27,8 +27,6 @@ export const fetchEntityHistoryEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
27
27
|
entityId,
|
|
28
28
|
entityType,
|
|
29
29
|
historicEventsPayload: response.data.activities,
|
|
30
|
-
// Bills: parse timestamps as UTC. Other entities: convert to local.
|
|
31
|
-
keepTimeInUTC: entityType === 'bill_pay',
|
|
32
30
|
}));
|
|
33
31
|
}
|
|
34
32
|
else {
|
|
@@ -22,6 +22,6 @@ interface HistoricEventMetaDataPayload {
|
|
|
22
22
|
actor_name: string;
|
|
23
23
|
payment_trace_id?: string | null;
|
|
24
24
|
}
|
|
25
|
-
export declare const toHistoricEvent: (payload: HistoricEventPayload
|
|
25
|
+
export declare const toHistoricEvent: (payload: HistoricEventPayload) => HistoricEvent;
|
|
26
26
|
export type FetchEntityHistoryResponse = ZeniAPIResponse<HistoryPayload>;
|
|
27
27
|
export {};
|
|
@@ -3,15 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toHistoricEvent = void 0;
|
|
4
4
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
5
5
|
const commonHistory_1 = require("./commonHistory");
|
|
6
|
-
const toHistoricEvent = (payload
|
|
6
|
+
const toHistoricEvent = (payload) => ({
|
|
7
7
|
eventText: payload.event_text,
|
|
8
8
|
eventSubText: payload.event_sub_text ?? [],
|
|
9
|
-
|
|
10
|
-
timestamp: payload.timestamp != null
|
|
11
|
-
? keepTimeInUTC
|
|
12
|
-
? (0, zeniDayJS_1.dateInUTC)(payload.timestamp)
|
|
13
|
-
: (0, zeniDayJS_1.dateLocal)(payload.timestamp)
|
|
14
|
-
: undefined,
|
|
9
|
+
timestamp: payload.timestamp != null ? (0, zeniDayJS_1.dateLocal)(payload.timestamp) : undefined,
|
|
15
10
|
updates: payload.updates.map((eventUpdatePayload) => toHistoricEventUpdate(eventUpdatePayload)),
|
|
16
11
|
paymentTraceId: payload.metadata?.payment_trace_id ?? null,
|
|
17
12
|
});
|
|
@@ -12,7 +12,6 @@ export declare const fetchEntityHistory: import("@reduxjs/toolkit").ActionCreato
|
|
|
12
12
|
entityId: ID;
|
|
13
13
|
entityType: SpendManagementEntityType;
|
|
14
14
|
historicEventsPayload: HistoricEventPayload[];
|
|
15
|
-
keepTimeInUTC?: boolean;
|
|
16
15
|
}, "commonHistory/updateCommonHistory">, updateCommonHistoryFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
16
|
entityId: ID;
|
|
18
17
|
entityType: SpendManagementEntityType;
|
|
@@ -36,10 +36,9 @@ const commonHistory = (0, toolkit_1.createSlice)({
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
updateCommonHistory(draft, action) {
|
|
39
|
-
const { entityId, entityType, historicEventsPayload
|
|
39
|
+
const { entityId, entityType, historicEventsPayload } = action.payload;
|
|
40
40
|
const key = (0, commonHistory_1.getEntityHistoryDetailKey)(entityId, entityType);
|
|
41
|
-
|
|
42
|
-
const historicEvents = historicEventsPayload.map((historicEventPayload) => (0, commonHistoryPayload_1.toHistoricEvent)(historicEventPayload, keepTimeInUTC));
|
|
41
|
+
const historicEvents = historicEventsPayload.map((historicEventPayload) => (0, commonHistoryPayload_1.toHistoricEvent)(historicEventPayload));
|
|
43
42
|
draft.historyById[key] = {
|
|
44
43
|
...commonHistory_1.initialCommonHistory,
|
|
45
44
|
fetchState: 'Completed',
|
|
@@ -33,8 +33,6 @@ const fetchEntityHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
33
33
|
entityId,
|
|
34
34
|
entityType,
|
|
35
35
|
historicEventsPayload: response.data.activities,
|
|
36
|
-
// Bills: parse timestamps as UTC. Other entities: convert to local.
|
|
37
|
-
keepTimeInUTC: entityType === 'bill_pay',
|
|
38
36
|
}));
|
|
39
37
|
}
|
|
40
38
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.77
|
|
3
|
+
"version": "5.0.77",
|
|
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",
|