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

Ouder Given step definitions

#language: en

@stap-documentatie
Feature: Ouder 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'

  @integratie
  Scenario Outline: has '[aanduiding]' as parent [1 or 2]
    Given the person 'P2' without a citizen service number
    And the person 'P1' with citizen service number '000000036'
    * has 'P2' as parent <ouder type>
    When the SQL statements generated from the Given steps have been executed
    Then person 'P1' has the following row in table 'lo3_pl'
      | pl_id | geheim_ind |
      |    P1 |          0 |
    And person 'P1' has the following row in table 'lo3_pl_persoon'
      | pl_id | stapel_nr | volg_nr | persoon_type | burger_service_nr | geslachts_naam |
      |    P1 |         0 |       0 |            P |         000000036 |             P1 |
    And person 'P1' has the following row in table 'lo3_pl_persoon'
      | pl_id | stapel_nr | volg_nr | persoon_type | geslachts_naam |
      |    P1 |         0 |       0 | <ouder type> |             P2 |

    Examples:
      | ouder type |
      |          1 |
      |          2 |

  Scenario Outline: the person with citizen service number '[bsn]' has a parent '[ouder-type]' with the following data
    Given the person with citizen service number '000000012' has a parent '<ouder-type>' 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         |
    |      | ouder-<ouder-type>-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,<ouder-type>,Jansen |

    Examples:
    | ouder-type |
    | 1          |
    | 2          |

  Scenario: the person has a parent '[ouder-type]' with the following data
    Given the person with citizen service number '000000012' has a parent '1' with the following data
    | naam                  | waarde |
    | geslachtsnaam (02.40) | Jansen |
    And the person has a parent '2' with the following data
    | naam                  | waarde    |
    | geslachtsnaam (02.40) | Pietersen |
    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 |
    |      | ouder-1-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,1,Jansen    |
    |      | ouder-2-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,2,Pietersen |

  Scenario: the parent '[ouder-type]' has been corrected to the following data
    Given the person with citizen service number '000000012' has a parent '1' with the following data
    | naam              | waarde     |
    | voornamen (02.10) | Christiaan |
    And the parent '1' has been corrected to the following data
    | naam              | waarde |
    | voornamen (02.10) | Mark   |
    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    |
    |      | ouder-1-1    | INSERT INTO public.lo3_pl_persoon(pl_id,stapel_nr,volg_nr,persoon_type,voor_naam,onjuist_ind) VALUES($1,$2,$3,$4,$5,$6)                               | 9999,0,1,1,Christiaan,O |
    |      |              | 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,1,Mark         |

  Scenario: the parent '[ouder-type]' has been changed to the following data
    Given the person with citizen service number '000000012' has a parent '2' with the following data
    | naam              | waarde     |
    | voornamen (02.10) | Christiaan |
    And the parent '2' has been changed to the following data
    | naam              | waarde |
    | voornamen (02.10) | Mark   |
    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  |
    |      | ouder-2-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,2,Christiaan |
    |      |              | 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,2,Mark       |