HAALCENTRAAL English translation
BRP API / Bewoning / Features / fout-cases-gba

consult occupancy within a period - error cases

#language: en

@gba
Feature: consult occupancy within a period - error cases

Rule: The adresseerbaarObjectIdentificatie, datumVan and datumTot parameters are mandatory parameters

  @fout-case
  Scenario: The adresseerbaarObjectIdentificatie, datumVan and datumTot parameters have not been supplied
    When gba occupancy is searched with the following parameters
    | naam | waarde             |
    | type | BewoningMetPeriode |
    Then the response has an object with the following data
    | naam     | waarde                                                                               |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1                          |
    | title    | Een of meerdere parameters zijn niet correct.                                        |
    | status   | 400                                                                                  |
    | detail   | De foutieve parameter(s) zijn: adresseerbaarObjectIdentificatie, datumTot, datumVan. |
    | code     | paramsValidation                                                                     |
    | instance | /haalcentraal/api/bewoning/bewoningen                                                |
    And the object has the following 'invalidParams' data
    | code     | name                             | reason                  |
    | required | adresseerbaarObjectIdentificatie | Parameter is verplicht. |
    | required | datumVan                         | Parameter is verplicht. |
    | required | datumTot                         | Parameter is verplicht. |

  @fout-case
  Scenario: The adresseerbaarObjectIdentificatie parameter has not been supplied
    When gba occupancy is searched with the following parameters
    | naam     | waarde             |
    | type     | BewoningMetPeriode |
    | datumVan | 2022-01-01         |
    | datumTot | 2023-01-01         |
    Then the response has an object with the following data
    | naam     | waarde                                                           |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1      |
    | title    | Een of meerdere parameters zijn niet correct.                    |
    | status   | 400                                                              |
    | detail   | De foutieve parameter(s) zijn: adresseerbaarObjectIdentificatie. |
    | code     | paramsValidation                                                 |
    | instance | /haalcentraal/api/bewoning/bewoningen                            |
    And the object has the following 'invalidParams' data
    | code     | name                             | reason                  |
    | required | adresseerbaarObjectIdentificatie | Parameter is verplicht. |

  @fout-case
  Scenario: The datumTot parameter has not been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    | datumVan                         | 2022-01-01         |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumTot.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name     | reason                  |
    | required | datumTot | Parameter is verplicht. |

  @fout-case
  Scenario: The datumVan parameter has not been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    | datumTot                         | 2023-01-01         |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumVan.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name     | reason                  |
    | required | datumVan | Parameter is verplicht. |

  @fout-case
  Scenario: an empty string has been supplied as the adresseerbaarObjectIdentificatie value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2022-01-01         |
    | datumTot                         | 2023-01-01         |
    | adresseerbaarObjectIdentificatie |                    |
    Then the response has an object with the following data
    | naam     | waarde                                                           |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1      |
    | title    | Een of meerdere parameters zijn niet correct.                    |
    | status   | 400                                                              |
    | detail   | De foutieve parameter(s) zijn: adresseerbaarObjectIdentificatie. |
    | code     | paramsValidation                                                 |
    | instance | /haalcentraal/api/bewoning/bewoningen                            |
    And the object has the following 'invalidParams' data
    | code     | name                             | reason                  |
    | required | adresseerbaarObjectIdentificatie | Parameter is verplicht. |

  @fout-case
  Scenario: an empty string has been supplied as the datumTot value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2022-01-01         |
    | datumTot                         |                    |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumTot.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name     | reason                  |
    | required | datumTot | Parameter is verplicht. |

  @fout-case
  Scenario: an empty string has been supplied as the datumVan value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         |                    |
    | datumTot                         | 2023-01-01         |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumVan.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name     | reason                  |
    | required | datumVan | Parameter is verplicht. |

Rule: A valid adresseerbaarObjectIdentificatie is a string of exactly 16 digits, 16 zeros not included

  @fout-case
  Scenario Outline: <omschrijving>
    When gba occupancy is searched with the following parameters
    | naam                             | waarde                             |
    | type                             | BewoningMetPeriode                 |
    | datumVan                         | 2022-01-01                         |
    | datumTot                         | 2023-01-01                         |
    | adresseerbaarObjectIdentificatie | <adresseerbaarObjectIdentificatie> |
    Then the response has an object with the following data
    | naam     | waarde                                                           |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1      |
    | title    | Een of meerdere parameters zijn niet correct.                    |
    | status   | 400                                                              |
    | detail   | De foutieve parameter(s) zijn: adresseerbaarObjectIdentificatie. |
    | code     | paramsValidation                                                 |
    | instance | /haalcentraal/api/bewoning/bewoningen                            |
    And the object has the following 'invalidParams' data
    | code    | name                             | reason                                                |
    | pattern | adresseerbaarObjectIdentificatie | Waarde voldoet niet aan patroon ^(?!0{16})[0-9]{16}$. |

    Examples:
    | adresseerbaarObjectIdentificatie  | omschrijving                                                                          |
    | 123456789012345                   | de opgegeven adresseerbaarObjectIdentificatie is een string met minder dan 16 cijfers |
    | 12345678901234567                 | de opgegeven adresseerbaarObjectIdentificatie is een string met meer dan 16 cijfers   |
    | <script>1234567890123456</script> | de opgegeven adresseerbaarObjectIdentificatie bevat niet-cijfer karakters             |
    | 0000000000000000                  | de opgegeven adresseerbaarObjectIdentificatie is een string bestaande uit 16 nullen   |

Rule: datumVan and datumTot are date strings formatted according to the [ISO 8601 date format](https://www.w3.org/QA/Tips/iso-date)

  @fout-case
  Scenario Outline: an invalid date has been supplied as the datumTot value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2022-01-01         |
    | datumTot                         | <datum tot>        |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumTot.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code | name     | reason                        |
    | date | datumTot | Waarde is geen geldige datum. |

    Examples:
    | datum tot   |
    | 19830526    |
    | 26 mei 1983 |
    | 2023-02-29  |

  @fout-case
  Scenario Outline: an invalid date has been supplied as the datumVan value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | <datum van>        |
    | datumTot                         | 2023-01-01         |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumVan.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code | name     | reason                        |
    | date | datumVan | Waarde is geen geldige datum. |

    Examples:
    | datum van   |
    | 19830526    |
    | 26 mei 1983 |
    | 2023-02-29  |

Rule: datumTot falls after datumVan

  @fout-case
  Scenario Outline: datumTot falls on or before datumVan
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2023-01-01         |
    | datumTot                         | <datum tot>        |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: datumTot.                    |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code | name     | reason                            |
    | date | datumTot | datumTot moet na datumVan liggen. |

    Examples:
    | datum tot  |
    | 2023-01-01 |
    | 2022-01-01 |

Rule: Only the parameters specified for the consult type supplied may be used

  @fout-case
  Scenario Outline: <omschrijving>
    When gba occupancy is searched with the following parameters
    | naam                             | waarde             |
    | type                             | BewoningMetPeriode |
    | datumVan                         | 2023-01-01         |
    | datumTot                         | 2023-01-01         |
    | adresseerbaarObjectIdentificatie | 0800010000000001   |
    | <parameter>                      | <waarde>           |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: <parameter>.                 |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code         | name        | reason                      |
    | unknownParam | <parameter> | Parameter is niet verwacht. |

    Examples:
    | omschrijving                                      | parameter     | waarde     |
    | raadplegen met parameter uit ander raadpleeg type | peildatum     | 2022-01-01 |
    | raadplegen met niet gespecificeerde parameter     | geheimhouding | false      |