feat: customer auth via email

This commit is contained in:
Rafael Taranto 2023-11-28 17:36:29 +00:00
parent 92a3f16c80
commit ab304093f3
22 changed files with 252 additions and 27 deletions

View file

@ -0,0 +1,14 @@
const db = require('./db')
exports.up = function (next) {
let sql = [
'ALTER TABLE customers ADD COLUMN email text unique',
'ALTER TABLE customers ADD COLUMN email_at timestamptz',
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}

View file

@ -0,0 +1,18 @@
const { migrationSaveConfig } = require('../lib/new-settings-loader')
exports.up = function (next) {
const triggersDefault = {
triggersConfig_customerAuthentication: 'SMS',
}
return migrationSaveConfig(triggersDefault)
.then(() => next())
.catch(err => {
console.log(err.message)
return next(err)
})
}
exports.down = function (next) {
next()
}

View file

@ -0,0 +1,14 @@
const db = require('./db')
exports.up = function (next) {
let sql = [
'ALTER TABLE cash_in_txs ADD COLUMN email text',
'ALTER TABLE cash_out_txs ADD COLUMN email text',
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}