HAALCENTRAAL English translation
BRP API / Bewoning / Features / bewoner-met-relaties-gba

determining the occupant for persons with child, parent and/or partner relationships

# language: en

@gba
Feature: determining the occupant for persons with child, parent and/or partner relationships

  As a consumer of the bewoner API
  I want that, for an occupant with child, parent and/or partner relationships,
  the citizen service number of the occupant is supplied
  and not the citizen service number of the child, parent or partner

  Scenario: a person with a child, parent and partner who are registered in the BRP
    Given address 'A1' has the following data
    | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
    | 0800                 | 0800010000000001                         |
    And the person with citizen service number '000000012' has a parent '1' with the following data
    | naam                        | waarde    |
    | burgerservicenummer (01.20) | 000000024 |
    And the person has a 'partner' with the following data
    | naam                        | waarde    |
    | burgerservicenummer (01.20) | 000000036 |
    And the person has a 'kind' with the following data
    | naam                        | waarde    |
    | burgerservicenummer (01.20) | 000000048 |
    And the person is registered at address 'A1' with the following data
    | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
    | 0800                              | 20210102                           |
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2022-01-01         |
    | datumTot                         | 2022-03-01         |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an occupancy with the following data
    | naam                             | waarde                    |
    | periode                          | 2022-01-01 tot 2022-03-01 |
    | adresseerbaarObjectIdentificatie | 0800010000000001          |
    And the occupancy has an occupant with the following data
    | burgerservicenummer |
    | 000000012           |

    Scenario: the person has parents, partners and children who are registered in the BRP
      Given address 'A1' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000001                         |
      And the person with citizen service number '000000012' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20100818                           |
      And the person has a parent '1' with the following data
      | naam                        | waarde    |
      | burgerservicenummer (01.20) | 000000024 |
      And the person has a parent '2' with the following data
      | naam                        | waarde    |
      | burgerservicenummer (01.20) | 000000036 |
      And the person has a 'partner' with the following data
      | naam                        | waarde    |
      | burgerservicenummer (01.20) | 000000048 |
      And the person has a 'kind' with the following data
      | naam                        | waarde    |
      | burgerservicenummer (01.20) | 000000061 |
      And the person has a 'kind' with the following data
      | naam                        | waarde    |
      | burgerservicenummer (01.20) | 000000073 |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2021-01-01         |
      | datumTot                         | 2022-01-01         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has an occupancy with the following data
      | naam                             | waarde                    |
      | periode                          | 2021-01-01 tot 2022-01-01 |
      | adresseerbaarObjectIdentificatie | 0800010000000001          |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

    Scenario: the person has parents, partners and children who are not registered in the BRP
      Given address 'A1' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000001                         |
      And the person with citizen service number '000000012' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20100818                           |
      And the person has a parent '1' with the following data
      | naam                  | waarde |
      | geslachtsnaam (02.40) | moeder |
      And the person has a parent '2' with the following data
      | naam                  | waarde |
      | geslachtsnaam (02.40) | vader  |
      And the person has a 'partner' with the following data
      | naam                  | waarde  |
      | geslachtsnaam (02.40) | partner |
      And the person has a 'kind' with the following data
      | naam                  | waarde |
      | geslachtsnaam (02.40) | kind   |
      And the person has a 'kind' with the following data
      | naam                  | waarde |
      | geslachtsnaam (02.40) | kind   |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2021-01-01         |
      | datumTot                         | 2022-01-01         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has an occupancy with the following data
      | naam                             | waarde                    |
      | periode                          | 2021-01-01 tot 2022-01-01 |
      | adresseerbaarObjectIdentificatie | 0800010000000001          |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

    Scenario Outline: data of the person has been changed
      Given address 'A1' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000001                         |
      And address 'A2' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000002                         |
      And the person with citizen service number '000000012' has the following data
      | naam                           | waarde |
      | aanduiding naamgebruik (61.10) | E      |
      And the person has been changed to the following data
      | naam                           | waarde    |
      | burgerservicenummer (01.20)    | 000000024 |
      | aanduiding naamgebruik (61.10) | V         |
      And the person is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20200526                           |
      And the person was subsequently registered at address 'A2' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20221014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | <datumVan>         |
      | datumTot                         | <datumTot>         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has an occupancy with the following data
      | naam                             | waarde           |
      | periode                          | <periode>        |
      | adresseerbaarObjectIdentificatie | 0800010000000001 |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000024           |

      Examples:
      | datumVan   | datumTot   | periode                   | testgeval                      |
      | 2020-05-26 | 2020-06-01 | 2020-05-26 tot 2020-06-01 | vanaf eerste dag bewoning      |
      | 2020-05-01 | 2020-05-27 | 2020-05-26 tot 2020-05-27 | tot en met eerste dag bewoning |
      | 2021-01-01 | 2022-01-01 | 2021-01-01 tot 2022-01-01 | in bewoning                    |
      | 2022-10-13 | 2022-11-14 | 2022-10-13 tot 2022-10-14 | vanaf laatste dag bewoning     |
      | 2020-05-01 | 2022-11-01 | 2020-05-26 tot 2022-10-14 | overlapt hele bewoning         |