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

Open kathryn-ods opened 1 month ago

kathryn-ods commented 1 month 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 1 month 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"
    }
  }
]