HAALCENTRAAL English translation
BRP API / Personen / Features / gegeven-stap-definities-adres

Adres Given step definitions

# language: en
@stap-documentatie
Feature: Adres Given step definitions

  Background:
    Given the 1st 'SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres' statement has the result '4999'
    Given the 2nd 'SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres' statement has the result '5000'
    Given the 3rd 'SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres' statement has the result '5001'

  @integratie
  Scenario: address '[adres aanduiding]'
    And address 'A1'
      | gemeentecode (92.10) |
      |                 0518 |
    When the SQL statements generated from the Given steps have been executed
    Then address 'A1' has the following row in table 'lo3_adres'
      | adres_id | gemeente_code |
      |       A1 |          0518 |

  @integratie
  Scenario: address '[adres aanduiding]' (several addresses)
    And address 'A1'
      | gemeentecode (92.10) |
      |                 0518 |
    Given address 'A2'
      | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
      |                 0800 |                         0800010011067001 |
    When the SQL statements generated from the Given steps have been executed
    Then address 'A1' has the following row in table 'lo3_adres'
      | adres_id | gemeente_code |
      |       A1 |          0518 |
    And address 'A2' has the following row in table 'lo3_adres'
      | adres_id | gemeente_code | verblijf_plaats_ident_code |
      |       A2 |          0800 |           0800010011067001 |

  @integratie
  Scenario: address {adres aanduiding} in municipality {gemeente naam}
    Given address 'A1' in municipality '\'s-Gravenhage'
    When the SQL statements generated from the Given steps have been executed
    Then address 'A1' has the following row in table 'lo3_adres'
      | adres_id | gemeente_code | verblijf_plaats_ident_code | nummer_aand_ident_code |
      |       A1 |          0518 |           0518010051001502 |       0518200000617227 |

  @integratie
  Scenario: address {adres aanduiding} in municipality {gemeente naam} has the following data
    Given address 'A1' in municipality '\'s-Gravenhage' has the following data
      | postcode (11.60) | huisnummer (11.20) | aanduiding bij huisnummer (11.50) |
      |           2628HJ |                  2 | to                                |
    When the SQL statements generated from the Given steps have been executed
    Then address 'A1' has the following row in table 'lo3_adres'
      | adres_id | gemeente_code | verblijf_plaats_ident_code | nummer_aand_ident_code | postcode | huis_nr | huis_nr_aand |
      |       A1 |          0518 |           0518010051001502 |       0518200000617227 |   2628HJ |       2 |           to |

  Scenario: address '[identificatie]' has the following data
    Given address 'A1' has the following data
    | straatnaam (11.10) |
    | Boterdiep          |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                  | values    |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,straat_naam) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | Boterdiep |

  Scenario: address '[identificatie]' has the following data (several addresses)
    Given address 'A1' has the following data
    | straatnaam (11.10) |
    | Boterdiep          |
    And address 'A2' has the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067001                         |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                 | values           |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,straat_naam) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING *                | Boterdiep        |
    |      | adres-A2  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067001 |

  Scenario: address '[identificatie]' was updated on '[datum]' with the following data
    Given address 'A1' has the following data
    | straatnaam (11.10) |
    | Boterdiep          |
    And address 'A1' was updated on '2023-02-03' with the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067001                         |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                                | values                     |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,straat_naam) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING *                               | Boterdiep                  |
    |      | adres-2   | INSERT INTO public.lo3_adres(adres_id,straat_naam,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1,$2) RETURNING * | Boterdiep,0800010011067001 |

  Scenario: address '[identificatie]' was merged on '[datum]' into address '[identificatie]' with the following data
    Given address 'A1' has the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067001                         |
    And address 'A1' was merged on '2023-02-03' into address 'A2' with the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067002                         |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                 | values           |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067001 |
    |      | adres-A2  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067002 |

  Scenario: the addresses '[identificaties]' were merged on '[datum]' into address '[identificatie]' with the following data
    Given address 'A1' has the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067001                         |
    Given address 'A2' has the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067002                         |
    And the addresses 'A1,A2' were merged on '2023-02-03' into address 'A3' with the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067003                         |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                 | values           |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067001 |
    |      | adres-A2  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067002 |
    |      | adres-A3  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067003 |

  Scenario: address '[identificatie]' has been split into addresses with the following data
    Given address 'A1' has the following data
    | identificatiecode verblijfplaats (11.80) |
    | 0800010011067001                         |
    And address 'A1' has been split into addresses with the following data
    | adres | identificatiecode verblijfplaats (11.80) |
    | A2    | 0800010011067002                         |
    | A3    | 0800010011067003                         |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                 | values           |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067001 |
    |      | adres-A2  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067002 |
    |      | adres-A3  | INSERT INTO public.lo3_adres(adres_id,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1) RETURNING * | 0800010011067003 |

  Scenario: address '[identificatie]' was changed infrastructurally on '[datum]' with the following data
    Given address 'A1' has the following data
    | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
    | 0800                 | 0800010000000003                         |
    And address 'A1' was changed infrastructurally on '2023-02-03' with the following data
    | gemeentecode (92.10) |
    | 0530                 |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                                  | values                |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,gemeente_code,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1,$2) RETURNING * | 0800,0800010000000003 |
    |      | adres-2   | INSERT INTO public.lo3_adres(adres_id,gemeente_code,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1,$2) RETURNING * | 0530,0800010000000003 |

  Scenario: address '[identificatie]' was changed infrastructurally on '[datum]' to address '[identificatie]' with the following data
    Given address 'A1' has the following data
    | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
    | 0800                 | 0800010000000003                         |
    And address 'A1' was changed infrastructurally on '2023-02-03' to address 'A2' with the following data
    | gemeentecode (92.10) |
    | 0530                 |
    Then the generated SQL statements are
    | stap | categorie | text                                                                                                                                                                  | values                |
    | 1    | adres-A1  | INSERT INTO public.lo3_adres(adres_id,gemeente_code,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1,$2) RETURNING * | 0800,0800010000000003 |
    |      | adres-A2  | INSERT INTO public.lo3_adres(adres_id,gemeente_code,verblijf_plaats_ident_code) VALUES((SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres),$1,$2) RETURNING * | 0530,0800010000000003 |