openownership / lib-cove-bods

Check that your data complies with the Beneficial Ownership Data Standard (BODS) using our install our data review library to analyse files via your command line interface
https://datareview.openownership.org/
Other
1 stars 0 forks source link

Additional check - Each Statement MUST have a unique statement identifier #130

Open kathryn-ods opened 3 months ago

kathryn-ods commented 3 months ago

Check current function duplicate_statement_id behaves as expected.

kathryn-ods commented 3 months ago

Valid data - generic test set

[
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity"
      }
    }
  },
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson"
    }
  },
  {
    "statementId": "fbfd0547-d0c6-4a00-b559-5c5e91c34f5c",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "93b53022ae6a",
    "recordType": "relationship",
    "recordDetails": {
      "isComponent": false,
      "subject": "c359f58d2977",
      "interestedParty": "10478c6cf6de"
    }
  }
]

Invalid 1 - 2 different statements with same id

[
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity"
      }
    }
  },
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson"
    }
  },
  {
    "statementId": "fbfd0547-d0c6-4a00-b559-5c5e91c34f5c",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "93b53022ae6a",
    "recordType": "relationship",
    "recordDetails": {
      "isComponent": false,
      "subject": "c359f58d2977",
      "interestedParty": "10478c6cf6de"
    }
  }
]

Invalid 2 - duplicated statement

[
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity"
      }
    }
  },
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity"
      }
    }
  },
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson"
    }
  },
  {
    "statementId": "fbfd0547-d0c6-4a00-b559-5c5e91c34f5c",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "93b53022ae6a",
    "recordType": "relationship",
    "recordDetails": {
      "isComponent": false,
      "subject": "c359f58d2977",
      "interestedParty": "10478c6cf6de"
    }
  }
]

Invalid 3 - slightly different statements (to represent republishing with same statementId

[
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity"
      }
    }
  },
  {
    "statementId": "1dc0e987-5c57-4a1c-b3ad-61353b66a9b7",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-04-04",
    "recordId": "c359f58d2977",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "legalEntity"
      }
    }
  },
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson"
    }
  },
  {
    "statementId": "fbfd0547-d0c6-4a00-b559-5c5e91c34f5c",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "93b53022ae6a",
    "recordType": "relationship",
    "recordDetails": {
      "isComponent": false,
      "subject": "c359f58d2977",
      "interestedParty": "10478c6cf6de"
    }
  }
]
radix0000 commented 2 months ago

@kathryn-ods Is this a duplicate of https://github.com/orgs/openownership/projects/10/views/1?pane=issue&itemId=75779898 ?

kathryn-ods commented 2 months ago

@radix0000 I think that link is the link to this ticket? is there another ticket?

radix0000 commented 2 months ago

This ticket: https://github.com/openownership/lib-cove-bods/issues/128 (Additional check - duplicate statementId)

kathryn-ods commented 2 months ago

@radix0000 ahh yes - there's some slight differences in the test data which I have consolidated into this ticket. I will close the other one.

kathryn-ods commented 3 weeks ago

Assuming you're already aware of this as this ticket is in the "front end to do" column but documenting just in case.

Currently the error message doesn't specific which Id has been duplicated

Image