moov-io / watchman

AML/CTF/KYC/OFAC Search of global watchlist and sanctions
https://moov-io.github.io/watchman/
Apache License 2.0
330 stars 87 forks source link

search: Filter search results to a single SDN type #525

Open tomdaffurn opened 8 months ago

tomdaffurn commented 8 months ago

Watchman Version: v0.27.0

What were you trying to do? Filter results to entities of type "individual".

This is complicated by the fact that AltNames and Addresses are not stored in memory with the sdnType of their SDN. Also difficult because different lists have different enums for type. e.g. ukConsolidatedSanctionsList has "GroupType": "Individual", euConsolidatedSanctionsList has "EntitySubjectType": "person".

I suggest defining a generalised type enum in the Watchman API, then mapping that into the types of each watchlist. Similar to what is done for name.

What did you expect to see? Results in SDNs, altNames, addresses, euConsolidatedSanctionsList, ukConsolidatedSanctionsList (maybe more lists) should be only for individuals.

What did you see? Results are present in all lists (except SDNs) for Companies, Vessels, etc.

How can we reproduce the problem? Use a Query or Name search with sdnType=individual. e.g https://oss.moov.io/watchman/search?q=a&sdnType=individual or https://oss.moov.io/watchman/search?name=a&sdnType=individual

adamdecaf commented 8 months ago

Yea I agree. I think creating a generalized model for entity lists would help solve this.