Skip to content

Commit 042e9de

Browse files
authored
SDK-2740 Expose IDV breakdown's process field (#537)
* Added optional 'process' field in BreakdownResponse. Updated "idv" and "idv-identity-checks" examples view partial "check.ejs". * Update JSDOC in BreakdownResponse
1 parent 97e8ee0 commit 042e9de

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

examples/idv-identity-checks/views/pages/partials/check.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ formatString = function (value) {
114114
<td><%= breakdown.getResult(); %></td>
115115
<% } %>
116116
</tr>
117+
<tr>
118+
<% if (breakdown.getProcess()) { %>
119+
<td>Process</td>
120+
<td><%= breakdown.getProcess(); %></td>
121+
<% } %>
122+
</tr>
117123
<% if (breakdown.getDetails() && breakdown.getDetails().length > 0) { %>
118124
<tr>
119125
<td>Details</td>

examples/idv/views/pages/partials/check.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ formatString = function (value) {
113113
<td><%= breakdown.getResult(); %></td>
114114
<% } %>
115115
</tr>
116+
<tr>
117+
<% if (breakdown.getProcess()) { %>
118+
<td>Process</td>
119+
<td><%= breakdown.getProcess(); %></td>
120+
<% } %>
121+
</tr>
116122
<% if (breakdown.getDetails() && breakdown.getDetails().length > 0) { %>
117123
<tr>
118124
<td>Details</td>

src/idv_service/session/retrieve/breakdown.response.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class BreakdownResponse {
1313
/** @private */
1414
this.result = breakdown.result;
1515

16+
Validation.isString(breakdown.process, 'process', true);
17+
/** @private */
18+
this.process = breakdown.process;
19+
1620
if (breakdown.details) {
1721
Validation.isArrayOfType(breakdown.details, Object, 'details');
1822
/** @private */
@@ -37,6 +41,13 @@ class BreakdownResponse {
3741
return this.result;
3842
}
3943

44+
/**
45+
* @returns {string|undefined} Likely 'AUTOMATED' or 'EXPERT_REVIEW'
46+
*/
47+
getProcess() {
48+
return this.process;
49+
}
50+
4051
/**
4152
* @returns {DetailsResponse[]}
4253
*/

tests/idv_service/session/retrieve/breakdown.response.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('BreakdownResponse', () => {
99
sub_check: 'some-sub-check',
1010
result: 'some-result',
1111
details: [{}],
12+
process: 'AUTOMATED',
1213
});
1314
});
1415

@@ -24,6 +25,12 @@ describe('BreakdownResponse', () => {
2425
});
2526
});
2627

28+
describe('#getProcess', () => {
29+
it('should return result', () => {
30+
expect(breakdownResponse.getProcess()).toBe('AUTOMATED');
31+
});
32+
});
33+
2734
describe('#getDetails', () => {
2835
describe('when details are available', () => {
2936
it('should return array of details', () => {

types/src/idv_service/session/retrieve/breakdown.response.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ declare class BreakdownResponse {
66
/** @private */
77
private result;
88
/** @private */
9+
private process;
10+
/** @private */
911
private details;
1012
/**
1113
* @returns {string}
@@ -15,6 +17,10 @@ declare class BreakdownResponse {
1517
* @returns {string}
1618
*/
1719
getResult(): string;
20+
/**
21+
* @returns {string} Likely 'AUTOMATED' or 'EXPERT_REVIEW'
22+
*/
23+
getProcess(): string;
1824
/**
1925
* @returns {DetailsResponse[]}
2026
*/

0 commit comments

Comments
 (0)