1
1
package no .nav .abakus .iaygrunnlag .v1 ;
2
2
3
- import com .fasterxml .jackson .annotation .*;
3
+ import java .time .LocalDateTime ;
4
+ import java .time .OffsetDateTime ;
5
+ import java .time .ZoneId ;
6
+ import java .util .Objects ;
7
+ import java .util .Optional ;
8
+ import java .util .UUID ;
9
+
10
+ import com .fasterxml .jackson .annotation .JsonAutoDetect ;
11
+ import com .fasterxml .jackson .annotation .JsonCreator ;
12
+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
13
+ import com .fasterxml .jackson .annotation .JsonInclude ;
4
14
import com .fasterxml .jackson .annotation .JsonInclude .Include ;
15
+ import com .fasterxml .jackson .annotation .JsonProperty ;
5
16
17
+ import jakarta .validation .Valid ;
18
+ import jakarta .validation .constraints .NotNull ;
6
19
import no .nav .abakus .iaygrunnlag .PersonIdent ;
7
20
import no .nav .abakus .iaygrunnlag .UuidDto ;
8
21
import no .nav .abakus .iaygrunnlag .arbeidsforhold .v1 .ArbeidsforholdInformasjon ;
9
22
import no .nav .abakus .iaygrunnlag .inntektsmelding .v1 .InntektsmeldingerDto ;
10
23
import no .nav .abakus .iaygrunnlag .kodeverk .YtelseType ;
11
24
import no .nav .abakus .iaygrunnlag .oppgittopptjening .v1 .OppgittOpptjeningDto ;
12
- import no .nav .abakus .iaygrunnlag .oppgittopptjening .v1 .OppgitteOpptjeningerDto ;
13
-
14
- import jakarta .validation .Valid ;
15
- import jakarta .validation .constraints .NotNull ;
16
-
17
- import java .time .LocalDateTime ;
18
- import java .time .OffsetDateTime ;
19
- import java .time .ZoneId ;
20
- import java .util .Objects ;
21
- import java .util .Optional ;
22
- import java .util .UUID ;
23
25
24
26
@ JsonIgnoreProperties (ignoreUnknown = true )
25
27
@ JsonInclude (value = Include .NON_ABSENT , content = Include .NON_EMPTY )
@@ -86,13 +88,6 @@ public class InntektArbeidYtelseGrunnlagDto {
86
88
@ Valid
87
89
private OppgittOpptjeningDto overstyrtOppgittOpptjening ;
88
90
89
- /**
90
- * Variant som støtter mer enn en oppgitt opptjening. Den støtter oppgitt opptjening pr. journalpost
91
- */
92
- @ JsonProperty (value = "oppgitteOpptjeninger" )
93
- @ Valid
94
- private OppgitteOpptjeningerDto oppgitteOpptjeninger ;
95
-
96
91
@ JsonProperty (value = "arbeidsforholdInformasjon" )
97
92
@ Valid
98
93
private ArbeidsforholdInformasjon arbeidsforholdInformasjon ;
@@ -175,10 +170,6 @@ public OppgittOpptjeningDto getOppgittOpptjening() {
175
170
}
176
171
177
172
public void setOppgittOpptjening (OppgittOpptjeningDto oppgittOpptjening ) {
178
- if (oppgitteOpptjeninger != null ) {
179
- throw new IllegalArgumentException (
180
- "Skal ikke bruke både ny (oppgitt opptjening pr journalpostId) og gammel (en oppgitt opptjening) i samme sak." );
181
- }
182
173
this .oppgittOpptjening = oppgittOpptjening ;
183
174
}
184
175
@@ -187,21 +178,13 @@ public OppgittOpptjeningDto getOverstyrtOppgittOpptjening() {
187
178
}
188
179
189
180
public void setOverstyrtOppgittOpptjening (OppgittOpptjeningDto overstyrtOppgittOpptjening ) {
190
- if (oppgitteOpptjeninger != null ) {
191
- throw new IllegalArgumentException (
192
- "Skal ikke bruke både ny (oppgitt opptjening pr journalpostId) og gammel (en oppgitt opptjening) i samme sak." );
193
- }
194
181
this .overstyrtOppgittOpptjening = overstyrtOppgittOpptjening ;
195
182
}
196
183
197
184
public OppgittOpptjeningDto getGjeldendeOppgittOpptjening () {
198
185
return Optional .ofNullable (getOverstyrtOppgittOpptjening ()).orElseGet (this ::getOppgittOpptjening );
199
186
}
200
187
201
- public OppgitteOpptjeningerDto getOppgitteOpptjeninger () {
202
- return oppgitteOpptjeninger ;
203
- }
204
-
205
188
public InntektArbeidYtelseAggregatOverstyrtDto getOverstyrt () {
206
189
return overstyrt ;
207
190
}
@@ -246,11 +229,6 @@ public InntektArbeidYtelseGrunnlagDto medOppgittOpptjening(OppgittOpptjeningDto
246
229
return this ;
247
230
}
248
231
249
- public InntektArbeidYtelseGrunnlagDto medOppgittOpptjeninger (OppgitteOpptjeningerDto oppgitteOpptjeninger ) {
250
- setOppgittOpptjeningPrDokument (oppgitteOpptjeninger );
251
- return this ;
252
- }
253
-
254
232
public InntektArbeidYtelseGrunnlagDto medOverstyrtOppgittOpptjening (OppgittOpptjeningDto overstyrtOppgittOpptjening ) {
255
233
setOverstyrtOppgittOpptjening (overstyrtOppgittOpptjening );
256
234
return this ;
@@ -266,12 +244,4 @@ public InntektArbeidYtelseGrunnlagDto medRegister(InntektArbeidYtelseAggregatReg
266
244
return this ;
267
245
}
268
246
269
- public void setOppgittOpptjeningPrDokument (OppgitteOpptjeningerDto oppgitteOpptjeninger ) {
270
- if (oppgittOpptjening != null || overstyrtOppgittOpptjening != null ) {
271
- throw new IllegalArgumentException (
272
- "Skal ikke bruke både ny (oppgitt opptjening pr journalpostId) og gammel (en oppgitt opptjening) i samme sak." );
273
- }
274
- this .oppgitteOpptjeninger = oppgitteOpptjeninger ;
275
- }
276
-
277
247
}
0 commit comments