robocop

Checks KYC attributes against sanction lists
Log | Files | Refs | Submodules | README | LICENSE

commit 9a202c5af7bdd5a1d7552bb17749f6cf68bdfec2
parent ce9e856c25494a74933d222e3ca38fda626bf688
Author: Gust Leenaars <gl.nlnet@leenaa.rs>
Date:   Wed,  7 May 2025 11:31:12 +0200

Add new tests

Diffstat:
Mtest/Tests/Check.hs | 27++++++++++++++++++---------
Mtest/Tests/Targets/Real.hs | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/data/target_57355.xml | 33+++++++++++++++++++++++++++++++++
3 files changed, 177 insertions(+), 9 deletions(-)

diff --git a/test/Tests/Check.hs b/test/Tests/Check.hs @@ -159,18 +159,27 @@ personTests sanction_list = {- testTargetVersions False SSID sanction_list $ , (target_SSID_vN, " vN", distribution ADDRESS DATE ID NAME NATIONALITY CONFIDENCE -} , testTargetVersions False 49816 sanction_list $ - [ (target_49816_v1, " v1", distribution 0 100 0 125 0 0.75) - , (target_49816_v2, " v2", distribution 0 100 0 0 0 0 ) - , (target_49816_v3, " v3", distribution 0 0 0 0 0 0 ) - , (target_49816_v4, " v4", distribution 0 100 0 125 0 0.75) + [ (target_49816_v1, " v1", distribution 0 100 0 125 0 0.75) -- Name and date + , (target_49816_v2, " v2", distribution 0 100 0 0 0 0 ) -- First name and date + , (target_49816_v3, " v3", distribution 0 0 0 0 0 0 ) -- Nothing + , (target_49816_v4, " v4", distribution 0 100 0 125 0 0.75) -- Name ] , testTargetVersions False 38925 sanction_list $ - [ (target_38925_v1, " v1", distribution 100 0 0 0 0 0.75) -- Only address - , (target_38925_v2, " v2", distribution 0 0 0 125 0 0 ) -- Only name - , (target_38925_v3, " v3", distribution 0 100 0 0 0 0 ) -- Only birthdate - , (target_38925_v4, " v4", distribution 100 0 0 0 0 0.75) -- Only address - , (target_38925_v5, " v5", distribution 100 100 0 0 0 0.75) -- Address + birthdate + [ (target_38925_v1, " v1", distribution 100 0 0 0 0 0.75) -- Only address + , (target_38925_v2, " v2", distribution 0 0 0 125 0 0 ) -- Only name + , (target_38925_v3, " v3", distribution 0 100 0 0 0 0 ) -- Only birthdate + , (target_38925_v4, " v4", distribution 100 0 0 0 0 0.75) -- Only address + , (target_38925_v5, " v5", distribution 100 100 0 0 0 0.75) -- Address + birthdate + ] + + , testTargetVersions False 57355 sanction_list $ + [ (target_57355_v1, " v1", distribution 100 100 0 125 0 0.75) -- Name, date and address + , (target_57355_v2, " v2", distribution 100 100 0 125 0 0.75) -- Alias, date and address + , (target_57355_v3, " v3", distribution 100 0 0 125 0 0.75) -- Name, address + , (target_57355_v4, " v4", distribution 0 0 0 125 0 0.75) -- Name with spelling mistake + , (target_57355_v5, " v5", distribution 0 100 0 125 0 0.75) -- Name with spelling mistake and date + , (target_57355_v5, " v6", distribution 0 0 0 125 0 0) -- Name ] ] diff --git a/test/Tests/Targets/Real.hs b/test/Tests/Targets/Real.hs @@ -20,6 +20,12 @@ module Tests.Targets.Real , target_38925_v4 , target_38925_v5 , target_68815 + , target_57355_v1 + , target_57355_v2 + , target_57355_v3 + , target_57355_v4 + , target_57355_v5 + , target_57355_v6 ) where import Data.CountryCodes @@ -425,3 +431,123 @@ target_68815 = NaturalPerson , country_subdivision = Nothing } } + +target_57355_v1 :: NaturalPerson +target_57355_v1 = NaturalPerson + { full_name = "Jimmy Cherizier" + , last_name = "Cherizier" + , birthdate = YearMonthDay 1977 03 30 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Impasse Manius" + , street_number = "16" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Just "40B" + , zipcode = "Non existent" + , town_location = Just "Delmas" + , town_district = Nothing + , country_subdivision = Just "Port-au-Prince" + } + } + +target_57355_v2 :: NaturalPerson +target_57355_v2 = NaturalPerson + { full_name = "Jimmy Barbeque" + , last_name = "Barbeque" + , birthdate = YearMonthDay 1977 03 30 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Impasse Manius" + , street_number = "16" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Just "40B" + , zipcode = "Non existent" + , town_location = Just "Delmas" + , town_district = Nothing + , country_subdivision = Just "Port-au-Prince" + } + } + +target_57355_v3 :: NaturalPerson +target_57355_v3 = NaturalPerson + { full_name = "Jim Cherizier" + , last_name = "Cherizier" + , birthdate = YearMonthDay 1953 02 19 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Impasse Manius" + , street_number = "16" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Just "40B" + , zipcode = "Non existent" + , town_location = Just "Delmas" + , town_district = Nothing + , country_subdivision = Just "Port-au-Prince" + } + } + +target_57355_v4 :: NaturalPerson +target_57355_v4 = NaturalPerson + { full_name = "Jimmy Cherisier" + , last_name = "Cherisier" + , birthdate = YearMonthDay 1953 02 19 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Non existent" + , street_number = "Non existent" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Nothing + , zipcode = "Non existent" + , town_location = Nothing + , town_district = Nothing + , country_subdivision = Nothing + } + } + +target_57355_v5 :: NaturalPerson +target_57355_v5 = NaturalPerson + { full_name = "Jimmy Cherisier" + , last_name = "Cherisier" + , birthdate = YearMonthDay 1977 03 30 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Non existent" + , street_number = "Non existent" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Nothing + , zipcode = "Non existent" + , town_location = Nothing + , town_district = Nothing + , country_subdivision = Nothing + } + } + +target_57355_v6 :: NaturalPerson +target_57355_v6 = NaturalPerson + { full_name = "Jim Cherizier" + , last_name = "Cherizier" + , birthdate = YearMonthDay 1953 02 19 + , nationality = HT + , national_id = "012345ABCDEF" + , residential = GLS.Address { GLS.country = HT + , street_name = "Non existent" + , street_number = "Non existent" + , GLS.lines = Nothing + , building_name = Nothing + , building_number = Nothing + , zipcode = "Non existent" + , town_location = Nothing + , town_district = Nothing + , country_subdivision = Nothing + } + } diff --git a/test/data/target_57355.xml b/test/data/target_57355.xml @@ -0,0 +1,33 @@ +<swiss-sanctions-list list-type="whole-list" date="2024-07-30"> + <target ssid="57351"> + <sanctions-set-id>4387</sanctions-set-id> + <individual> + <identity ssid="57355" main="true"> + <name ssid="57356" name-type="primary-name" quality="good" lang="eng"> + <name-part order="1" name-part-type="family-name"> + <value>Cherizier</value> + </name-part> + <name-part order="2" name-part-type="given-name"> + <value>Jimmy</value> + </name-part> + </name> + <name ssid="57357" name-type="alias" quality="low" lang="eng"> + <name-part order="1" name-part-type="whole-name"> + <value>Barbeque</value> + </name-part> + </name> + <nationality ssid="66666"> + <country iso-code="HT">Haiti</country> + </nationality> + <day-month-year ssid="66664" day="30" month="3" year="1977" calendar="Gregorian" quality="good"/> + <place-of-birth ssid="66665" place-id="66660" quality="good"/> + <address ssid="66663" place-id="66660" quality="good"> + <address-details>16, Imp Manius, Delmas 40 B</address-details> + </address> + </identity> + <justification ssid="57352">Jimmy Cherizier (AKA “Barbeque”) has engaged in acts that threaten the peace, security, and stability of Haiti and has planned, directed, or committed acts that constitute serious human rights abuses. Jimmy Cherizier is one of Haiti’s most influential gang leaders and leads an alliance of Haitian gangs known as the "G9 Family and Allies."</justification> + <other-information ssid="66661">Designation: Former Police Officer</other-information> + <other-information ssid="66662">National identification no: 001-843-989-7 (NIF – Haiti)</other-information> + </individual> + </target> +</swiss-sanctions-list>