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

COVE Validation check: Check that dates of death of natural persons are sane #59

Closed siwhitehouse closed 1 month ago

siwhitehouse commented 4 years ago

I'm moving this over from the (internal ODSC) issue. There was no further specification in the issue.

I think we could apply the following sanity checks:

kathryn-ods commented 3 months ago

Valid 1

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "birthDate": "1992-01-01",
      "deathDate":"2024-07"
    }
  }
]

Valid 2

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "deathDate":"2012-09-01"
    }
  }
]

Invalid 1 - death before birth

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "birthDate": "1992-01-01",
      "deathDate":"1990-07"
    }
  }
]

Invalid 2 - >120 years old

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "birthDate": "1800",
      "deathDate":"1990-05-01"
    }
  }
]

Invalid 3 - death in future

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "deathDate":"2099-05-01"
    }
  }
]

Invalid 4 - death date too long ago

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "deathDate":"1700"
    }
  }
]