1313import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
1414import com .flagright .api .core .ObjectMappers ;
1515import java .util .HashMap ;
16+ import java .util .List ;
1617import java .util .Map ;
1718import java .util .Objects ;
1819import java .util .Optional ;
@@ -24,12 +25,30 @@ public final class CraRiskLevelUpdatedDetails {
2425
2526 private final Optional <String > userId ;
2627
28+ private final Optional <Double > riskScore ;
29+
30+ private final Optional <Double > kycRiskScore ;
31+
32+ private final Optional <String > kycRiskLevel ;
33+
34+ private final Optional <List <CraRiskLevelUpdatedRiskFactor >> riskFactors ;
35+
2736 private final Map <String , Object > additionalProperties ;
2837
2938 private CraRiskLevelUpdatedDetails (
30- Optional <String > riskLevel , Optional <String > userId , Map <String , Object > additionalProperties ) {
39+ Optional <String > riskLevel ,
40+ Optional <String > userId ,
41+ Optional <Double > riskScore ,
42+ Optional <Double > kycRiskScore ,
43+ Optional <String > kycRiskLevel ,
44+ Optional <List <CraRiskLevelUpdatedRiskFactor >> riskFactors ,
45+ Map <String , Object > additionalProperties ) {
3146 this .riskLevel = riskLevel ;
3247 this .userId = userId ;
48+ this .riskScore = riskScore ;
49+ this .kycRiskScore = kycRiskScore ;
50+ this .kycRiskLevel = kycRiskLevel ;
51+ this .riskFactors = riskFactors ;
3352 this .additionalProperties = additionalProperties ;
3453 }
3554
@@ -43,6 +62,38 @@ public Optional<String> getUserId() {
4362 return userId ;
4463 }
4564
65+ /**
66+ * @return Current CRA (DRS) risk score for the user
67+ */
68+ @ JsonProperty ("riskScore" )
69+ public Optional <Double > getRiskScore () {
70+ return riskScore ;
71+ }
72+
73+ /**
74+ * @return KRS score when a KRS record exists for the user
75+ */
76+ @ JsonProperty ("kycRiskScore" )
77+ public Optional <Double > getKycRiskScore () {
78+ return kycRiskScore ;
79+ }
80+
81+ /**
82+ * @return Risk level derived from the KRS score
83+ */
84+ @ JsonProperty ("kycRiskLevel" )
85+ public Optional <String > getKycRiskLevel () {
86+ return kycRiskLevel ;
87+ }
88+
89+ /**
90+ * @return Per-factor or component breakdown from KRS when present; omitted when there is no KRS data or no breakdown rows
91+ */
92+ @ JsonProperty ("riskFactors" )
93+ public Optional <List <CraRiskLevelUpdatedRiskFactor >> getRiskFactors () {
94+ return riskFactors ;
95+ }
96+
4697 @ java .lang .Override
4798 public boolean equals (Object other ) {
4899 if (this == other ) return true ;
@@ -55,12 +106,18 @@ public Map<String, Object> getAdditionalProperties() {
55106 }
56107
57108 private boolean equalTo (CraRiskLevelUpdatedDetails other ) {
58- return riskLevel .equals (other .riskLevel ) && userId .equals (other .userId );
109+ return riskLevel .equals (other .riskLevel )
110+ && userId .equals (other .userId )
111+ && riskScore .equals (other .riskScore )
112+ && kycRiskScore .equals (other .kycRiskScore )
113+ && kycRiskLevel .equals (other .kycRiskLevel )
114+ && riskFactors .equals (other .riskFactors );
59115 }
60116
61117 @ java .lang .Override
62118 public int hashCode () {
63- return Objects .hash (this .riskLevel , this .userId );
119+ return Objects .hash (
120+ this .riskLevel , this .userId , this .riskScore , this .kycRiskScore , this .kycRiskLevel , this .riskFactors );
64121 }
65122
66123 @ java .lang .Override
@@ -78,6 +135,14 @@ public static final class Builder {
78135
79136 private Optional <String > userId = Optional .empty ();
80137
138+ private Optional <Double > riskScore = Optional .empty ();
139+
140+ private Optional <Double > kycRiskScore = Optional .empty ();
141+
142+ private Optional <String > kycRiskLevel = Optional .empty ();
143+
144+ private Optional <List <CraRiskLevelUpdatedRiskFactor >> riskFactors = Optional .empty ();
145+
81146 @ JsonAnySetter
82147 private Map <String , Object > additionalProperties = new HashMap <>();
83148
@@ -86,6 +151,10 @@ private Builder() {}
86151 public Builder from (CraRiskLevelUpdatedDetails other ) {
87152 riskLevel (other .getRiskLevel ());
88153 userId (other .getUserId ());
154+ riskScore (other .getRiskScore ());
155+ kycRiskScore (other .getKycRiskScore ());
156+ kycRiskLevel (other .getKycRiskLevel ());
157+ riskFactors (other .getRiskFactors ());
89158 return this ;
90159 }
91160
@@ -111,8 +180,53 @@ public Builder userId(String userId) {
111180 return this ;
112181 }
113182
183+ @ JsonSetter (value = "riskScore" , nulls = Nulls .SKIP )
184+ public Builder riskScore (Optional <Double > riskScore ) {
185+ this .riskScore = riskScore ;
186+ return this ;
187+ }
188+
189+ public Builder riskScore (Double riskScore ) {
190+ this .riskScore = Optional .ofNullable (riskScore );
191+ return this ;
192+ }
193+
194+ @ JsonSetter (value = "kycRiskScore" , nulls = Nulls .SKIP )
195+ public Builder kycRiskScore (Optional <Double > kycRiskScore ) {
196+ this .kycRiskScore = kycRiskScore ;
197+ return this ;
198+ }
199+
200+ public Builder kycRiskScore (Double kycRiskScore ) {
201+ this .kycRiskScore = Optional .ofNullable (kycRiskScore );
202+ return this ;
203+ }
204+
205+ @ JsonSetter (value = "kycRiskLevel" , nulls = Nulls .SKIP )
206+ public Builder kycRiskLevel (Optional <String > kycRiskLevel ) {
207+ this .kycRiskLevel = kycRiskLevel ;
208+ return this ;
209+ }
210+
211+ public Builder kycRiskLevel (String kycRiskLevel ) {
212+ this .kycRiskLevel = Optional .ofNullable (kycRiskLevel );
213+ return this ;
214+ }
215+
216+ @ JsonSetter (value = "riskFactors" , nulls = Nulls .SKIP )
217+ public Builder riskFactors (Optional <List <CraRiskLevelUpdatedRiskFactor >> riskFactors ) {
218+ this .riskFactors = riskFactors ;
219+ return this ;
220+ }
221+
222+ public Builder riskFactors (List <CraRiskLevelUpdatedRiskFactor > riskFactors ) {
223+ this .riskFactors = Optional .ofNullable (riskFactors );
224+ return this ;
225+ }
226+
114227 public CraRiskLevelUpdatedDetails build () {
115- return new CraRiskLevelUpdatedDetails (riskLevel , userId , additionalProperties );
228+ return new CraRiskLevelUpdatedDetails (
229+ riskLevel , userId , riskScore , kycRiskScore , kycRiskLevel , riskFactors , additionalProperties );
116230 }
117231 }
118232}
0 commit comments