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

Kind Given step definitions

#language: en

@stap-documentatie
Feature: Kind 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 1st 'SELECT COALESCE(MAX(pl_id), 0)+1 FROM public.lo3_pl' statement has the result '9999'

  Scenario: the person with citizen service number '[bsn]' has a 'kind' with the following data
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Jansen |
    Then the generated SQL statements are
    | stap | categorie    | text                                                                                                                                                  | values               |
    | 1    | 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 |
    |      | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,0,0,K,Jansen    |

  Scenario: the person has (another) 'kind' with the following data
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Jansen |
    And the person has another 'kind' with the following data
    | voornamen (02.10) | geslachtsnaam (02.40) |
    | Walter            | Messeritz             |
    And the person has another 'kind' with the following data
    | voornamen (02.10) | geslachtsnaam (02.40) |
    | William           | Postma                |
    Then the generated SQL statements are
    | stap | categorie    | text                                                                                                                                                  | values                      |
    | 1    | 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        |
    |      | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,0,0,K,Jansen           |
    |      | kind-2       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,voor_naam,geslachts_naam) VALUES($1,$2,$3,$4,$5,$6)                            | 9999,1,0,K,Walter,Messeritz |
    |      | kind-3       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,voor_naam,geslachts_naam) VALUES($1,$2,$3,$4,$5,$6)                            | 9999,2,0,K,William,Postma   |

  Scenario: the 'kind' has been changed to the following data
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | naam              | waarde          |
    | voornamen (02.10) | Celeke Lodivica |
    And the 'kind' has been changed to the following data
    | voornamen (02.10) |
    | Vica              |
    Then the generated SQL statements are
    | key          | text                                                                                                                                                  | values                     |
    | 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       |
    | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,voor_naam) VALUES($1,$2,$3,$4,$5)                                              | 9999,0,1,K,Celeke Lodivica |
    |              | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,voor_naam) VALUES($1,$2,$3,$4,$5)                                              | 9999,0,0,K,Vica            |

  Scenario: the 'kind' has been changed to the following data (second and/or subsequent child)
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Boer   |
    And the person has another 'kind' with the following data
    | geslachtsnaam (02.40) |
    | Boerin                |
    And the 'kind' has been changed to the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Vries  |
    Then the generated SQL statements are
    | key          | text                                                                                                                                                  | values               |
    | 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 |
    | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,0,0,K,Boer      |
    | kind-2       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,1,1,K,Boerin    |
    |              | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,1,0,K,Vries     |

  Scenario: the 'kind' has been corrected to the following data
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | geslachtsnaam (02.40) |
    | Boer                  |
    And the 'kind' has been corrected to the following data
    | geslachtsnaam (02.40) |
    | Vries                 |
    Then the generated SQL statements are
    | key          | text                                                                                                                                                  | values               |
    | 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 |
    | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam,onjuist_ind) VALUES($1,$2,$3,$4,$5,$6)                          | 9999,0,1,K,Boer,O    |
    |              | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,0,0,K,Vries     |

  Scenario: the 'kind' has been corrected to the following data (second and/or subsequent child)
    Given the person with citizen service number '000000012' has a 'kind' with the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Boer   |
    And the person has another 'kind' with the following data
    | geslachtsnaam (02.40) |
    | Boer                  |
    And the 'kind' has been corrected to the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Vries  |
    Then the generated SQL statements are
    | key          | text                                                                                                                                                  | values               |
    | 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 |
    | kind-1       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,0,0,K,Boer      |
    | kind-2       | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam,onjuist_ind) VALUES($1,$2,$3,$4,$5,$6)                          | 9999,1,1,K,Boer,O    |
    |              | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,geslachts_naam) VALUES($1,$2,$3,$4,$5)                                         | 9999,1,0,K,Vries     |