Class: DilisensePepClient::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dilisense_pep_client/client.rb

Overview

Main client class for interacting with the Dilisense PEP/Sanctions screening API This class handles all API communication and response processing

Examples:

Basic usage for individual screening

client = DilisensePepClient::Client.new
results = client.check_individual(names: "John Smith")

Entity screening

results = client.check_entity(names: "Apple Inc")

Instance Method Summary collapse

Constructor Details

#initializeClient

Initialize a new API client Validates configuration and establishes HTTP connection

Raises:



20
21
22
23
# File 'lib/dilisense_pep_client/client.rb', line 20

def initialize
  validate_configuration!
  @connection = build_connection
end

Instance Method Details

#check_entity(names: nil, search_all: nil, fuzzy_search: nil) ⇒ Array<Hash>

Screen an entity (company/organization) against sanctions and watchlists

Examples:

Basic entity search

results = client.check_entity(names: "Bank Rossiya")

Fuzzy search for entities

results = client.check_entity(names: "Gazprom", fuzzy_search: 1)

Parameters:

  • names (String, nil) (defaults to: nil)

    Entity name to search for (e.g., “Apple Inc”)

  • search_all (String, nil) (defaults to: nil)

    Alternative parameter for broader entity search

  • fuzzy_search (Integer, nil) (defaults to: nil)

    Enable fuzzy matching: 1 for fuzzy, 2 for very fuzzy

Returns:

  • (Array<Hash>)

    Array of matched entities with details

Raises:



76
77
78
79
80
81
82
83
84
# File 'lib/dilisense_pep_client/client.rb', line 76

def check_entity(names: nil, search_all: nil, fuzzy_search: nil)
  params = {}
  params[:names] = names if names
  params[:search_all] = search_all if search_all
  params[:fuzzy_search] = fuzzy_search if fuzzy_search
  
  validate_entity_params(params)
  get_request("/v1/checkEntity", params)
end

#check_individual(names: nil, search_all: nil, dob: nil, gender: nil, fuzzy_search: nil, includes: nil) ⇒ Array<Hash>

Screen an individual against PEP and sanctions lists

Examples:

Search with full parameters

results = client.check_individual(
  names: "Vladimir Putin",
  dob: "07/10/1952",
  gender: "male",
  fuzzy_search: 1
)

Parameters:

  • names (String, nil) (defaults to: nil)

    Full name to search for (e.g., “John Smith”)

  • search_all (String, nil) (defaults to: nil)

    Alternative to names parameter for broader search

  • dob (String, nil) (defaults to: nil)

    Date of birth in DD/MM/YYYY format (e.g., “14/06/1982”)

  • gender (String, nil) (defaults to: nil)

    Gender - either “male” or “female”

  • fuzzy_search (Integer, nil) (defaults to: nil)

    Enable fuzzy matching: 1 for fuzzy, 2 for very fuzzy

  • includes (String, nil) (defaults to: nil)

    Comma-separated source IDs to search within

Returns:

  • (Array<Hash>)

    Array of matched individuals, each hash contains:

    • :name [String] Person’s full name

    • :source_type [String] Type of source (PEP, SANCTION, etc.)

    • :pep_type [String, nil] Type of PEP if applicable

    • :gender [String, nil] Person’s gender if available

    • :date_of_birth [Array<String>, nil] Dates of birth if available

    • :citizenship [Array<String>, nil] Countries of citizenship

    • :total_records [Integer] Number of matching records

    • :sources [Array<String>] List of source databases

Raises:



54
55
56
57
58
# File 'lib/dilisense_pep_client/client.rb', line 54

def check_individual(names: nil, search_all: nil, dob: nil, gender: nil, fuzzy_search: nil, includes: nil)
  params = build_individual_params(names: names, search_all: search_all, dob: dob, gender: gender, fuzzy_search: fuzzy_search, includes: includes)
  validate_individual_params(params)
  get_request("/v1/checkIndividual", params)
end