HAALCENTRAAL English translation
BRP API / Personen / Features / adoptie

Step definitions for specifying adoption

# language: en
@integratie @stap-documentatie
Feature: Step definitions for specifying adoption

  Rule: On adoption, parents are added to the person as persoon_type '1' and '2' respectively, and the person is added to the parents as persoon_type 'K'

    @integratie
    Scenario Outline: carrying over data of parent and child: '{naam}' was adopted on {datum} by '{naam}' and '{naam}'
      Given the man 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000012'
      And the woman 'Nederland', born 18 years ago in 'P2', with citizen service number '000000024'
      And 'Duitsland', born yesterday 17 years ago in 'P3', with citizen service number '000000036'
      And 'P3' was <datum> adopted by 'P2' and 'P1'
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geboorte_land_code | geslachts_aand | akte_nr |
        | P1    | P            |         0 |       0 |         000000012 | P1             | gisteren - 45 jaar |               6030 | M              | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |               6029 |                | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geboorte_land_code | geslachts_aand | akte_nr |
        | P2    | P            |         0 |       0 |         000000024 | P2             |    18 jaar geleden |               6030 | V              | 1_A____ |
        | P2    | K            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |                    |                | 1_Q____ |
      And person 'P3' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P3    |          0 |
      And person 'P3' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geslachts_aand | geboorte_land_code | akte_nr | familie_betrek_start_datum            |
        | P3    | P            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |                |               6029 | 1_Q____ |                                       |
        | P3    |            1 |         0 |       0 |         000000024 | P2             |    18 jaar geleden | V              |                    | 1_Q____ | <datum familierechtelijke betrekking> |
        | P3    |            2 |         0 |       0 |         000000012 | P1             | gisteren - 45 jaar | M              |                    | 1_Q____ | <datum familierechtelijke betrekking> |

      Examples:
        | datum stapdefinitie | datum              | datum familierechtelijke betrekking |
        | op {datum}          | op 30-11-2019      |                            20191130 |
        | {relatieve datum}   |     2 jaar geleden |                      2 jaar geleden |
        | {relatieve datum}   | gisteren - 10 jaar | gisteren - 10 jaar                  |

    @integratie
    Scenario: '{naam}' was adopted by '{naam}'
      # the logic is the same as step '{naam}' is {relatieve datum} geadopteerd door '{naam}' (for determining parent 1 or 2 and for carrying over data)
      # the default adoption date is '10 jaar geleden'
      Given the man 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000012'
      And the woman 'Nederland', born 18 years ago in 'P2', with citizen service number '000000024'
      And 'Duitsland', born yesterday 17 years ago in 'P3', with citizen service number '000000036'
      * has 'P2' as parent
      And 'P3' was adopted by 'P1'
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P1    | P            |         0 |       0 |         000000012 | P1             |               6030 | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P3             |                    | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr | doc_beschrijving          |
        | P2    | P            |         0 |       0 |         000000024 | P2             |               6030 | 1_A____ |                           |
        | P2    | K            |         0 |       0 |         000000036 | P3             |                    |         | buitenlandse geboorteakte |
      And person 'P3' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P3    |          0 |
      And person 'P3' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr | familie_betrek_start_datum |
        | P3    | P            |         0 |       0 |         000000036 | P3             |               6029 | 1_Q____ |                            |
        | P3    |            1 |         0 |       0 |         000000024 | P2             |                    | 1_A____ | gisteren - 17 jaar         |
        | P3    |            2 |         0 |       0 |         000000012 | P1             |                    | 1_Q____ |            10 jaar geleden |

    @integratie
    Scenario: '{naam}' was adopted by '{naam}' and '{naam}'
      # the logic is the same as step '{naam}' is {relatieve datum} geadopteerd door '{naam}' en '{naam}' (for carrying over data)
      # the default adoption date is '10 jaar geleden'
      Given 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000012'
      And 'Nederland', born yesterday 45 years ago in 'P2', with citizen service number '000000024'
      And 'Nederland', born yesterday 17 years ago in 'P3', with citizen service number '000000036'
      And 'P3' was adopted by 'P2' and 'P1'
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P1    | P            |         0 |       0 |         000000012 | P1             |               6030 | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P3             |                    | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P2    | P            |         0 |       0 |         000000024 | P2             |               6030 | 1_A____ |
        | P2    | K            |         0 |       0 |         000000036 | P3             |                    | 1_Q____ |
      And person 'P3' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P3    |          0 |
      And person 'P3' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr | familie_betrek_start_datum |
        | P3    | P            |         0 |       0 |         000000036 | P3             |               6030 | 1_Q____ |                            |
        | P3    |            1 |         0 |       0 |         000000024 | P2             |                    | 1_Q____ |            10 jaar geleden |
        | P3    |            2 |         0 |       0 |         000000012 | P1             |                    | 1_Q____ |            10 jaar geleden |

    @integratie
    Scenario: '{naam}' was adopted {relatieve datum} by '{naam}'
      # the kind of parent (persoon_type '1' or '2') is the first place available
      # if there is no parent 1 yet, the adoptive parent becomes parent 1
      Given 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000024'
      And 'Nederland', born yesterday 17 years ago in 'P2', with citizen service number '000000036'
      And 'P2' was adopted by 'P1' 3 years ago
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P1    | P            |         0 |       0 |         000000024 | P1             |               6030 | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P2             |                    | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr | familie_betrek_start_datum |
        | P2    | P            |         0 |       0 |         000000036 | P2             |               6030 | 1_Q____ |                            |
        | P2    |            1 |         0 |       0 |         000000024 | P1             |                    | 1_Q____ |             3 jaar geleden |

    @integratie
    Scenario: adoption alongside another parent: '{naam}' was adopted {relatieve datum} by '{naam}'
      # the kind of parent (persoon_type '1' or '2') is the first place available
      # if parent 1 already exists and parent 1 has geslachts_naam with a value other than '.', the adoptive parent becomes parent 2
      Given 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000012'
      And 'Nederland', born tomorrow 40 years ago in 'P2', with citizen service number '000000024'
      And 'Nederland', born yesterday 17 years ago in 'P3', with citizen service number '000000036'
      * has 'P2' as parent
      And 'P3' was adopted by 'P1' 3 years ago
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P1    | P            |         0 |       0 |         000000012 | P1             |               6030 | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P3             |                    | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr |
        | P2    | P            |         0 |       0 |         000000024 | P2             |               6030 | 1_A____ |
        | P2    | K            |         0 |       0 |         000000036 | P3             |                    | 1_A____ |
      And person 'P3' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P3    |          0 |
      And person 'P3' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | akte_nr | familie_betrek_start_datum |
        | P3    | P            |         0 |       0 |         000000036 | P3             |               6030 | 1_Q____ |                            |
        | P3    |            1 |         0 |       0 |         000000024 | P2             |                    | 1_A____ | gisteren - 17 jaar         |
        | P3    |            2 |         0 |       0 |         000000012 | P1             |                    | 1_Q____ |             3 jaar geleden |

    @integratie
    Scenario: adoption replaces a period parent: '{naam}' was adopted {relatieve datum} by '{naam}'
      # the kind of parent (persoon_type '1' or '2') is the first place available
      # if parent 1 has geslachts_naam empty, or if parent 1 has geslachts_naam '.', the adoptive parent becomes parent 1
      Given the woman 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000024'
      And 'Nederland', born yesterday 17 years ago in 'P2', with citizen service number '000000036'
      * was born as a foundling 4 years ago
      And 'P2' was adopted by 'P1' 3 years ago
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_land_code | geslachts_aand | akte_nr |
        | P1    | P            |         0 |       0 |         000000024 | P1             |               6030 | V              | 1_A____ |
        | P1    | K            |         0 |       0 |         000000036 | P2             |                    |                | 1_Q____ |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum | geslachts_aand | geboorte_land_code | akte_nr | familie_betrek_start_datum |
        | P2    | P            |         0 |       0 |         000000036 | P2             | 4 jaar geleden |                |               6030 | 1_Q____ |                            |
        | P2    |            1 |         0 |       0 |         000000024 | P1             |                | V              |                    | 1_Q____ |             3 jaar geleden |
        | P2    |            1 |         0 |       1 |                   | .              |                | V              |                    | 1_A____ |             4 jaar geleden |
        | P2    |            2 |         0 |       0 |                   |                |                |                |                    | 1_A____ |                            |

    Scenario: '{naam}' was adopted abroad by '{naam}' and '{naam}' on {datum} with document '{document beschrijving}'
      Given the man 'Nederland', born yesterday 45 years ago in 'P1', with citizen service number '000000012'
      And the woman 'Nederland', born yesterday 45 years ago in 'P2', with citizen service number '000000024'
      And 'Duitsland', born yesterday 17 years ago in 'P3', with citizen service number '000000036'
      And 'P3' was adopted abroad by 'P1' and 'P2' on 30-11-2019 with document 'ad akte 6029'
      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 rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geboorte_land_code | geslachts_aand | akte_nr | doc_beschrijving |
        | P1    | P            |         0 |       0 |         000000012 | P1             | gisteren - 45 jaar |               6030 | M              | 1_A____ |                  |
        | P1    | K            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |                    |                |         | ad akte 6029     |
      And person 'P2' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P2    |          0 |
      And person 'P2' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geboorte_land_code | geslachts_aand | akte_nr | doc_beschrijving |
        | P2    | P            |         0 |       0 |         000000024 | P2             | gisteren - 45 jaar |               6030 | V              | 1_A____ |                  |
        | P2    | K            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |                    |                |         | ad akte 6029     |
      And person 'P3' has the following row in table 'lo3_pl'
        | pl_id | geheim_ind |
        | P3    |          0 |
      And person 'P3' has the following rows in table 'lo3_pl_persoon'
        | pl_id | persoon_type | stapel_nr | volg_nr | burger_service_nr | geslachts_naam | geboorte_datum     | geslachts_aand | geboorte_land_code | doc_beschrijving | familie_betrek_start_datum |
        | P3    | P            |         0 |       0 |         000000036 | P3             | gisteren - 17 jaar |                |               6029 | ad akte 6029     |                            |
        | P3    |            1 |         0 |       0 |         000000012 | P1             | gisteren - 45 jaar | M              |                    | ad akte 6029     |                   20191130 |
        | P3    |            2 |         0 |       0 |         000000024 | P2             | gisteren - 45 jaar | V              |                    | ad akte 6029     |                   20191130 |