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

Nationaliteit Given step definitions

#language: en

@stap-documentatie
Feature: Nationaliteit Given step definitions

  Background:
    Given 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 'nationaliteit' with the following data
    Given the person with citizen service number '000000012' has a 'nationaliteit' with the following data
    | nationaliteit (05.10) | reden opnemen (63.10) | datum ingang geldigheid (85.10) |
    | 0001                  | 001                   | 19750707                        |
    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       |
    |      | nationaliteit-1 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code,nl_nat_verkrijg_reden,geldigheid_start_datum) VALUES($1,$2,$3,$4,$5,$6) | 9999,0,0,0001,001,19750707 |

  Scenario: the person has (another) 'nationaliteit' with the following data
    Given the person with citizen service number '000000012' has a 'nationaliteit' with the following data
    | nationaliteit (05.10) | reden opnemen (63.10) | datum ingang geldigheid (85.10) |
    | 0001                  | 001                   | 19750707                        |
    And the person has another 'nationaliteit' with the following data
    | naam                  | waarde |
    | nationaliteit (05.10) | 0002   |
    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       |
    |      | nationaliteit-1 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code,nl_nat_verkrijg_reden,geldigheid_start_datum) VALUES($1,$2,$3,$4,$5,$6) | 9999,0,0,0001,001,19750707 |
    |      | nationaliteit-2 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code) VALUES($1,$2,$3,$4)                                                    | 9999,1,0,0002              |

  Scenario: the 'nationaliteit' has been changed to the following data
    Given the person with citizen service number '000000012' has a 'nationaliteit' with the following data
    | nationaliteit (05.10) | reden opnemen (63.10) | datum ingang geldigheid (85.10) |
    | 0001                  | 001                   | 19750707                        |
    And the 'nationaliteit' has been changed to the following data
    | reden beëindigen (64.10) | datum ingang geldigheid (85.10) |
    | 404                      | 20150131                        |
    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       |
    |      | nationaliteit-1 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code,nl_nat_verkrijg_reden,geldigheid_start_datum) VALUES($1,$2,$3,$4,$5,$6) | 9999,0,1,0001,001,19750707 |
    |      |                 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nl_nat_verlies_reden,geldigheid_start_datum) VALUES($1,$2,$3,$4,$5)                        | 9999,0,0,404,20150131      |

  Scenario: the 'nationaliteit' has been corrected to the following data
    Given the person with citizen service number '000000012' has a 'nationaliteit' with the following data
    | nationaliteit (05.10) | reden opnemen (63.10) | datum ingang geldigheid (85.10) |
    | 0001                  | 001                   | 19750707                        |
    And the 'nationaliteit' has been corrected to the following data
    | nationaliteit (05.10) | reden opnemen (63.10) | datum ingang geldigheid (85.10) |
    | 0001                  | 301                   | 19760101                        |
    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         |
    | nationaliteit-1 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code,nl_nat_verkrijg_reden,geldigheid_start_datum,onjuist_ind) VALUES($1,$2,$3,$4,$5,$6,$7) | 9999,0,1,0001,001,19750707,O |
    |                 | INSERT INTO public.lo3_pl_nationaliteit(pl_id,stapel_nr,volg_nr,nationaliteit_code,nl_nat_verkrijg_reden,geldigheid_start_datum) VALUES($1,$2,$3,$4,$5,$6)                | 9999,0,0,0001,301,19760101   |