@zeniai/client-epic-state 5.2.22-betaAM3 → 5.2.22-betaAM4
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.
|
@@ -70,11 +70,25 @@ function collectGroupedAccrualIds(members) {
|
|
|
70
70
|
}
|
|
71
71
|
return grouped;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function collectGroupedMembers(members) {
|
|
74
|
+
if (members.length <= 1) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
return members.map((member) => ({
|
|
78
|
+
accrualId: member.accrualId,
|
|
79
|
+
estimatedAmount: member.estimatedAmount,
|
|
80
|
+
jeDebitAccountName: member.jeDebitAccountName,
|
|
81
|
+
memo: member.memo,
|
|
82
|
+
serviceMonth: member.serviceMonth,
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
function toActualMatchingRow(members, kind) {
|
|
86
|
+
const accrual = members[0];
|
|
74
87
|
return {
|
|
75
88
|
...accrual,
|
|
76
89
|
kind,
|
|
77
|
-
groupedAccrualIds,
|
|
90
|
+
groupedAccrualIds: collectGroupedAccrualIds(members),
|
|
91
|
+
groupedMembers: collectGroupedMembers(members),
|
|
78
92
|
reversalDate: getActualMatchingReversalDate(accrual),
|
|
79
93
|
};
|
|
80
94
|
}
|
|
@@ -92,7 +106,7 @@ function collapseActualMatchingRows(accruals, kind) {
|
|
|
92
106
|
}
|
|
93
107
|
const rows = [];
|
|
94
108
|
for (const members of groups.values()) {
|
|
95
|
-
rows.push(toActualMatchingRow(members
|
|
109
|
+
rows.push(toActualMatchingRow(members, kind));
|
|
96
110
|
}
|
|
97
111
|
return rows;
|
|
98
112
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
3
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
4
|
import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
4
5
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
5
6
|
import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
|
|
6
7
|
export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review' | 'manually_reversed';
|
|
8
|
+
export type ActualMatchingGroupedAccrual = {
|
|
9
|
+
accrualId: ID;
|
|
10
|
+
estimatedAmount?: Amount;
|
|
11
|
+
jeDebitAccountName?: string;
|
|
12
|
+
memo?: string;
|
|
13
|
+
serviceMonth?: string;
|
|
14
|
+
};
|
|
7
15
|
export interface ActualMatchingRow extends JEOneTimeAccrual {
|
|
8
16
|
kind: ActualMatchingRowKind;
|
|
9
17
|
groupedAccrualIds?: ID[];
|
|
18
|
+
groupedMembers?: ActualMatchingGroupedAccrual[];
|
|
10
19
|
reversalDate?: ZeniDate;
|
|
11
20
|
}
|
|
12
21
|
export interface ActualMatchingKpiSummary {
|
|
@@ -82,11 +82,25 @@ function collectGroupedAccrualIds(members) {
|
|
|
82
82
|
}
|
|
83
83
|
return grouped;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function collectGroupedMembers(members) {
|
|
86
|
+
if (members.length <= 1) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return members.map((member) => ({
|
|
90
|
+
accrualId: member.accrualId,
|
|
91
|
+
estimatedAmount: member.estimatedAmount,
|
|
92
|
+
jeDebitAccountName: member.jeDebitAccountName,
|
|
93
|
+
memo: member.memo,
|
|
94
|
+
serviceMonth: member.serviceMonth,
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
function toActualMatchingRow(members, kind) {
|
|
98
|
+
const accrual = members[0];
|
|
86
99
|
return {
|
|
87
100
|
...accrual,
|
|
88
101
|
kind,
|
|
89
|
-
groupedAccrualIds,
|
|
102
|
+
groupedAccrualIds: collectGroupedAccrualIds(members),
|
|
103
|
+
groupedMembers: collectGroupedMembers(members),
|
|
90
104
|
reversalDate: getActualMatchingReversalDate(accrual),
|
|
91
105
|
};
|
|
92
106
|
}
|
|
@@ -104,7 +118,7 @@ function collapseActualMatchingRows(accruals, kind) {
|
|
|
104
118
|
}
|
|
105
119
|
const rows = [];
|
|
106
120
|
for (const members of groups.values()) {
|
|
107
|
-
rows.push(toActualMatchingRow(members
|
|
121
|
+
rows.push(toActualMatchingRow(members, kind));
|
|
108
122
|
}
|
|
109
123
|
return rows;
|
|
110
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.22-
|
|
3
|
+
"version": "5.2.22-betaAM4",
|
|
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",
|