borreo código que ya no se va a usar

This commit is contained in:
Andres2908
2022-05-16 22:39:26 -05:00
parent 703005ef5c
commit 9d6a87854d
10 changed files with 9 additions and 253 deletions
-20
View File
@@ -1,20 +0,0 @@
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;
-31
View File
@@ -1,31 +0,0 @@
const dbPath = '../../db/tablas';
const Usuario = require(`${dbPath}/Usuario`);
const Inscripcion = require(`${dbPath}/Inscripcion`);
const Impresion = require(`${dbPath}/Impresion`);
const { validarNumeroCuenta, validarNumero } = require('../../helper/validar');
const restarCredito = async (body) => {
const creditoUsado = validarNumero(body.monto, 'monto', true);
const numeroCuenta = validarNumeroCuenta(
body.numeroCuenta,
'número de cuenta',
true
);
return Usuario.findOne({
where: { numeroCuenta },
}).then(() => {
if (!res) throw new Error('No encontramos este número de cuenta');
return Usuario.update(
{
credito: res.credito - creditoUsado,
},
{
where: { numeroCuenta },
}
).then((res) => ({
message: '¡La transaccion se realizo con éxito!',
}));
});
};
module.exports = restarCredito;
@@ -1,21 +0,0 @@
const { Op } = require('sequelize');
const dbPath = '../../db/tablas';
const Usuario = require(`${dbPath}/Usuario`);
const Impresion = require(`${dbPath}/Impresion`);
const { validarNumeroEntero } = require('../../helper/validar');
const ticketsImpresion = async (body) => {
const validacion = validarNumeroEntero(body.validacion, 'validacion', true);
return Impresion.findAll({
where: { validacion },
include: [
{
model: Usuario,
where: { numeroCuenta: { [Op.like]: `%${body.numeroCuenta}%` } },
attributes: ['idUsuario', 'numeroCuenta'],
},
],
});
};
module.exports = ticketsImpresion;