feat: implement sumsub API module

feat: add 3rd party services splash screen
feat: add sumsub as a configurable 3rd party service
feat: sumsub config loader
fix: small fixes

feat: add external validation as a compliance trigger
feat: add external validation route in l-s
feat: add external validation graphql module
feat: integrate sumsub SDK

feat: improve sumsub form to allow adding multiple applicant levels with enhanced UX
feat: added support for array fields in FormRenderer
feat: allow external validation triggers to dynamically use levels setup in the services page
fix: multiple small fixes

feat: get external compliance customer info
fix: small fixes

feat: add informational card in customer profile regarding external service info

feat: send external customer data for machine trigger verification

feat: restrictions to the creation of custom info requests and external validation triggers
fix: allow for a single applicant level to be setup

fix: account instance access

fix: small fixes

fix: development-only log
This commit is contained in:
Sérgio Salgado 2022-11-03 18:53:08 +00:00 committed by Rafael Taranto
parent 6c8ced3c1f
commit 6ba0632067
31 changed files with 1730 additions and 67 deletions

View file

@ -17,6 +17,7 @@ const NUM_RESULTS = 1000
const sms = require('./sms')
const settingsLoader = require('./new-settings-loader')
const logger = require('./logger')
const externalCompliance = require('./compliance-external')
const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel', 'scoreThresholdReached', 'walletScoringError']
@ -243,7 +244,7 @@ function deleteEditedData (id, data) {
'id_card_data',
'id_card_photo',
'us_ssn',
'subcriber_info',
'subscriber_info',
'name'
]
const filteredData = _.pick(defaults, _.mapKeys(_.snakeCase, data))
@ -322,6 +323,7 @@ function getById (id) {
return db.oneOrNone(sql, [id])
.then(assignCustomerData)
.then(getCustomInfoRequestsData)
.then(getExternalCustomerData)
.then(camelize)
}
@ -589,6 +591,7 @@ function getCustomerById (id) {
.then(getCustomInfoRequestsData)
.then(camelizeDeep)
.then(formatSubscriberInfo)
.then(getExternalCustomerData)
}
function assignCustomerData (customer) {
@ -927,6 +930,15 @@ function updateLastAuthAttempt (customerId) {
return db.none(sql, [customerId])
}
function getExternalCustomerData (customer) {
return settingsLoader.loadLatest()
.then(settings => externalCompliance.getApplicant(settings, customer))
.then(externalCompliance => {
customer.externalCompliance = externalCompliance
return customer
})
}
module.exports = {
add,
addWithEmail,