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

Gemeente Given step definitions

#language: en

@stap-documentatie
Feature: Gemeente Given step definitions

  Background:
    Given the 1st 'SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres' statement has the result '4999'
    And the 2nd 'SELECT COALESCE(MAX(adres_id), 0)+1 FROM public.lo3_adres' statement has the result '5000'
    And the 1st 'SELECT COALESCE(MAX(pl_id), 0)+1 FROM public.lo3_pl' statement has the result '9999'

  Scenario: municipality '[identificatie]' has the following data
    Given municipality 'G1' has the following data
    | gemeentecode (92.10) | gemeentenaam (92.11) |
    | 9999                 | Ons Dorp             |
    Then the generated SQL statements are
    | stap | categorie   | text                                                                       | values        |
    | 1    | gemeente-G1 | INSERT INTO public.lo3_gemeente(gemeente_code,gemeente_naam) VALUES($1,$2) | 9999,Ons Dorp |

  Scenario: municipality '[identificatie]' has been merged with the following data
    Given municipality 'G1' has the following data
    | gemeentecode (92.10) | gemeentenaam (92.11) |
    | 9999                 | Ons Dorp             |
    And municipality 'G1' has been merged with the following data
    | nieuwe gemeentecode (92.12) | datum beëindiging (99.99) |
    | 0800                        | 20230526                  |
    Then the generated SQL statements are
    | stap | categorie   | text                                                                                                                         | values                      |
    | 1    | gemeente-G1 | INSERT INTO public.lo3_gemeente(gemeente_code,gemeente_naam,nieuwe_gemeente_code,tabel_regel_eind_datum) VALUES($1,$2,$3,$4) | 9999,Ons Dorp,0800,20230526 |

  Scenario: a municipality with an address has been merged
    Given municipality 'G1' has the following data
    | gemeentecode (92.10) | gemeentenaam (92.11) |
    | 9999                 | Ons Dorp             |
    And address 'A1' has the following data
    | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
    | 9999                 | 9999010000000003                         |
    And municipality 'G1' has been merged with the following data
    | nieuwe gemeentecode (92.12) | datum beëindiging (99.99) |
    | 0800                        | 20230526                  |
    Then the generated SQL statements are
    | stap | categorie   | text                                                                                                                                                                  | values                      |
    | 1    | gemeente-G1 | INSERT INTO public.lo3_gemeente(gemeente_code,gemeente_naam,nieuwe_gemeente_code,tabel_regel_eind_datum) VALUES($1,$2,$3,$4)                                          | 9999,Ons Dorp,0800,20230526 |
    | 2    | 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 * | 9999,9999010000000003       |
    |      | 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 * | 0800,9999010000000003       |

  Scenario: a municipality with a verblijfplaats has been merged
    Given municipality 'G1' has the following data
    | gemeentecode (92.10) | gemeentenaam (92.11) |
    | 9000                 | Ons Dorp             |
    And address 'A1' has the following data
    | gemeentecode (92.10) | identificatiecode verblijfplaats (11.80) |
    | 9000                 | 9999010000000003                         |
    And the person with citizen service number '000000012' is registered at address 'A1' with the following data
    | gemeente van inschrijving (09.10) | datum aanvang adreshouding (10.30) |
    | 9000                              | 20220102                           |
    And municipality 'G1' has been merged with the following data
    | nieuwe gemeentecode (92.12) | datum beëindiging (99.99) |
    | 0800                        | 20230526                  |
    Then the generated SQL statements are
    | stap | categorie      | text                                                                                                                                                                                      | values                        |
    | 1    | gemeente-G1    | INSERT INTO public.lo3_gemeente(gemeente_code,gemeente_naam,nieuwe_gemeente_code,tabel_regel_eind_datum) VALUES($1,$2,$3,$4)                                                              | 9000,Ons Dorp,0800,20230526   |
    | 2    | 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 *                     | 9000,9999010000000003         |
    |      | 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 *                     | 0800,9999010000000003         |
    | 3    | inschrijving   | INSERT INTO public.lo3_pl(pl_id,mutatie_dt,geheim_ind) VALUES((SELECT COALESCE(MAX(pl_id), 0)+1 FROM public.lo3_pl),current_timestamp,$1) RETURNING *                                     | 0                             |
    |      | persoon        | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,burger_service_nr) VALUES($1,$2,$3,$4,$5)                                                                          | 9999,0,0,P,000000012          |
    |      | verblijfplaats | INSERT INTO public.lo3_pl_verblijfplaats(pl_id,adres_id,volg_nr,adres_functie,inschrijving_gemeente_code,adreshouding_start_datum) VALUES($1,$2,$3,$4,$5,$6)                              | 9999,4999,1,W,9000,20220102   |
    |      |                | INSERT INTO public.lo3_pl_verblijfplaats(pl_id,adres_id,volg_nr,adres_functie,inschrijving_gemeente_code,adreshouding_start_datum,aangifte_adreshouding_oms) VALUES($1,$2,$3,$4,$5,$6,$7) | 9999,5000,0,W,0800,20230526,W |