var path = require('path'); var database = require(path.join(__dirname, '../../database.js')); var format = require(path.join(__dirname, '../../util/format.js')); module.exports = class PaymentUpdate { getData(params, cb) { let query = `SELECT pm.id payMethodFk, pm.name payMethodName, c.dueDay, c.iban, LOWER(ct.code) countryCode, email FROM client c JOIN payMethod pm ON pm.id = c.paymentMethodFk JOIN country ct ON ct.id = c.countryFk WHERE c.id = ?`; database.pool.query(query, [params.userId], (error, result) => { Object.assign(this, result[0]); cb(); }); } get paymentDay() { if (this.payMethodFk != 5) { return `