const dbPath = '../../db/tablas'; const Usuario = require(`${dbPath}/Usuario`); const { validarNumeroCuenta } = require('../../helper/validar'); const credito = async (body) => { const numeroCuenta = validarNumeroCuenta( body.numeroCuenta, 'nĂºmero de cuenta', true ); return Usuario.findOne({ where: { numeroCuenta }, }).then(() => { return Usuario.findOne({ attributes: ['credito', 'nombre', 'numeroCuenta'], }); }); }; module.exports = credito;