2
2
3
3
import java .math .BigDecimal ;
4
4
import java .math .RoundingMode ;
5
+ import java .util .ArrayList ;
6
+ import java .util .List ;
5
7
6
8
import javax .validation .Valid ;
7
9
import javax .validation .constraints .DecimalMax ;
8
10
import javax .validation .constraints .DecimalMin ;
9
11
import javax .validation .constraints .NotNull ;
12
+ import javax .validation .constraints .Size ;
10
13
11
14
import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
12
15
import com .fasterxml .jackson .annotation .JsonInclude ;
13
16
import com .fasterxml .jackson .annotation .JsonInclude .Include ;
17
+ import com .fasterxml .jackson .annotation .JsonProperty ;
14
18
15
19
import no .nav .abakus .iaygrunnlag .Periode ;
16
20
17
- import com .fasterxml .jackson .annotation .JsonProperty ;
18
-
19
21
@ JsonIgnoreProperties (ignoreUnknown = true )
20
22
@ JsonInclude (value = Include .NON_ABSENT , content = Include .ALWAYS )
21
23
public class AnvisningDto {
@@ -25,13 +27,17 @@ public class AnvisningDto {
25
27
@ Valid
26
28
private Periode periode ;
27
29
28
- /** Beløp i hele kroner (currency major unit). Tillater kun positive verdier. Max verdi håndteres av mottager. */
30
+ /**
31
+ * Beløp i hele kroner (currency major unit). Tillater kun positive verdier. Max verdi håndteres av mottager.
32
+ */
29
33
@ JsonProperty (value = "beløp" )
30
34
@ Valid
31
35
@ DecimalMin (value = "0.00" , message = "beløp [${validatedValue}] må være >= {value}" )
32
36
private BigDecimal beløp ;
33
37
34
- /** Beløp i hele kroner (currency major unit). Tillater kun positive verdier. Max verdi håndteres av mottager. */
38
+ /**
39
+ * Beløp i hele kroner (currency major unit). Tillater kun positive verdier. Max verdi håndteres av mottager.
40
+ */
35
41
@ JsonProperty (value = "dagsats" )
36
42
@ Valid
37
43
@ DecimalMin (value = "0.00" , message = "beløp [${validatedValue}] må være >= {value}" )
@@ -46,6 +52,12 @@ public class AnvisningDto {
46
52
@ DecimalMax (value = "200.00" , message = "prosentsats [${validatedValue}] må være <= {value}" )
47
53
private BigDecimal utbetalingsgrad ;
48
54
55
+ @ JsonProperty (value = "andeler" )
56
+ @ Valid
57
+ @ Size
58
+ private List <AnvistAndelDto > andeler = new ArrayList <>();
59
+
60
+
49
61
protected AnvisningDto () {
50
62
// default ctor
51
63
}
@@ -62,6 +74,10 @@ public Periode getPeriode() {
62
74
return beløp ;
63
75
}
64
76
77
+ public List <AnvistAndelDto > getAndeler () {
78
+ return andeler ;
79
+ }
80
+
65
81
public void setBeløp (BigDecimal beløp ) {
66
82
this .beløp = beløp == null ? null : beløp .setScale (2 , RoundingMode .HALF_UP );
67
83
}
@@ -81,7 +97,11 @@ public BigDecimal getDagsats() {
81
97
}
82
98
83
99
public void setDagsats (BigDecimal dagsats ) {
84
- this .dagsats = dagsats == null ? null : dagsats .setScale (2 , RoundingMode .HALF_UP );
100
+ this .dagsats = dagsats == null ? null : dagsats .setScale (2 , RoundingMode .HALF_UP );
101
+ }
102
+
103
+ public void setAndeler (List <AnvistAndelDto > andeler ) {
104
+ this .andeler = andeler ;
85
105
}
86
106
87
107
public AnvisningDto medDagsats (BigDecimal dagsats ) {
@@ -100,12 +120,12 @@ public BigDecimal getUtbetalingsgrad() {
100
120
public void setUtbetalingsgrad (BigDecimal utbetalingsgrad ) {
101
121
this .utbetalingsgrad = utbetalingsgrad == null ? null : utbetalingsgrad .setScale (2 , RoundingMode .HALF_UP );
102
122
}
103
-
123
+
104
124
public AnvisningDto medUtbetalingsgrad (BigDecimal utbetalingsgrad ) {
105
125
setUtbetalingsgrad (utbetalingsgrad );
106
126
return this ;
107
127
}
108
-
128
+
109
129
public AnvisningDto medUtbetalingsgrad (int utbetalingsgrad ) {
110
130
setUtbetalingsgrad (BigDecimal .valueOf (utbetalingsgrad ));
111
131
return this ;
0 commit comments