HAALCENTRAAL English translation
BRP API / Bewoning / Features / echte-datums-gba

occupancy on a reference date with real dates

#language: en

@gba
Feature: occupancy on a reference date with real dates

    Background:
      Given address 'vorige' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000001                         |
      And address 'gevraagd' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000002                         |
      And address 'volgende' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000003                         |
      And address 'daaropvolgende' has the following data
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      | 0800                 | 0800010000000004                         |
      
  Rule: the occupancy supplied is limited by the start date of the stay requested up to the start date of the next stay

    Scenario Outline: first and only verblijfplaats and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | omschrijving                            | peildatum  | periode tot |
      | peildatum op datum aanvang adreshouding | 2021-05-26 | 2021-05-27  |
      | peildatum na datum aanvang adreshouding | 2023-10-14 | 2023-10-15  |

    Scenario Outline: first and only verblijfplaats and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                                     | peildatum  |
      | peildatum op dag voor datum aanvang adreshouding | 2021-05-25 |
      | peildatum ruim voor datum aanvang adreshouding   | 2020-05-26 |

    Scenario Outline: next verblijfplaats and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | omschrijving                                        | peildatum  | periode tot |
      | peildatum op datum aanvang adreshouding             | 2021-05-26 | 2021-05-27  |
      | peildatum na datum aanvang adreshouding             | 2021-07-01 | 2021-07-02  |
      | peildatum op dag voor aanvang volgende adreshouding | 2021-10-13 | 2021-10-14  |

    Scenario Outline: next verblijfplaats and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                                         | peildatum  |
      | peildatum op dag voor datum aanvang adreshouding     | 2021-05-25 |
      | peildatum ruim voor datum aanvang adreshouding       | 2020-05-26 |
      | peildatum op dag datum aanvang volgende adreshouding | 2021-10-14 |
      | peildatum na aanvang volgende adreshouding           | 2022-05-26 |

    Scenario Outline: the next verblijfplaats is a stay abroad and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the 'verblijfplaats' has been changed to the following data
      | land (13.10) | datum aanvang adres buitenland (13.20) | regel 1 adres buitenland (13.30) | regel 2 adres buitenland (13.40) | regel 3 adres buitenland (13.50) |
      | 5010         | 20211014                               | Rue du pomme 26                  | Bruxelles                        | postcode 1000                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | omschrijving                                        | peildatum  | periode tot |
      | peildatum op datum aanvang adreshouding             | 2021-05-26 | 2021-05-27  |
      | peildatum na datum aanvang adreshouding             | 2021-07-01 | 2021-07-02  |
      | peildatum op dag voor aanvang volgende adreshouding | 2021-10-13 | 2021-10-14  |

    Scenario Outline: the next verblijfplaats is a stay abroad and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the 'verblijfplaats' has been changed to the following data
      | land (13.10) | datum aanvang adres buitenland (13.20) | regel 1 adres buitenland (13.30) | regel 2 adres buitenland (13.40) | regel 3 adres buitenland (13.50) |
      | 5010         | 20211014                               | Rue du pomme 26                  | Bruxelles                        | postcode 1000                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                                         | peildatum  |
      | peildatum op dag voor datum aanvang adreshouding     | 2021-05-25 |
      | peildatum ruim voor datum aanvang adreshouding       | 2020-05-26 |
      | peildatum op dag datum aanvang volgende adreshouding | 2021-10-14 |
      | peildatum na aanvang volgende adreshouding           | 2022-05-26 |

    Scenario: previous, next and subsequent verblijfplaats
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | 2021-07-01           |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                    |
      | periode                          | 2021-07-01 tot 2021-07-02 |
      | adresseerbaarObjectIdentificatie | 0800010000000002          |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

  Rule: a person is no longer an occupant from the date of suspension

    Scenario Outline: the person died during the stay at the address requested and a reference date before the death is requested
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person has the following 'inschrijving' data
      | datum opschorting bijhouding (67.10) | reden opschorting bijhouding (67.20) |
      | 20211127                             | O                                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | scenario                        | peildatum  | periode tot |
      | peildatum voor overlijden       | 2021-07-01 | 2021-07-02  |
      | peildatum 1 dag voor overlijden | 2021-11-26 | 2021-11-27  |

    Scenario Outline: the person died during the stay at the address requested and a reference date after the death is requested
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person has the following 'inschrijving' data
      | datum opschorting bijhouding (67.10) | reden opschorting bijhouding (67.20) |
      | 20211127                             | O                                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                      | peildatum  |
      | peildatum is datum van overlijden | 2021-11-27 |
      | peildatum na overlijden           | 2022-01-01 |

    Scenario Outline: the person died after leaving the address requested and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      And the person has the following 'inschrijving' data
      | datum opschorting bijhouding (67.10) | reden opschorting bijhouding (67.20) |
      | 20211127                             | O                                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | omschrijving                                        | peildatum  | periode tot |
      | peildatum op datum aanvang adreshouding             | 2021-05-26 | 2021-05-27  |
      | peildatum na datum aanvang adreshouding             | 2021-07-01 | 2021-07-02  |
      | peildatum op dag voor aanvang volgende adreshouding | 2021-07-29 | 2021-07-30  |

    Scenario Outline: the person died after leaving the address requested and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      And the person has the following 'inschrijving' data
      | datum opschorting bijhouding (67.10) | reden opschorting bijhouding (67.20) |
      | 20211127                             | O                                    |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                                             | peildatum  |
      | peildatum op datum aanvang volgende adreshouding         | 2021-07-30 |
      | peildatum na datum aanvang volgende maar voor overlijden | 2021-09-01 |
      | peildatum is datum overlijden                            | 2021-11-27 |
      | peildatum na datum overlijden                            | 2022-01-01 |

  Rule: onjuist is ignored

    Scenario Outline: the stay has been corrected, the person never lived here and <omschrijving>
      Given the person with citizen service number '000000012' is registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
       And the registration was subsequently corrected as a registration at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | omschrijving                                             | peildatum  |
      | peildatum is oorspronkelijke (onjuiste) datum aanvang    | 2021-05-16 |
      | peildatum is gecorrigeerde datum aanvang                 | 2021-05-26 |
      | peildatum tussen onjuiste en gecorrigeerde datum aanvang | 2021-05-18 |
      | peildatum na gecorrigeerde datum aanvang                 | 2021-06-01 |

    Scenario Outline: <scenario>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      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                              | <nieuwe datum>                     | W                     |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | scenario                                                                                       | nieuwe datum | peildatum  | periode tot |
      | datum aanvang is gecorrigeerd naar eerdere datum en peildatum is nieuwe datum aanvang          | 20210520     | 2021-05-20 | 2021-05-21  |
      | datum aanvang is gecorrigeerd naar eerdere datum en peildatum na nieuwe datum aanvang          | 20210523     | 2021-05-23 | 2021-05-24  |
      | datum aanvang is gecorrigeerd naar eerdere datum en peildatum na oorspronkelijke datum aanvang | 20210520     | 2021-06-12 | 2021-06-13  |
      | datum aanvang is gecorrigeerd naar latere datum en peildatum is nieuwe datum aanvang           | 20210529     | 2021-05-29 | 2021-05-30  |
      | datum aanvang is gecorrigeerd naar latere datum en peildatum na nieuwe datum aanvang           | 20210529     | 2021-06-12 | 2021-06-13  |

    Scenario Outline: <scenario>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      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                              | <nieuwe datum>                     | W                     |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | scenario                                                                                             | nieuwe datum | peildatum  |
      | datum aanvang is gecorrigeerd naar eerdere datum en peildatum is dag voor nieuwe datum aanvang       | 20210520     | 2021-05-19 |
      | datum aanvang is gecorrigeerd naar latere datum en peildatum tussen onjuiste en nieuwe datum aanvang | 20210529     | 2021-05-27 |

    Scenario Outline: <scenario>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      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                              | <nieuwe datum>                     | W                     |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | scenario                                                                                                   | nieuwe datum | peildatum  | periode tot |
      | datum aanvang volgende is gecorrigeerd naar eerdere datum en peildatum ligt voor nieuwe datum              | 20210725     | 2021-07-24 | 2021-07-25  |
      | datum aanvang volgende is gecorrigeerd naar latere datum en peildatum ligt tussen onjuiste en nieuwe datum | 20210803     | 2021-08-02 | 2021-08-03  |

    Scenario Outline: <scenario>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      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                              | <nieuwe datum>                     | W                     |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | scenario                                                                                                    | nieuwe datum | peildatum  |
      | datum aanvang volgende is gecorrigeerd naar eerdere datum en peildatum is nieuwe datum                      | 20210725     | 2021-07-25 |
      | datum aanvang volgende is gecorrigeerd naar eerdere datum en peildatum ligt tussen onjuiste en nieuwe datum | 20210725     | 2021-07-27 |
      | datum aanvang volgende is gecorrigeerd naar latere datum en peildatum is nieuwe datum                       | 20210803     | 2021-08-03 |

    Scenario Outline: the stay at the address requested is incorrect and <scenario>
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the registration was subsequently corrected as a registration at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | <nieuwe datum>                     |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | 2021-05-26           |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | scenario                                                 | nieuwe datum |
      | gecorrigeerde verblijf begint op datum onjuiste verblijf | 20210526     |
      | gecorrigeerde verblijf begint op datum vorige            | 20210516     |
    
    Scenario Outline: the next stay is incorrect
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the registration was subsequently corrected as a registration at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | <nieuwe datum>                     |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | <peildatum>          |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has an occupancy with the following data
      | naam                             | waarde                        |
      | periode                          | <peildatum> tot <periode tot> |
      | adresseerbaarObjectIdentificatie | 0800010000000002              |
      And the occupancy has an occupant with the following data
      | burgerservicenummer |
      | 000000012           |

      Examples:
      | scenario                                                                                           | nieuwe datum | peildatum  | periode tot |
      | gecorrigeerde verblijf begint op datum onjuiste verblijf en peildatum is datum onjuiste verblijf   | 20210730     | 2021-07-30 | 2021-07-31  |
      | gecorrigeerde verblijf begint op datum onjuiste verblijf en peildatum voor datum onjuiste verblijf | 20210730     | 2021-07-01 | 2021-07-02  |
      | gecorrigeerde verblijf begint op datum onjuiste verblijf en peildatum na datum onjuiste verblijf   | 20210730     | 2021-09-01 | 2021-09-02  |
      | gecorrigeerde verblijf begint op datum gevraagde verblijf en peildatum is datum onjuiste verblijf  | 20210526     | 2021-07-30 | 2021-07-31  |
      | gecorrigeerde verblijf begint op datum gevraagde verblijf en peildatum na datum onjuiste verblijf  | 20210526     | 2021-09-01 | 2021-09-02  |

    Scenario Outline: the next stay is incorrect and the reference date falls after the start date of the subsequent stay
      Given the person with citizen service number '000000012' is registered at address 'vorige' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210516                           |
      And the person was subsequently registered at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210526                           |
      And the person was subsequently registered at address 'volgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20210730                           |
      And the registration was subsequently corrected as a registration at address 'gevraagd' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | <nieuwe datum>                     |
      And the person was subsequently registered at address 'daaropvolgende' with the following data
      | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
      | 0800                              | 20211014                           |
      When gba occupancy is searched with the following parameters
      | naam                             | waarde               |
      | type                             | BewoningMetPeildatum |
      | peildatum                        | 2021-10-14           |
      | adresseerbaarObjectIdentificatie | 0800010000000002     |
      Then the response has 0 occupancies

      Examples:
      | scenario                                                  | nieuwe datum |
      | gecorrigeerde verblijf begint op datum onjuiste verblijf  | 20210730     |
      | gecorrigeerde verblijf begint op datum gevraagde verblijf | 20210526     |