Skip to content

Commit 392b9f8

Browse files
committed
SDK-2675: Add support for configuring check result, for SYNECTICS_IDENTITY_FRAUD check in the sandbox
1 parent 9f742dc commit 392b9f8

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

yoti-sdk-sandbox/src/main/java/com/yoti/api/client/sandbox/docs/request/SandboxCheckReports.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import static com.yoti.api.client.docs.DocScanConstants.ID_DOCUMENT_TEXT_DATA_CHECK;
88
import static com.yoti.api.client.docs.DocScanConstants.LIVENESS;
99
import static com.yoti.api.client.docs.DocScanConstants.SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK;
10+
import static com.yoti.api.client.docs.DocScanConstants.SYNECTICS_IDENTITY_FRAUD;
1011
import static com.yoti.api.client.docs.DocScanConstants.THIRD_PARTY_IDENTITY;
1112

1213
import java.util.ArrayList;
@@ -19,6 +20,7 @@
1920
import com.yoti.api.client.sandbox.docs.request.check.SandboxIdDocumentComparisonCheck;
2021
import com.yoti.api.client.sandbox.docs.request.check.SandboxLivenessCheck;
2122
import com.yoti.api.client.sandbox.docs.request.check.SandboxSupplementaryDocumentTextDataCheck;
23+
import com.yoti.api.client.sandbox.docs.request.check.SandboxSynecticsIdentityFraudCheck;
2224
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityCheck;
2325

