robocop

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

commit a148ae110e549d9222a9bca2e79a23c4b94b998a
parent 4ad2455090309d68b81cdde20fa351f0218b7e40
Author: Vint Leenaars <vl.software@leenaa.rs>
Date:   Fri,  9 May 2025 00:51:40 +0200

Add example JSONlines input

Diffstat:
MREADME.md | 18++++++++++++++++--
Mapp/Main.hs | 6+++---
2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -39,7 +39,7 @@ Update your [stack.yaml](./stack.yaml): snapshot: lts-22.43 ``` -Should become +Should become: ``` snapshot: lts-YOUR.VERSION @@ -59,7 +59,21 @@ If you do not specify a path, the binary will be placed in `~/.local/bin` by def ~/.local/bin/kycheck --help ``` -You can either provide all the parameters on the command line, or use a configuration file (in [Dhall](https://dhall-lang.org/). There is an example configuration file called `kycheck.conf` available. +You can either provide all the parameters on the command line, or use a configuration file (in [Dhall](https://dhall-lang.org/). There is an example configuration file called `kycheck.conf` available, with reasonably sane defaults. + +Start the application (we recommend using the more verbose option (using `--info`) until you've gained some experience with the tool), and wait until the data is loaded and the application indicates it is ready to receive your input. After that, you can paste in data about people and organisations you want to check against. Use jsonlines. E.g. if you paste: + +```{"full_name" : "Maria Consuela", "last_name" : "", "address" : { "country" : "GT", "street_name" : "Unknown", "street_number" : "", "zipcode" : "" }, "birthdate" : "1953-06-23", "nationality" : "GT", "national_id" : "" }``` + +kycheck will print: + +```Score {match_quality = 0.85357136, confidence = 0.9311688, expiration = 0, reference = 73508}``` + +If there are multiple entries that match, kycheck will print these so you can investigate them. + +Enter new lines with subject data until you've researched all. + +You can exit the application by typing the word 'quit' and pressing enter, or by pressing <ctrl> C. ## Testing diff --git a/app/Main.hs b/app/Main.hs @@ -32,10 +32,10 @@ import System.FilePath readJSON :: Config -> Targets -> IO () readJSON config sanction_list = do - when (verbosity config >= Info) $ print "Sanction list loaded, please input your JSON" + when (verbosity config >= Info) $ putStrLn "Sanction list loaded. Ready for your input.\n(Paste subject data into the terminal, use JSONlines format)\nType 'quit' to exit." line <- getLine if line == "quit" - then print "Leaving KYCheck" + then print "Thank you for using KYCheck." else do case (eitherDecode . BLC.pack) line of Left err -> print $ "Could not decode JSON (" ++ show err ++ "), please try again" Right entry -> case entry of @@ -72,7 +72,7 @@ main = do return () Right xml -> do let tgts = xmlToSSL xml case start_date tgts of - Just age -> print $ "Seconds since epoch: " ++ (show $ floor $ diffUTCTime start (UTCTime age 0)) + Just age -> print $ "Seconds since epoch: " ++ (show $ floor $ diffUTCTime start (UTCTime age 0)) Nothing -> print $ "Could not find age of sanction_list" readJSON config tgts