HAALCENTRAAL English translation
BRP API / Personen / Features / fields

requesting Persoon/PersoonBeperkt fields with fields

# language: en
Feature: requesting Persoon/PersoonBeperkt fields with fields
  As a consumer of the BRP API
  I want to be able to indicate which fields of the person or persons requested must be supplied
  So that I receive only the fields for which I have purpose limitation, and at the same time contribute to data minimization

  Background:
    Given the person with citizen service number '000000152' has the following data
      | anummer (01.10) | voornamen (02.10) | geslachtsnaam (02.40) | aanduiding naamgebruik (61.10) | geslachtsaanduiding (04.10) | geboortedatum (03.10) |
      |      1234567890 | Yvonne Johanna    | Kierkegaarde          | E                              | V                           |              19561115 |
    And the person has a 'partner' with the following data
      | burgerservicenummer (01.20) | voornamen (02.10) | geslachtsnaam (02.40) |
      |                   999992971 | Robert            | Bronwaßer             |

  Rule: Only fields requested with fields are supplied

    Scenario: the 'root' field of a person is requested
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | aNummer                         |
      Then the response has a person with only the following data
        | naam    | waarde     |
        | aNummer | 1234567890 |

    Scenario: the 'root' field of a 'persoon beperkt' is requested
      When persons are searched with the following parameters
        | naam          | waarde                              |
        | type          | ZoekMetGeslachtsnaamEnGeboortedatum |
        | geslachtsnaam | Kierkegaarde                        |
        | geboortedatum |                          1956-11-15 |
        | fields        | burgerservicenummer                 |
      Then the response has a person with only the following data
        | naam                | waarde    |
        | burgerservicenummer | 000000152 |

    Scenario: several 'root' fields of a person are requested
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | aNummer,burgerservicenummer     |
      Then the response has a person with only the following data
        | naam                | waarde     |
        | aNummer             | 1234567890 |
        | burgerservicenummer |  000000152 |

    Scenario: all fields of a 'gegevensgroep' field of a person are requested
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | naam                            |
      Then the response has a person with only the following 'naam' data
        | naam                               | waarde                      |
        | voornamen                          | Yvonne Johanna              |
        | geslachtsnaam                      | Kierkegaarde                |
        | voorletters                        | Y.J.                        |
        | volledigeNaam                      | Yvonne Johanna Kierkegaarde |
        | aanduidingNaamgebruik.code         | E                           |
        | aanduidingNaamgebruik.omschrijving | eigen geslachtsnaam         |

    Scenario: all fields of a 'gegevensgroep' field of a 'persoon beperkt' are requested
      When persons are searched with the following parameters
        | naam          | waarde                              |
        | type          | ZoekMetGeslachtsnaamEnGeboortedatum |
        | geslachtsnaam | Kierkegaarde                        |
        | geboortedatum |                          1956-11-15 |
        | fields        | naam                                |
      Then the response has a person with only the following 'naam' data
        | naam          | waarde                      |
        | voornamen     | Yvonne Johanna              |
        | geslachtsnaam | Kierkegaarde                |
        | voorletters   | Y.J.                        |
        | volledigeNaam | Yvonne Johanna Kierkegaarde |

  Rule: The full path of a field is the combination of the name of the field and the names of its 'ouder' fields, with a '.' character between the field names

    Scenario: a field of a 'gegevensgroep' field of a person is requested
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | naam.geslachtsnaam              |
      Then the response has a person with only the following 'naam' data
        | naam          | waarde       |
        | geslachtsnaam | Kierkegaarde |

    Scenario: several fields of a 'gegevensgroep' field of a person are requested
      When persons are searched with the following parameters
        | naam                | waarde                            |
        | type                | RaadpleegMetBurgerservicenummer   |
        | burgerservicenummer |                         000000152 |
        | fields              | naam.geslachtsnaam,naam.voornamen |
      Then the response has a person with only the following 'naam' data
        | naam          | waarde         |
        | geslachtsnaam | Kierkegaarde   |
        | voornamen     | Yvonne Johanna |

    Scenario: fields of several 'gegevensgroepen' of a person are requested
      When persons are searched with the following parameters
        | naam                | waarde                            |
        | type                | RaadpleegMetBurgerservicenummer   |
        | burgerservicenummer |                         000000152 |
        | fields              | naam.geslachtsnaam,geboorte.datum |
      Then the response has a person with only the following 'naam' data
        | naam          | waarde       |
        | geslachtsnaam | Kierkegaarde |
      And the person has the following 'geboorte' data
        | naam              | waarde           |
        | datum.type        | Datum            |
        | datum.datum       |       1956-11-15 |
        | datum.langFormaat | 15 november 1956 |

    Scenario: a field of a 'gegevensgroep collectie' field of a person is requested
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | partners.burgerservicenummer    |
      Then the response has a person with a 'partner' with the following data
        | naam                | waarde    |
        | burgerservicenummer | 999992971 |

  Rule: A field whose full path only partly matches a field path supplied is not supplied

    Scenario: the path supplied is the full path of the voornamen field and also part of the full path of the voornamen field of the partner, ouder and kind fields of the person
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | naam.voornamen                  |
      Then the response has a person with only the following 'naam' data
        | naam      | waarde         |
        | voornamen | Yvonne Johanna |

  Rule: A requested field without a value is not supplied

    Scenario: the field requested has no value
      When persons are searched with the following parameters
        | naam                | waarde                          |
        | type                | RaadpleegMetBurgerservicenummer |
        | burgerservicenummer |                       000000152 |
        | fields              | naam.adellijkeTitelPredicaat    |
      Then the response has a person without 'naam' data