1
1
package com .redhat .labs .lodestar .model ;
2
2
3
3
import java .time .Instant ;
4
+ import java .util .ArrayList ;
5
+ import java .util .HashSet ;
4
6
import java .util .List ;
5
7
import java .util .Set ;
6
8
@@ -92,6 +94,9 @@ public class Engagement {
92
94
private String region ;
93
95
private String type ;
94
96
97
+ @ JsonbProperty ("categories" )
98
+ List <String > categoriesV2 ;
99
+
95
100
@ JsonbProperty ("engagement_categories" )
96
101
@ DiffIgnore
97
102
private List <Category > categories ;
@@ -116,6 +121,10 @@ public class Engagement {
116
121
@ DiffIgnore
117
122
private int participantCount ;
118
123
124
+ @ JsonbProperty ("artifact_count" )
125
+ @ DiffIgnore
126
+ private int artifactCount ;
127
+
119
128
//Legacy - front end should switch to region
120
129
@ JsonbProperty ("engagement_region" )
121
130
private String engagementRegion ;
@@ -128,26 +137,63 @@ public class Engagement {
128
137
@ JsonbProperty ("engagement_type" )
129
138
private String engagementType ;
130
139
140
+ //Legacy
131
141
public void setEngagementRegion (String engagementRegion ) {
132
142
this .engagementRegion = engagementRegion ;
133
143
this .region = engagementRegion ;
134
144
}
135
145
146
+ //Legacy
147
+ public void setRegion (String region ) {
148
+ this .region = region ;
149
+ this .engagementRegion = region ;
150
+ }
151
+
152
+ //Legacy
136
153
public void setProjectName (String projectName ) {
137
154
this .projectName = projectName ;
138
155
this .name = projectName ;
139
156
}
140
157
158
+ //Legacy
141
159
public void setName (String projectName ) {
142
160
this .projectName = projectName ;
143
161
this .name = projectName ;
144
162
}
145
163
164
+ //Legacy
146
165
public void setEngagementType (String engagementType ) {
147
166
this .engagementType = engagementType ;
148
167
this .type = engagementType ;
149
168
}
150
169
170
+ //Legacy
171
+ public void addArtifact (Artifact a ) {
172
+ if (artifacts == null ) {
173
+ artifacts = new ArrayList <>();
174
+ }
175
+
176
+ artifacts .add (a );
177
+ }
178
+
179
+ //Legacy
180
+ public void addParticipant (EngagementUser p ) {
181
+ if (engagementUsers == null ) {
182
+ engagementUsers = new HashSet <>();
183
+ }
184
+
185
+ engagementUsers .add (p );
186
+ }
187
+
188
+ //Legacy
189
+ public void addCategory (String cat ) {
190
+ if (categories == null ) {
191
+ categories = new ArrayList <>();
192
+ }
193
+
194
+ categories .add (Category .builder ().name (cat ).build ());
195
+ }
196
+
151
197
/**
152
198
* The value return here is relative to the time entered. If the time entered was
153
199
* (currentDate) Jan 1 2020 and this engagement started on Feb 1 and ended Feb 28
0 commit comments