diff --git a/src/model/edges/edges.js b/src/model/edges/edges.js index 490f86ea..8acef4df 100644 --- a/src/model/edges/edges.js +++ b/src/model/edges/edges.js @@ -61,7 +61,7 @@ export const getOwnershipEdges = (bodsData) => { const version = bodsData[0]?.publicationDetails?.bodsVersion || null; const filteredData = bodsData.filter((statement) => { - if (version === '0.4') { + if (version >= Number('0.4')) { return statement.recordType === 'relationship'; } else { return statement.statementType === 'ownershipOrControlStatement'; @@ -94,7 +94,7 @@ export const getOwnershipEdges = (bodsData) => { ? directOrIndirect : 'unknown'; let source, target; - if (version === '0.4') { + if (version >= Number('0.4')) { source = recordDetails.interestedParty; target = recordDetails.subject; } else { diff --git a/src/model/nodes/nodes.js b/src/model/nodes/nodes.js index 2473b043..2e37afaf 100644 --- a/src/model/nodes/nodes.js +++ b/src/model/nodes/nodes.js @@ -80,7 +80,7 @@ export const getPersonNodes = (bodsData) => { const version = bodsData[0]?.publicationDetails?.bodsVersion || null; const filteredData = bodsData.filter((statement) => { - if (version === '0.4') { + if (version >= Number('0.4')) { return statement.recordType === 'person'; } else { return statement.statementType === 'personStatement'; @@ -130,7 +130,7 @@ export const getEntityNodes = (bodsData) => { const version = bodsData[0]?.publicationDetails?.bodsVersion || null; const filteredData = bodsData.filter((statement) => { - if (version === '0.4') { + if (version >= Number('0.4')) { return statement.recordType === 'entity'; } else { return statement.statementType === 'entityStatement'; @@ -153,7 +153,7 @@ export const getEntityNodes = (bodsData) => { let countryCode; - if (version === '0.4') { + if (version >= Number('0.4')) { countryCode = recordDetails.jurisdiction ? sanitise(recordDetails.jurisdiction.code) : null; } else { // This gets the country code from v0.2 BODS (incorporatedInJurisdiction) diff --git a/src/utils/bods.js b/src/utils/bods.js index e920280a..8d7b78b0 100644 --- a/src/utils/bods.js +++ b/src/utils/bods.js @@ -1,7 +1,7 @@ export const closedRecords = new Set(); export const latest = (statements, closedRecords, version) => { - if (version === '0.4') { + if (version >= Number('0.4')) { const statementMap = {}; statements.forEach((statement) => {