HAALCENTRAAL English translation
BRP API / Personen / Features / overzicht

Persoon: leeftijd

#language: en

Feature: Persoon: leeftijd

Rule: leeftijd is supplied where the date of birth is fully known

  Scenario Outline: the date of birth is a complete date
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde  |
    | geboortedatum (03.10) | <datum> |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person with only the following data
    | naam     | waarde     |
    | leeftijd | <leeftijd> |

    Examples:
    | datum              | leeftijd |
    | vandaag - 10 jaar  | 10       |
    | gisteren - 15 jaar | 15       |
    | morgen - 20 jaar   | 19       |

  @skip-verify
  Scenario Outline: the date of birth falls on 29 February in a leap year
    Given the person with citizen service number '000000231' has the following data
      | naam                  | waarde   |
      | geboortedatum (03.10) | 19960229 |
      When persons are searched on '<raadpleeg datum>' with the following parameters
      | naam                | waarde                          |
      | type                | RaadpleegMetBurgerservicenummer |
      | burgerservicenummer | 000000231                       |
      | fields              | burgerservicenummer,leeftijd    |
      Then the response has a person with only the following data
      | naam                | waarde     |
      | burgerservicenummer | 000000231  |
      | leeftijd            | <leeftijd> |

      Examples:
      | raadpleeg datum  | leeftijd |
      | 28 februari 2016 | 19       |
      | 29 februari 2016 | 20       |
      | 28 februari 2017 | 20       |
      | 01 maart 2017    | 21       |

Rule: leeftijd is not supplied where the date of birth is entirely unknown

  Scenario: the date of birth is an unknown date
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde   |
    | geboortedatum (03.10) | 00000000 |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person without data

Rule: leeftijd is not supplied where only the year of the date of birth is known

  Scenario: the month and day of the date of birth are unknown
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde   |
    | geboortedatum (03.10) | 20000000 |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person without data

Rule: leeftijd is not supplied where only the day of the date of birth is unknown and the month of birth equals the current month

  Scenario Outline: the day of the date of birth is unknown and the month of birth is not the current month
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde          |
    | geboortedatum (03.10) | <geboortedatum> |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person with only the following data
    | naam     | waarde     |
    | leeftijd | <leeftijd> |

    Examples:
    | geboortedatum            | leeftijd |
    | volgende maand - 10 jaar | 9        |
    | vorige maand - 10 jaar   | 10       |

  Scenario: the day of the date of birth is unknown and the month of birth is the current month
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde               |
    | geboortedatum (03.10) | deze maand - 10 jaar |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person without data

Rule: leeftijd is not supplied for a deceased person

  Scenario: the person has died
    Given the person with citizen service number '000000152' has the following data
    | naam                  | waarde   |
    | geboortedatum (03.10) | 19830526 |
    And the person has the following 'overlijden' data
    | datum overlijden (08.10) | plaats overlijden (08.20) | land overlijden (08.30) |
    | 20020701                 | 0518                      | 6030                    |
    And the person has the following 'inschrijving' data
    | naam                                 | waarde |
    | reden opschorting bijhouding (67.20) | O      |
    When persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | leeftijd                        |
    Then the response has a person with only the following 'opschortingBijhouding' data
    | naam               | waarde     |
    | reden.code         | O          |
    | reden.omschrijving | overlijden |