consult occupancy on a reference date
#language: en @gba Feature: consult occupancy on a reference date As a consumer of the Bewoning API I want to be able to request which persons stay or stayed at an addressable object on a date so that I can use this information in my process 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 | And address 'A3' has the following data | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) | | 0800 | 0800010000000003 | And 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 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 | 20230526 | Rue du pomme 26 | Bruxelles | postcode 1000 | And the person with citizen service number '000000048' is registered at address 'A1' with the following data | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | | 0800 | 20140808 | Rule: no occupancy is supplied for an addressable object that is not registered in the BRP Scenario: occupancy is requested for an addressable object that does not exist When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | 2010-08-17 | | adresseerbaarObjectIdentificatie | 0800000000000003 | Then the response has 0 occupancies Rule: a person is an occupant of an addressable object on a reference date where: - the person stays or stayed at the addressable object, and - the reference date falls on or after the start date of the address occupancy of the person at the addressable object, and - the reference date falls before the start date of the address occupancy of the person at the next addressable object Scenario Outline: the person stayed at the addressable object requested and <scenario> When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | <peildatum> | | 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: | peildatum | periode | scenario | | 2010-09-01 | 2010-09-01 tot 2010-09-02 | peildatum valt in de adreshouding periode | | 2010-08-18 | 2010-08-18 tot 2010-08-19 | peildatum valt op de eerste dag van adreshouding periode | | 2014-08-07 | 2014-08-07 tot 2014-08-08 | peildatum valt op de laatste dag vóór adreshouding van persoon met burgerservicenummer '000000048' | Scenario Outline: the person has given the addressable object requested as a correspondence address and <scenario> Given the person with citizen service number '000000024' has given address 'A3' as a correspondence address with the following data | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) | | 0800 | 20100818 | When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | <peildatum> | | adresseerbaarObjectIdentificatie | 0800010000000003 | Then the response has 0 occupancies Examples: | peildatum | periode | scenario | | 2010-09-01 | 2010-09-01 tot 2010-09-02 | peildatum valt in de adreshouding periode | | 2010-08-18 | 2010-08-18 tot 2010-08-19 | peildatum valt op de eerste dag van adreshouding periode | | 2014-08-07 | 2014-08-07 tot 2014-08-08 | peildatum valt op de laatste dag vóór adreshouding van persoon met burgerservicenummer '000000048' | Scenario Outline: several persons stay or stayed at the addressable object requested on the reference date When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | <peildatum> | | adresseerbaarObjectIdentificatie | 0800010000000001 | Then the response has an occupancy with the following data | naam | waarde | | periode | <periode> | | adresseerbaarObjectIdentificatie | 0800010000000001 | And the occupancy has occupants with the following data | burgerservicenummer | | 000000024 | | 000000048 | Examples: | peildatum | periode | opmerking | | 2014-08-08 | 2014-08-08 tot 2014-08-09 | peildatum valt op de eerste dag van de adreshouding periode van bewoner met burgerservicenummer '000000048' | | 2015-01-01 | 2015-01-01 tot 2015-01-02 | peildatum valt in de adreshouding periode van beide bewoners | | 2016-05-25 | 2016-05-25 tot 2016-05-26 | peildatum valt op de laatste dag van de adreshouding periode van bewoner met burgerservicenummer '000000024' | Rule: no occupancy is supplied for an addressable object where no persons are registered on the reference date Scenario: the person stayed at the addressable object requested and the reference date falls before the start date of the address occupancy When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | 2010-08-17 | | adresseerbaarObjectIdentificatie | 0800010000000001 | Then the response has 0 occupancies Scenario Outline: <omschrijving> When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | <peildatum> | | adresseerbaarObjectIdentificatie | 0800010000000002 | Then the response has 0 occupancies Examples: | peildatum | periode | omschrijving | | 2023-05-26 | 2023-05-26 tot 2023-05-27 | persoon verbleef op het gevraagde adresseerbaar object en is geëmigreerd op de peildatum | | 2023-06-01 | 2023-06-01 tot 2023-06-02 | persoon verbleef op het gevraagde adresseerbaar object en is geëmigreerd vóór de peildatum | Scenario: the person stayed at the addressable object requested and emigrated after the reference date When gba occupancy is searched with the following parameters | naam | waarde | | type | BewoningMetPeildatum | | peildatum | 2023-05-25 | | adresseerbaarObjectIdentificatie | 0800010000000002 | Then the response has an occupancy with the following data | naam | waarde | | periode | 2023-05-25 tot 2023-05-26 | | adresseerbaarObjectIdentificatie | 0800010000000002 | And the occupancy has an occupant with the following data | burgerservicenummer | | 000000024 |