Merge pull request #76 from goga-m/v5

V5
This commit is contained in:
Josh Harvey 2017-08-15 14:45:45 +03:00 committed by GitHub
commit d3aac1b065
4 changed files with 12 additions and 4 deletions

6
lib/constants.js Normal file
View file

@ -0,0 +1,6 @@
const anonymousCustomer = {
uuid : '47ac1184-8102-11e7-9079-8f13a7117867',
name: 'anonymous',
}
module.exports = {anonymousCustomer}

View file

@ -58,7 +58,7 @@ function poll (req, res, next) {
locale,
txLimit: config.cashInTransactionLimit,
idVerificationEnabled: config.idVerificationEnabled,
smsVerificationEnabled: config.smsVerificationEnabled,
smsVerificationActive: config.smsVerificationActive,
cassettes,
twoWayMode: config.cashOutEnabled,
zeroConfLimit: config.zeroConfLimit,

View file

@ -1,4 +1,5 @@
var db = require('./db')
var anonymous = require('../lib/constants').anonymousCustomer
exports.up = function(next) {
const sql =
@ -20,8 +21,9 @@ exports.up = function(next) {
id_card_image_path text,
id_card_image_at timestamptz,
created timestamptz NOT NULL DEFAULT now() )`,
`alter table cash_in_txs add column customer_id uuid references customers (id)`,
`alter table cash_out_txs add column customer_id uuid references customers (id)`
`insert into customers (id, name) VALUES ( '${anonymous.uuid}','${anonymous.name}' )`,
`alter table cash_in_txs add column customer_id uuid references customers (id) DEFAULT '${anonymous.uuid}'`,
`alter table cash_out_txs add column customer_id uuid references customers (id) DEFAULT '${anonymous.uuid}'`,
]
db.multi(sql, next)

View file

@ -99,7 +99,7 @@
"crypto": "global",
"machine": "global"
},
"code": "smsVerificationEnabled",
"code": "smsVerificationActive",
"fieldType": "onOff",
"fieldClass": null
},