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: birthDate is a sensible date #121

Closed kathryn-ods closed 1 month ago

kathryn-ods commented 3 months ago

Specification for Check(s): Check 1: That birthDate is not a future date.

On fail:

Error message: Birth date is in the future. Info message: Birth date (birthDate): [VALUE]

Check 2: That birthDate is not before 1800

On fail:

Error message: Birth date is before 1800 Info message: Birth date (birthDate): [VALUE]

kathryn-ods commented 3 months ago

Valid 1 - year only

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

Valid 2 - full date

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

Invalid 1 - future full date

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

Invalid 2 - future year only

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

Invalid 3 - past year only

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

Invalid 4 - past year and month

[
  {
    "statementId": "019a93f1-e470-42e9-957b-03559861b2e2",
    "declarationSubject": "c359f58d2977",
    "statementDate": "2020-03-04",
    "recordId": "10478c6cf6de",
    "recordType": "person",
    "recordDetails": {
      "isComponent": false,
      "personType": "knownPerson",
      "birthDate": "1685-01"
    }
  }
]
radix0000 commented 2 months ago

@kathryn-ods @kd-ods There is a load of test data, this is just an example, which fails the "declarationSubject being in the dataset" check. I assume it is okay if I just go through and change it (i.e. change the declarationSubject to be the recordId for these individual statements), but just wanted to check.

kathryn-ods commented 2 months ago

@radix0000 yes apologies - these are ones where I have clipped one statement from a larger set and forgot to update that. I can update if you want or yes you can update them.