diff --git a/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js b/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js index 67b4934f..4d871f85 100644 --- a/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js +++ b/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.js @@ -1,7 +1,6 @@ 'use strict'; const Validation = require('../../../yoti_common/validation'); -const IdentityProfileRequirementsNotMetDetailResponse = require('./identity.profile.requirements.not.met.detail.response'); class IdentityProfileReportSchemesComplianceResponse { constructor(schemesCompliance) { @@ -17,17 +16,6 @@ class IdentityProfileReportSchemesComplianceResponse { Validation.isString(schemesCompliance.requirements_not_met_info, 'requirements_not_met_info'); /** @private @type {string|undefined} */ this.requirementsNotMetInfo = schemesCompliance.requirements_not_met_info; - - /** @private @type {IdentityProfileRequirementsNotMetDetailResponse[]|undefined} */ - this.requirementsNotMetDetails = []; - - if (schemesCompliance.requirements_not_met_details) { - Validation.isArray(schemesCompliance.requirements_not_met_details, 'requirements not met details'); - - this.requirementsNotMetDetails = schemesCompliance.requirements_not_met_details - // eslint-disable-next-line max-len - .map((requirementsNotMetDetail) => new IdentityProfileRequirementsNotMetDetailResponse(requirementsNotMetDetail)); - } } } @@ -45,10 +33,6 @@ class IdentityProfileReportSchemesComplianceResponse { getRequirementsNotMetInfo() { return this.requirementsNotMetInfo; } - - getRequirementsNotMetDetails() { - return this.requirementsNotMetDetails; - } } module.exports = IdentityProfileReportSchemesComplianceResponse; diff --git a/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js b/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js index a29a2503..e14fefef 100644 --- a/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js +++ b/tests/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.spec.js @@ -1,5 +1,4 @@ const IdentityProfileReportSchemesComplianceResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response'); -const IdentityProfileRequirementsNotMetDetailResponse = require('../../../../src/idv_service/session/retrieve/identity.profile.requirements.not.met.detail.response'); describe('IdentityProfileReportSchemesComplianceResponse', () => { let identityProfileReportSchemesComplianceResponse; @@ -12,6 +11,7 @@ describe('IdentityProfileReportSchemesComplianceResponse', () => { objective: 'STANDARD', }, requirements_met: true, + requirements_not_met_info: 'some string here', }); }); @@ -30,63 +30,9 @@ describe('IdentityProfileReportSchemesComplianceResponse', () => { }); }); - describe('with requirements not met', () => { - beforeAll(() => { - identityProfileReportSchemesComplianceResponse = new - IdentityProfileReportSchemesComplianceResponse({ - scheme: { - type: 'DBS', - objective: 'STANDARD', - }, - requirements_met: false, - requirements_not_met_info: 'some string here', - requirements_not_met_details: [ - { - failure_type: 'ID_DOCUMENT_EXTRACTION', - document_type: 'PASSPORT', - document_country_iso_code: 'GBR', - audit_id: 'audit-123', - details: 'something not right', - }, - { - failure_type: 'ID_DOCUMENT_AUTHENTICITY', - document_type: 'PASSPORT', - document_country_iso_code: 'GBR', - audit_id: 'audit-456', - details: 'something still not right', - }, - ], - }); - }); - describe('#getRequirementsNotMetInfo', () => { - it('Should return requirements_not_met_info string', () => { - expect(identityProfileReportSchemesComplianceResponse.getRequirementsNotMetInfo()).toBe('some string here'); - }); - }); - - describe('#getRequirementsNotMetDetails', () => { - it('Should return the list of RequirementsNotMetDetail', () => { - // eslint-disable-next-line max-len - const requirementsNotMetDetails = identityProfileReportSchemesComplianceResponse.getRequirementsNotMetDetails(); - expect(requirementsNotMetDetails).toHaveLength(2); - const [firstDetail, secondDetail] = requirementsNotMetDetails; - expect(firstDetail).toBeInstanceOf(IdentityProfileRequirementsNotMetDetailResponse); - expect(firstDetail).toEqual(expect.objectContaining({ - failureType: 'ID_DOCUMENT_EXTRACTION', - documentType: 'PASSPORT', - documentCountryIsoCode: 'GBR', - auditId: 'audit-123', - details: 'something not right', - })); - expect(firstDetail).toBeInstanceOf(IdentityProfileRequirementsNotMetDetailResponse); - expect(secondDetail).toEqual(expect.objectContaining({ - failureType: 'ID_DOCUMENT_AUTHENTICITY', - documentType: 'PASSPORT', - documentCountryIsoCode: 'GBR', - auditId: 'audit-456', - details: 'something still not right', - })); - }); + describe('#getRequirementsNotMetInfo', () => { + it('Should return requirements_not_met_info string', () => { + expect(identityProfileReportSchemesComplianceResponse.getRequirementsNotMetInfo()).toBe('some string here'); }); }); }); diff --git a/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts b/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts index 538c70b4..efac4284 100644 --- a/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts +++ b/types/src/idv_service/session/retrieve/identity.profile.report.schemes.compliance.response.d.ts @@ -7,14 +7,10 @@ declare class IdentityProfileReportSchemesComplianceResponse { private requirementsMet; /** @private @type {string|undefined} */ private requirementsNotMetInfo; - /** @private @type {IdentityProfileRequirementsNotMetDetailResponse[]|undefined} */ - private requirementsNotMetDetails; /** * @returns {object} */ getScheme(): object; isRequirementsMet(): boolean; getRequirementsNotMetInfo(): string; - getRequirementsNotMetDetails(): IdentityProfileRequirementsNotMetDetailResponse[]; } -import IdentityProfileRequirementsNotMetDetailResponse = require("./identity.profile.requirements.not.met.detail.response");