feat: add button to check against OFAC sanction list
This commit is contained in:
parent
a29f3fc13c
commit
c77fda2623
11 changed files with 114 additions and 5 deletions
14
lib/new-admin/graphql/resolvers/sanctions.resolver.js
Normal file
14
lib/new-admin/graphql/resolvers/sanctions.resolver.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const _ = require('lodash/fp')
|
||||
const ofac = require('../../../ofac')
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
checkAgainstSanctions: (...[, { firstName, lastName, birthdate }]) => {
|
||||
const ofacMatches = ofac.match({ firstName, lastName }, birthdate, { threshold: 0.85, fullNameThreshold: 0.95, debug: false })
|
||||
|
||||
return { ofacSanctioned: _.size(ofacMatches) > 0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue