HAALCENTRAAL English translation
BRP API / Personen / Features / fields-gba

GbaPersoon: supplying opschortingBijhouding when not requested with fields

#language: en

@gba
Feature: GbaPersoon: supplying opschortingBijhouding when not requested with fields


Rule: opschortingBijhouding is supplied automatically where applicable

  Scenario Outline: 'reden opschorting bijhouding (67.20)' with value '<opschorting reden>'
    Given the person with citizen service number '000000152' has the following data
    | anummer (01.10) | voornamen (02.10) | voorvoegsel (02.30) | geslachtsnaam (02.40) | geboortedatum (03.10) | geslachtsaanduiding (04.10) |
    | 0123456789      | William           | de                  | Vries                 | 20040526              | M                           |
    And the person has the following 'inschrijving' data
    | datum opschorting bijhouding (67.10) | reden opschorting bijhouding (67.20) |
    | 20020701                             | <opschorting reden>                  |
    When gba persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000152                       |
    | fields              | naam,geboorte,geslacht          |
    Then the response has a person with the following data
    | naam                  | waarde |
    | geslacht.code         | M      |
    | geslacht.omschrijving | man    |
    And the person has the following 'naam' data
    | naam          | waarde  |
    | voornamen     | William |
    | voorvoegsel   | de      |
    | geslachtsnaam | Vries   |
    And the person has the following 'geboorte' data
    | naam  | waarde   |
    | datum | 20040526 |
    And the person has the following 'opschortingBijhouding' data
    | naam               | waarde               |
    | reden.code         | <opschorting reden>  |
    | reden.omschrijving | <reden omschrijving> |
    | datum              | 20020701             |

    Examples:
    | opschorting reden | reden omschrijving        |
    | O                 | overlijden                |
    | E                 | emigratie                 |
    | M                 | ministerieel besluit      |
    | R                 | pl is aangelegd in de rni |
    | .                 | onbekend                  |

  Scenario: an entirely unknown date of Opschorting Bijhouding
    Given the person with citizen service number '000000322' has the following 'inschrijving' data
    | naam                                 | waarde   |
    | datum opschorting bijhouding (67.10) | 00000000 |
    When gba persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000322                       |
    | fields              | burgerservicenummer             |
    Then the response has a person with the following data
    | naam                        | waarde    |
    | burgerservicenummer         | 000000322 |
    | opschortingBijhouding.datum | 00000000  |

Rule: opschortingBijhouding may not be requested, because it is supplied automatically

  @fout-case
  Scenario Outline: field <fields> may not be requested, because it is supplied automatically
    When gba persons are searched with the following parameters
    | naam                | waarde                          |
    | type                | RaadpleegMetBurgerservicenummer |
    | burgerservicenummer | 000000024                       |
    | fields              | <fields>                        |
    Then the response has an object with the following data
     | naam     | waarde                                                      |
     | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
     | title    | Een of meerdere parameters zijn niet correct.               |
     | status   | 400                                                         |
     | detail   | De foutieve parameter(s) zijn: fields[0].                   |
     | code     | paramsValidation                                            |
     | instance | /haalcentraal/api/brp/personen                              |
     And the object has the following 'invalidParams' data
     | code   | name      | reason                                        |
     | fields | fields[0] | Parameter bevat een niet toegestane veldnaam. |

    Examples:
    | fields                                   |
    | opschortingBijhouding                    |
    | opschortingBijhouding.reden              |
    | opschortingBijhouding.reden.code         |
    | opschortingBijhouding.reden.omschrijving |
    | opschortingBijhouding.datum              |
    | opschortingBijhouding.datum.type         |
    | opschortingBijhouding.datum.datum        |
    | opschortingBijhouding.datum.langFormaat  |
    | opschortingBijhouding.datum.jaar         |
    | opschortingBijhouding.datum.maand        |
    | opschortingBijhouding.datum.onbekend     |

  @fout-case
  Scenario: several fields of opschortingBijhouding are requested
    When gba persons are searched with the following parameters
    | naam                | waarde                                                                           |
    | type                | RaadpleegMetBurgerservicenummer                                                  |
    | burgerservicenummer | 000000024                                                                        |
    | fields              | burgerservicenummer,opschortingBijhouding.reden,opschortingBijhouding.datum,naam |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: fields[1], fields[2].        |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/brp/personen                              |
    And the object has the following 'invalidParams' data
    | code   | name      | reason                                        |
    | fields | fields[1] | Parameter bevat een niet toegestane veldnaam. |
    | fields | fields[2] | Parameter bevat een niet toegestane veldnaam. |