Data::Validate::Sanctions::Redis - An extension of Data::Validate::Sanctions::Redis that stores sanction data in redis.
my $validator = Data::Validate::Sanctions::Redis->new(connection => $redis_read); # to validate clients by their name print 'BAD' if $validator->is_sanctioned("$last_name $first_name"); # or by more profile data print 'BAD' if $validator->get_sanctioned_info(first_name => $first_name, last_name => $last_name, date_of_birth => $date_of_birth)->{matched}; # to update the sanction dataset (needs redis write access) my $validator = Data::Validate::Sanctions::Redis->new(connection => $redis_write); ## no critic $validator->update_data(eu_token => $token); # create object from the parent (factory) class my $validator = Data::Validate::Sanctions->new(storage => 'redis', connection => $redis_write);
Data::Validate::Sanctions::Redis is a simple validitor to validate a name against sanctions lists. For more details about the sanction sources please refer to the parent module Data::Validate::Sanctions.
Create the object with the redis object:
my $validator = Data::Validate::Sanctions::Redis->new(connection => $redis);
Checks if the input profile info matches a sanctioned entity. The arguments are the same as those of get_sanctioned_info.
It returns 1 if a match is found, otherwise 0.
Tries to find a match a sanction entry matching the input profile args. It takes arguments in two forms. In the new API, it takes a hashref containing the following named arguments:
first_name: first name
last_name: last name
date_of_birth: (optional) date of birth as a string or epoch
place_of_birth: (optional) place of birth as a country name or code
residence: (optional) name or code of the country of residence
nationality: (optional) name or code of the country of nationality
citizen: (optional) name or code of the country of citizenship
postal_code: (optional) postal/zip code
national_id: (optional) national ID number
passport_no: (oiptonal) passort number
For backward compatibility it also supports the old API, taking the following args:
It returns a hash-ref containg the following data:
Fetches latest versions of sanction lists, and updates corresponding sections of stored file, if needed
Returns timestamp of when the latest list was updated. If argument is provided - return timestamp of when that list was updated.
Pass in the client's name and sanctioned individual's name to see if they are similar or not
Binary.com <fayland@binary.com>
Copyright 2022- Binary.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Data::Validate::Sanctions
Data::Validate::Sanctions::Fetcher
To install Data::Validate::Sanctions, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Validate::Sanctions
CPAN shell
perl -MCPAN -e shell install Data::Validate::Sanctions
For more information on module installation, please visit the detailed CPAN module installation guide.