diff --git a/lib/config-migration.js b/lib/config-migration.js index 4f29951d..246db2c4 100644 --- a/lib/config-migration.js +++ b/lib/config-migration.js @@ -409,7 +409,7 @@ function migrateComplianceTriggers (config) { return { triggers, - ['compliance_rejectAddressReuse']: rejectAddressReuseActive + ['compliance_rejectAddressReuse']: global.rejectAddressReuseActive } } diff --git a/lib/customers.js b/lib/customers.js index ff5e0f3c..27d71ba2 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -98,7 +98,7 @@ function update (id, data, userToken, txId) { */ async function updateCustomer (id, data) { const formattedData = _.pick( - ['authorized_override', 'id_card_photo_override', 'id_card_data_override', 'sms_override'], + ['authorized_override', 'id_card_photo_override', 'id_card_data_override', 'sms_override', 'us_ssn_override'], _.mapKeys(_.snakeCase, data)) const sql = Pgp.helpers.update(formattedData, _.keys(formattedData), 'customers') + @@ -234,7 +234,8 @@ function getComplianceTypes () { 'id_card_photo', 'front_camera', 'sanctions', - 'authorized' ] + 'authorized', + 'us_ssn' ] } function enhanceAtFields (fields) { @@ -243,7 +244,8 @@ function enhanceAtFields (fields) { 'id_card_photo', 'front_camera', 'sanctions', - 'authorized' + 'authorized', + 'us_ssn' ] const updatedFields = _.intersection(updateableFields, _.keys(fields)) diff --git a/lib/routes.js b/lib/routes.js index 1b3df340..44a9fadc 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -108,10 +108,10 @@ function poll (req, res, next) { const compatTriggers = complianceTriggers.getBackwardsCompatibleTriggers(triggers) response.smsVerificationActive = !!compatTriggers.sms response.smsVerificationThreshold = compatTriggers.sms - response.idCardDataVerificationActive = !!compatTriggers.idData - response.idCardDataVerificationThreshold = compatTriggers.idData - response.idCardPhotoVerificationActive = !!compatTriggers.idPhoto - response.idCardPhotoVerificationThreshold = compatTriggers.idPhoto + response.idCardDataVerificationActive = !!compatTriggers.idCardData + response.idCardDataVerificationThreshold = compatTriggers.idCardData + response.idCardPhotoVerificationActive = !!compatTriggers.idCardPhoto + response.idCardPhotoVerificationThreshold = compatTriggers.idCardPhoto response.sanctionsVerificationActive = !!compatTriggers.sancations response.sanctionsVerificationThreshold = compatTriggers.sancations response.frontCameraVerificationActive = !!compatTriggers.facephoto diff --git a/migrations/1601908070568-us-ssn.js b/migrations/1601908070568-us-ssn.js new file mode 100644 index 00000000..b66a3849 --- /dev/null +++ b/migrations/1601908070568-us-ssn.js @@ -0,0 +1,17 @@ +const db = require('./db') + +exports.up = function (next) { + var sql = [ + 'ALTER TABLE customers ADD COLUMN us_ssn text', + 'ALTER TABLE customers ADD COLUMN us_ssn_at timestamptz', + "ALTER TABLE customers ADD COLUMN us_ssn_override verification_type not null default 'automatic'", + 'ALTER TABLE customers ADD COLUMN us_ssn_override_by text references user_tokens (token)', + 'ALTER TABLE customers ADD COLUMN us_ssn_override_at timestamptz', + ] + + db.multi(sql, next) +} + +exports.down = function (next) { + next() +} diff --git a/new-lamassu-admin/src/pages/Triggers/Wizard.js b/new-lamassu-admin/src/pages/Triggers/Wizard.js index c56d0677..8af9b4d3 100644 --- a/new-lamassu-admin/src/pages/Triggers/Wizard.js +++ b/new-lamassu-admin/src/pages/Triggers/Wizard.js @@ -117,7 +117,7 @@ const getRequirementText = config => { return 'asked to scan a ID' case 'facephoto': return 'asked to have a photo taken' - case 'us-ssn': + case 'usSsn': return 'asked to input his social security number' case 'sanctions': return 'matched against the OFAC sanctions list' diff --git a/new-lamassu-admin/src/pages/Triggers/helper.js b/new-lamassu-admin/src/pages/Triggers/helper.js index aee6a675..c0544dfb 100644 --- a/new-lamassu-admin/src/pages/Triggers/helper.js +++ b/new-lamassu-admin/src/pages/Triggers/helper.js @@ -261,7 +261,7 @@ const requirementOptions = [ { display: 'ID data', code: 'idCardData' }, { display: 'Customer camera', code: 'facephoto' }, { display: 'Sanctions', code: 'sanctions' }, - { display: 'US SSN', code: 'us-ssn' }, + { display: 'US SSN', code: 'usSsn' }, // { display: 'Super user', code: 'superuser' }, { display: 'Suspend', code: 'suspend' }, { display: 'Block', code: 'block' }