2426
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -51,6 +53,9 @@ public class SandboxCheckReports {
5153
@JsonProperty(FACE_COMPARISON)
5254
private final SandboxFaceComparisonCheck faceComparisonCheck;
5355

56+
@JsonProperty(SYNECTICS_IDENTITY_FRAUD)
57+
private final List<SandboxSynecticsIdentityFraudCheck> synecticsIdentityFraudChecks;
58+
5459
@JsonProperty("async_report_delay")
5560
private final Integer asyncReportDelay;
5661

@@ -62,6 +67,7 @@ public class SandboxCheckReports {
6267
List<SandboxSupplementaryDocumentTextDataCheck> supplementaryDocumentTextDataChecks,
6368
SandboxThirdPartyIdentityCheck thirdPartyIdentityCheck,
6469
SandboxFaceComparisonCheck faceComparisonCheck,
70+
List<SandboxSynecticsIdentityFraudCheck> synecticsIdentityFraudChecks,
6571
Integer asyncReportsDelay) {
6672
this.documentTextDataChecks = documentTextDataChecks;
6773
this.documentAuthenticityChecks = documentAuthenticityChecks;
@@ -71,6 +77,7 @@ public class SandboxCheckReports {
7177
this.supplementaryDocumentTextDataChecks = supplementaryDocumentTextDataChecks;
7278
this.thirdPartyIdentityCheck = thirdPartyIdentityCheck;
7379
this.faceComparisonCheck = faceComparisonCheck;
80+
this.synecticsIdentityFraudChecks = synecticsIdentityFraudChecks;
7481
this.asyncReportDelay = asyncReportsDelay;
7582
}
7683

@@ -108,6 +115,10 @@ public SandboxFaceComparisonCheck getFaceComparisonCheck() {
108115
return faceComparisonCheck;
109116
}
110117

118+
public List<SandboxSynecticsIdentityFraudCheck> getSynecticsIdentityFraudChecks() {
119+
return synecticsIdentityFraudChecks;
120+
}
121+
111122
public Integer getAsyncReportDelay() {
112123
return asyncReportDelay;
113124
}
@@ -133,6 +144,8 @@ public static class Builder {
133144

134145
private SandboxFaceComparisonCheck faceComparisonCheck;
135146

147+
private List<SandboxSynecticsIdentityFraudCheck> synecticsIdentityFraudChecks = new ArrayList<>();
148+
136149
private Integer asyncReportDelay;
137150

138151
private Builder() {}
@@ -177,14 +190,19 @@ public Builder withFaceComparisonCheck(SandboxFaceComparisonCheck faceComparison
177190
return this;
178191
}
179192

193+
public Builder withSynecticsIdentityFraudCheck(SandboxSynecticsIdentityFraudCheck synecticsIdentityFraudCheck) {
194+
this.synecticsIdentityFraudChecks.add(synecticsIdentityFraudCheck);
195+
return this;
196+
}
197+
180198
public Builder withAsyncReportDelay(int asyncReportDelay) {
181199
this.asyncReportDelay = asyncReportDelay;
182200
return this;
183201
}
184202

185203
public SandboxCheckReports build() {
186204
return new SandboxCheckReports(textDataCheck, documentAuthenticityCheck, livenessCheck, documentFaceMatchCheck, idDocumentComparisonCheck,
187-
supplementaryDocumentTextDataCheck, thirdPartyIdentityCheck, faceComparisonCheck, asyncReportDelay);
205+
supplementaryDocumentTextDataCheck, thirdPartyIdentityCheck, faceComparisonCheck, synecticsIdentityFraudChecks, asyncReportDelay);
188206
}
189207

190208
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.yoti.api.client.sandbox.docs.request.check;
2+
3+
import static com.yoti.api.client.spi.remote.util.Validation.notNull;
4+
5+
import com.yoti.api.client.sandbox.docs.request.check.report.SandboxCheckReport;
6+
7+
public class SandboxSynecticsIdentityFraudCheck extends SandboxCheck {
8+
9+
SandboxSynecticsIdentityFraudCheck(SandboxCheckResult result) {
10+
super(result);
11+
}
12+
13+
public static Builder builder() {
14+
return new Builder();
15+
}
16+
17+
/**
18+
* Builder for {@link SandboxSynecticsIdentityFraudCheck}
19+
*/
20+
public static class Builder extends SandboxCheck.Builder<Builder> {
21+
22+
private Builder() {}
23+
24+
@Override
25+
protected Builder self() {
26+
return this;
27+
}
28+
29+
@Override
30+
public SandboxSynecticsIdentityFraudCheck build() {
31+
notNull(recommendation, "recommendation");
32+
33+
SandboxCheckReport report = new SandboxCheckReport(recommendation, breakdown);
34+
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);
35+
36+
return new SandboxSynecticsIdentityFraudCheck(result);
37+
}
38+
39+
}
40+
}

yoti-sdk-sandbox/src/test/java/com/yoti/api/client/sandbox/docs/request/SandboxCheckReportsTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.yoti.api.client.sandbox.docs.request.check.SandboxLivenessCheck;
1212
import com.yoti.api.client.sandbox.docs.request.check.SandboxDocumentTextDataCheck;
1313
import com.yoti.api.client.sandbox.docs.request.check.SandboxSupplementaryDocumentTextDataCheck;
14+
import com.yoti.api.client.sandbox.docs.request.check.SandboxSynecticsIdentityFraudCheck;
1415
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityCheck;
1516

1617
import org.junit.Test;
@@ -29,6 +30,7 @@ public class SandboxCheckReportsTest {
2930
@Mock SandboxSupplementaryDocumentTextDataCheck supplementaryDocumentTextDataCheckMock;
3031
@Mock SandboxThirdPartyIdentityCheck thirdPartyIdentityCheckMock;
3132
@Mock SandboxFaceComparisonCheck faceComparisonCheckMock;
33+
@Mock SandboxSynecticsIdentityFraudCheck synecticsIdentityFraudCheckMock;
3234

3335
@Test
3436
public void builder_shouldAllowDocumentAuthenticityChecks() {
@@ -108,6 +110,16 @@ public void builder_shouldAllowFaceComparisonCheck() {
108110
assertThat(result.getFaceComparisonCheck(), is(faceComparisonCheckMock));
109111
}
110112

113+
@Test
114+
public void builder_shouldAllowSynecticsIdentityFraudChecks() {
115+
SandboxCheckReports result = SandboxCheckReports.builder()
116+
.withSynecticsIdentityFraudCheck(synecticsIdentityFraudCheckMock)
117+
.build();
118+
119+
assertThat(result.getSynecticsIdentityFraudChecks(), hasSize(1));
120+
assertThat(result.getSynecticsIdentityFraudChecks().get(0), is(synecticsIdentityFraudCheckMock));
121+
}
122+
111123
@Test
112124
public void builder_shouldAllowOverridingOfAsyncReportDelay() {
113125
SandboxCheckReports result = SandboxCheckReports.builder()

0 commit comments

Comments
 (0)