HAALCENTRAAL English translation
BRP API / Bewoning / Features / onjuist-gba

consult occupancy within a period for a corrected verblijfplaats

#language: en

@gba
Feature: consult occupancy within a period for a corrected verblijfplaats

  As a consumer of the Bewoning API
  I want occupancy to be based only on correct data and incorrect (corrected) data to be ignored

  Background:
    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                         |

  Rule: corrected data is not used

    Scenario: the start date of the address occupancy has been corrected and the period requested ends before the correct date but after the incorrect start date
      Given the person with citizen service number '000000024' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20160526                           |
      And the 'verblijfplaats' has been corrected to the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | functie adres (10.10) |
      | 0800                              | 20160601                           | W                     |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2016-01-01         |
      | datumTot                         | 2016-05-28         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has 0 occupancies

    Scenario: the start date of the address occupancy has been corrected and the period requested begins after the correct date but before the incorrect start date
      Given the person with citizen service number '000000024' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20160601                           |
      And the 'verblijfplaats' has been corrected to the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | functie adres (10.10) |
      | 0800                              | 20160526                           | W                     |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2016-05-28         |
      | datumTot                         | 2017-01-01         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has an occupancy with the following data
      | naam                             | waarde                    |
      | periode                          | 2016-05-28 tot 2017-01-01 |
      | adresseerbaarObjectIdentificatie | 0800010000000001          |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000024           |

    Scenario: the start date of the next address occupancy has been corrected and the period requested begins after the correct date but before the incorrect start date of the next address occupancy
      Given the person with citizen service number '000000024' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20100818                           |
      And the person was subsequently registered at address 'A2' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20160601                           |
      And the 'verblijfplaats' has been corrected to the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | functie adres (10.10) |
      | 0800                              | 20160526                           | W                     |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2016-05-28         |
      | datumTot                         | 2017-01-01         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has 0 occupancies

    Scenario: the start date of the next address occupancy has been corrected and the period requested ends before the correct date but after the incorrect start date of the next address occupancy
      Given the person with citizen service number '000000024' is registered at address 'A1' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20100818                           |
      And the person was subsequently registered at address 'A2' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20160526                           |
      And the 'verblijfplaats' has been corrected to the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | functie adres (10.10) |
      | 0800                              | 20160601                           | W                     |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde             |
      | type                             | BewoningMetPeriode |
      | datumVan                         | 2016-01-01         |
      | datumTot                         | 2016-05-28         |
      | adresseerbaarObjectIdentificatie | 0800010000000001   |
      Then the response has an occupancy with the following data
      | naam                             | waarde                    |
      | periode                          | 2016-01-01 tot 2016-05-28 |
      | adresseerbaarObjectIdentificatie | 0800010000000001          |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000024           |