demo rector
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const jwt = require("jsonwebtoken");
|
||||
class AuthController {
|
||||
static async signUsuario(type, usuarioId) {
|
||||
const secret = 'Holabeb';
|
||||
const token = jwt.sign({ type, usuarioId }, secret, { expiresIn: '1h' });
|
||||
return token;
|
||||
}
|
||||
}
|
||||
exports.AuthController = AuthController;
|
||||
//# sourceMappingURL=Auth.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/controller/Auth.ts"],"names":[],"mappings":";;AAAA,oCAAmC;AACnC,MAAa,cAAc;IACzB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAE,IAAY,EAAE,SAAiB;QACvD,MAAM,MAAM,GAAG,SAAS,CAAA;QACxB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACxE,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAND,wCAMC"}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
//# sourceMappingURL=Ayuda.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Ayuda.js","sourceRoot":"","sources":["../../src/controller/Ayuda.ts"],"names":[],"mappings":""}
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Papa = require("papaparse");
|
||||
const fs = require("fs");
|
||||
const Carrito_1 = require("../entity/Carrito");
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Tipo_1 = require("../entity/Tipo");
|
||||
const Equipo_1 = require("../entity/Equipo");
|
||||
class CarritoController {
|
||||
async carga(req, res) {
|
||||
const cargaFile = req.file;
|
||||
if (!cargaFile) {
|
||||
res.status(400).send({
|
||||
status: false,
|
||||
data: 'No file is selected.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const fileReadResult = fs.readFileSync(cargaFile.path, 'utf-8');
|
||||
const parseResult = await Papa.parse(fileReadResult, {
|
||||
header: true
|
||||
});
|
||||
console.log(parseResult);
|
||||
let data = {};
|
||||
try {
|
||||
for (const i in parseResult.data) {
|
||||
data = parseResult.data[i];
|
||||
if (!data.kiosko ||
|
||||
!data.alias_carrito ||
|
||||
!data.no_serie ||
|
||||
!data.no_inventario) {
|
||||
continue;
|
||||
}
|
||||
console.log(data);
|
||||
await this.saveCarrito(data);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).send(err.message);
|
||||
return;
|
||||
}
|
||||
res.status(200).send('okay');
|
||||
}
|
||||
async saveCarrito(data) {
|
||||
const carritoRepository = typeorm_1.getRepository(Carrito_1.Carrito);
|
||||
const tipoRepository = typeorm_1.getRepository(Tipo_1.Tipo);
|
||||
const equipoRepository = typeorm_1.getRepository(Equipo_1.Equipo);
|
||||
const tipo = new Tipo_1.Tipo();
|
||||
const carrito = new Carrito_1.Carrito();
|
||||
const equipo = new Equipo_1.Equipo();
|
||||
const tipoFind = await tipoRepository.findOne({
|
||||
where: {
|
||||
nombre: data.tipo
|
||||
}
|
||||
});
|
||||
if (!tipoFind) {
|
||||
tipo.nombre = data.tipo;
|
||||
}
|
||||
const carritoFind = await carritoRepository.findOne({
|
||||
where: {
|
||||
kiosko: data.kiosko,
|
||||
alias: data.alias_carrito,
|
||||
tipo: tipoFind
|
||||
}
|
||||
});
|
||||
if (!carritoFind) {
|
||||
carrito.kiosko = data.kiosko;
|
||||
carrito.alias = data.alias_carrito;
|
||||
carrito.tipo = !tipoFind ? tipo : tipoFind;
|
||||
}
|
||||
equipo.alias = data.equipo_carrito;
|
||||
equipo.noSerie = data.no_serie;
|
||||
equipo.noInventario = data.no_inventario;
|
||||
equipo.carrito = !carritoFind ? carrito : carritoFind;
|
||||
if (!tipoFind)
|
||||
await tipoRepository.save(tipo);
|
||||
if (!carritoFind)
|
||||
await carritoRepository.save(carrito);
|
||||
await equipoRepository.save(equipo);
|
||||
}
|
||||
}
|
||||
exports.CarritoController = CarritoController;
|
||||
//# sourceMappingURL=Carrito.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Carrito.js","sourceRoot":"","sources":["../../src/controller/Carrito.ts"],"names":[],"mappings":";;AACA,kCAAiC;AACjC,yBAAwB;AACxB,iDAA6C;AAC7C,qCAAuC;AACvC,2CAAuC;AACvC,+CAA2C;AAC3C,MAAa,iBAAiB;IACrB,KAAK,CAAC,KAAK,CAAE,GAAY,EAAE,GAAa;QAC7C,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAA;QAC1B,IAAI,CAAC,SAAS,EAAE;YACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,sBAAsB;aAC7B,CAAC,CAAA;YACF,OAAO,KAAK,CAAA;SACb;QACD,MAAM,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC/D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;YACnD,MAAM,EAAE,IAAI;SACb,CAAC,CAAA;QACF,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACxB,IAAI,IAAI,GAAQ,EAAE,CAAA;QAClB,IAAI;YACF,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE;gBAChC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBAC1B,IACE,CAAC,IAAI,CAAC,MAAM;oBACZ,CAAC,IAAI,CAAC,aAAa;oBACnB,CAAC,IAAI,CAAC,QAAQ;oBACd,CAAC,IAAI,CAAC,aAAa,EACnB;oBACA,SAAQ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AAG,IAAI,CAAC,aAAa,CAAA;YAClC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;SAC3C;QAED,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAA;QAClC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,MAAM,CAAC,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAA;QACrD,IAAI,CAAC,QAAQ;YAAE,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,CAAC,WAAW;YAAE,MAAM,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvD,MAAM,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;CACF;AA7ED,8CA6EC"}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Horario_1 = require("../entity/Horario");
|
||||
class HorarioController {
|
||||
static async getAll(req, res) {
|
||||
const repository = typeorm_1.getRepository(Horario_1.Horario);
|
||||
const horarios = await repository.find();
|
||||
res.status(200).json(horarios);
|
||||
}
|
||||
}
|
||||
exports.HorarioController = HorarioController;
|
||||
//# sourceMappingURL=Horario.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Horario.js","sourceRoot":"","sources":["../../src/controller/Horario.ts"],"names":[],"mappings":";;AACA,qCAAuC;AACvC,iDAA6C;AAE7C,MAAa,iBAAiB;IAC5B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,GAAY,EAAE,GAAa;QAC9C,MAAM,UAAU,GAAG,uBAAa,CAAC,iBAAO,CAAC,CAAA;QACzC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAA;QACxC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;CACF;AAND,8CAMC"}
|
||||
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Operador_1 = require("../entity/Operador");
|
||||
const class_validator_1 = require("class-validator");
|
||||
const typeorm_1 = require("typeorm");
|
||||
class OperadorController {
|
||||
static async create(req, res) {
|
||||
const { usuario, secreto, admin } = req.body;
|
||||
const operador = new Operador_1.Operador();
|
||||
operador.usuario = usuario;
|
||||
operador.secreto = secreto;
|
||||
operador.admin = admin;
|
||||
const errors = await class_validator_1.validate(operador);
|
||||
if (errors.length > 0) {
|
||||
res.status(400).send(errors);
|
||||
}
|
||||
operador.hashPassword();
|
||||
const repository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
try {
|
||||
await repository.save(operador);
|
||||
}
|
||||
catch (e) {
|
||||
res.status(409).send('username already in use');
|
||||
}
|
||||
res.status(201).send('User created');
|
||||
}
|
||||
static async getAll(req, res) {
|
||||
const repository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
const result = await repository.find({
|
||||
select: ['id', 'usuario', 'admin']
|
||||
});
|
||||
res.status(200).json(result);
|
||||
}
|
||||
static async getOne(req, res) {
|
||||
const id = +req.params.id;
|
||||
const repository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
try {
|
||||
const operador = await repository.findOneOrFail(id, {
|
||||
select: ['id', 'usuario', 'admin']
|
||||
});
|
||||
res.status(200).json(operador);
|
||||
}
|
||||
catch (e) {
|
||||
res.status(404).send('User not found');
|
||||
}
|
||||
}
|
||||
static async remove(req, res) {
|
||||
const id = +req.params.id;
|
||||
const repository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
try {
|
||||
const operador = await repository.findOneOrFail(id);
|
||||
repository.remove(operador);
|
||||
res.status(204).send();
|
||||
}
|
||||
catch (error) {
|
||||
res.status(404).send('User not found');
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.OperadorController = OperadorController;
|
||||
//# sourceMappingURL=Operador.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Operador.js","sourceRoot":"","sources":["../../src/controller/Operador.ts"],"names":[],"mappings":";;AAAA,mDAA+C;AAE/C,qDAA0C;AAC1C,qCAAuC;AAEvC,MAAa,kBAAkB;IAC7B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,GAAY,EAAE,GAAa;QAC9C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAE5C,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAA;QAE/B,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;QAC1B,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;QAC1B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;QAEtB,MAAM,MAAM,GAAG,MAAM,0BAAQ,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAC7B;QAED,QAAQ,CAAC,YAAY,EAAE,CAAA;QAEvB,MAAM,UAAU,GAAG,uBAAa,CAAC,mBAAQ,CAAC,CAAA;QAC1C,IAAI;YACF,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SAChC;QAAC,OAAO,CAAC,EAAE;YACV,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;SAChD;QACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACtC,CA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MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;SACvB;QAAC,OAAO,KAAK,EAAE;YACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;SACvC;IACH,CAAC;CACF;AA1DD,gDA0DC"}
|
||||
Vendored
+163
@@ -0,0 +1,163 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Equipo_1 = require("../entity/Equipo");
|
||||
const Prestamo_1 = require("../entity/Prestamo");
|
||||
const Usuario_1 = require("../entity/Usuario");
|
||||
const Operador_1 = require("../entity/Operador");
|
||||
const moment = require("moment");
|
||||
const Mesa_1 = require("../entity/Mesa");
|
||||
class PrestamoController {
|
||||
static async crear(request, res) {
|
||||
const usuarioRepository = await typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
const equipoRepository = await typeorm_1.getRepository(Equipo_1.Equipo);
|
||||
const prestamoRepository = await typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const { usuarioId, tipoId } = request.body;
|
||||
const usuario = await usuarioRepository.findOne(usuarioId, {
|
||||
select: ['id', 'baja', 'multa']
|
||||
});
|
||||
if (!usuario) {
|
||||
res.status(400).json({ err: 'Usuario no encontrado' });
|
||||
return;
|
||||
}
|
||||
if (usuario.baja) {
|
||||
res.status(400).json({ err: 'El usuario esta dado de baja' });
|
||||
return;
|
||||
}
|
||||
const prestamoActivo = await prestamoRepository
|
||||
.createQueryBuilder('prestamo')
|
||||
.where('prestamo.usuarioId = :idUsuario', { idUsuario: usuario.id })
|
||||
.andWhere('prestamo.activo = true')
|
||||
.orWhere('prestamo.reservado = true')
|
||||
.getOne();
|
||||
if (prestamoActivo) {
|
||||
res.status(400).json({ err: 'El usuario tiene un prestamo activo' });
|
||||
return;
|
||||
}
|
||||
const equipo = await equipoRepository
|
||||
.createQueryBuilder('equipo')
|
||||
.leftJoinAndSelect('equipo.carrito', 'carrito')
|
||||
.leftJoinAndSelect('carrito.tipo', 'tipo')
|
||||
.where('equipo.activo = :activo', { activo: false })
|
||||
.andWhere('carrito.kiosko = :kiosko', { kiosko: 1 })
|
||||
.andWhere('tipo.id = :tipoId', { tipoId })
|
||||
.orderBy('equipo.updatedAt', 'ASC')
|
||||
.getOne();
|
||||
const prestamo = new Prestamo_1.Prestamo();
|
||||
equipo.activo = true;
|
||||
prestamo.equipo = equipo;
|
||||
prestamo.usuario = usuario;
|
||||
const m = moment()
|
||||
.add({ hours: 2, minutes: 35 })
|
||||
.toLocaleString();
|
||||
prestamo.horaMaxEntrega = m;
|
||||
await equipoRepository.save(equipo);
|
||||
await prestamoRepository.save(prestamo);
|
||||
prestamo.qr = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${prestamo.id}`;
|
||||
console.log(prestamo);
|
||||
res.status(200).json({
|
||||
prestamo
|
||||
});
|
||||
}
|
||||
static async confirmar(req, res) {
|
||||
const prestamoRepository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const operadorRepository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
const { prestamoId, operadorId } = req.body;
|
||||
const prestamo = await prestamoRepository.findOne(prestamoId, {
|
||||
relations: ['equipo']
|
||||
});
|
||||
if (!prestamo) {
|
||||
res.status(400).json({
|
||||
err: 'El prestamo no existe'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const operador = await operadorRepository.findOne(operadorId);
|
||||
if (!operador) {
|
||||
res.status(400).json({
|
||||
err: 'El operador no existe'
|
||||
});
|
||||
return;
|
||||
}
|
||||
prestamo.operadorEntrega = operador;
|
||||
prestamo.reservado = false;
|
||||
prestamo.activo = true;
|
||||
try {
|
||||
await prestamoRepository.save(prestamo);
|
||||
res.status(200).json(prestamo);
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).json({ err: err.message });
|
||||
}
|
||||
}
|
||||
static async regreso(req, res) {
|
||||
const equipoRepository = typeorm_1.getRepository(Equipo_1.Equipo);
|
||||
const prestamoRepository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const operadorRepository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
const mesaRepository = typeorm_1.getRepository(Mesa_1.Mesa);
|
||||
const { prestamoId, operadorId } = req.body;
|
||||
const prestamo = await prestamoRepository.findOne(prestamoId, {
|
||||
relations: ['equipo', 'usuario', 'mesa']
|
||||
});
|
||||
if (!prestamo) {
|
||||
res.status(400).json({ err: 'Prestamo no encontrado' });
|
||||
}
|
||||
const operador = await operadorRepository.findOne(operadorId);
|
||||
if (!operador) {
|
||||
res.status(400).json({ err: 'Operador no encontrado' });
|
||||
}
|
||||
if (!prestamo.usuario.interno) {
|
||||
prestamo.mesa.activo = false;
|
||||
}
|
||||
prestamo.activo = false;
|
||||
prestamo.equipo.activo = false;
|
||||
prestamo.operadorRegreso = operador;
|
||||
try {
|
||||
if (!prestamo.usuario.interno) {
|
||||
await mesaRepository.save(prestamo.mesa);
|
||||
}
|
||||
await equipoRepository.save(prestamo.equipo);
|
||||
await prestamoRepository.save(prestamo);
|
||||
res.status(200).send('Prestamo regresado Exitosamente');
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).json({ err: err.message });
|
||||
}
|
||||
}
|
||||
static async estatus(req, res) {
|
||||
const repository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const { usuarioId } = req.query;
|
||||
console.log(usuarioId);
|
||||
const prestamo = await repository
|
||||
.createQueryBuilder('prestamo')
|
||||
.leftJoinAndSelect('prestamo.usuario', 'usuario')
|
||||
.leftJoinAndSelect('prestamo.mesa', 'mesa')
|
||||
.where('usuario.id = :usuarioId', { usuarioId })
|
||||
.andWhere('prestamo.activo = :activo', { activo: true })
|
||||
.getOne();
|
||||
if (!prestamo) {
|
||||
res.status(200).json({ err: 'El usuario no tiene prestamos activos' });
|
||||
return;
|
||||
}
|
||||
console.log(prestamo);
|
||||
res.status(200).json(prestamo);
|
||||
}
|
||||
static async cancelar(req, res) {
|
||||
const repository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const { prestamoId } = req.body;
|
||||
const prestamo = await repository.findOne(prestamoId);
|
||||
if (!prestamo) {
|
||||
res.status(400).json({ err: 'El prestamo no existe' });
|
||||
}
|
||||
prestamo.reservado = false;
|
||||
try {
|
||||
await repository.save(prestamo);
|
||||
res.status(200).send('Cancelado correctamente');
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).json({ err: err.message });
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.PrestamoController = PrestamoController;
|
||||
//# sourceMappingURL=Prestamo.js.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+165
@@ -0,0 +1,165 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Prestamo_1 = require("../entity/Prestamo");
|
||||
const moment = require("moment");
|
||||
const Horario_1 = require("../entity/Horario");
|
||||
const Usuario_1 = require("../entity/Usuario");
|
||||
const Equipo_1 = require("../entity/Equipo");
|
||||
const Operador_1 = require("../entity/Operador");
|
||||
const Mesa_1 = require("../entity/Mesa");
|
||||
class ResevacionController {
|
||||
static async espaciosDisponibles(req, res) {
|
||||
const repository = typeorm_1.getRepository(Horario_1.Horario);
|
||||
const fecha = moment().format('L');
|
||||
console.log(fecha);
|
||||
const espacios = await repository
|
||||
.createQueryBuilder('horario')
|
||||
.leftJoinAndSelect('horario.prestamos', 'prestamo')
|
||||
.where('prestamo.createdAt >= :fecha', { fecha })
|
||||
.groupBy('horario.hora')
|
||||
.getMany();
|
||||
return res.status(200).json(espacios);
|
||||
}
|
||||
static async reservar(req, res) {
|
||||
const prestamoRepository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const horarioRepository = typeorm_1.getRepository(Horario_1.Horario);
|
||||
const usuarioRepository = typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
const equipoRepository = typeorm_1.getRepository(Equipo_1.Equipo);
|
||||
const { usuarioId, tipoId, horarioId } = req.body;
|
||||
const usuario = await usuarioRepository.findOne(usuarioId, {
|
||||
select: ['id', 'baja', 'multa']
|
||||
});
|
||||
if (!usuario) {
|
||||
res.status(400).json({ err: 'Usuario no encontrado' });
|
||||
return;
|
||||
}
|
||||
if (usuario.baja) {
|
||||
res.status(400).json({ err: 'El usuario esta dado de baja' });
|
||||
return;
|
||||
}
|
||||
const horario = await horarioRepository.findOne(horarioId);
|
||||
if (!horario) {
|
||||
res.status(400).json({ err: 'El horario no existe' });
|
||||
return;
|
||||
}
|
||||
const prestamoActivo = await prestamoRepository
|
||||
.createQueryBuilder('prestamo')
|
||||
.where('prestamo.usuarioId = :idUsuario', { idUsuario: usuario.id })
|
||||
.andWhere('prestamo.activo = true')
|
||||
.orWhere('prestamo.reservado = true')
|
||||
.getOne();
|
||||
if (prestamoActivo) {
|
||||
res.status(400).json({ err: 'El usuario tiene un prestamo activo' });
|
||||
return;
|
||||
}
|
||||
const equipo = await equipoRepository
|
||||
.createQueryBuilder('equipo')
|
||||
.leftJoinAndSelect('equipo.carrito', 'carrito')
|
||||
.leftJoinAndSelect('carrito.tipo', 'tipo')
|
||||
.where('equipo.activo = :activo', { activo: false })
|
||||
.andWhere('carrito.kiosko = :kiosko', { kiosko: 3 })
|
||||
.andWhere('tipo.id = :tipoId', { tipoId })
|
||||
.orderBy('equipo.updatedAt', 'ASC')
|
||||
.getOne();
|
||||
if (!equipo) {
|
||||
res.status(400).json({ err: 'Ya no hay equipos' });
|
||||
return;
|
||||
}
|
||||
const prestamo = new Prestamo_1.Prestamo();
|
||||
const horamax = horario.hora.split('-')[1].split(':')[0];
|
||||
const m = moment()
|
||||
.hour(+horamax)
|
||||
.minute(0)
|
||||
.toLocaleString();
|
||||
equipo.activo = true;
|
||||
prestamo.equipo = equipo;
|
||||
prestamo.usuario = usuario;
|
||||
prestamo.horaMaxEntrega = m;
|
||||
prestamo.horario = horario;
|
||||
await equipoRepository.save(equipo);
|
||||
await prestamoRepository.save(prestamo);
|
||||
prestamo.qr = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${prestamo.id}`;
|
||||
console.log(prestamo);
|
||||
res.status(200).json({
|
||||
prestamo
|
||||
});
|
||||
}
|
||||
static async confirmar(req, res) {
|
||||
const prestamoRepository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const operadorRepository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
const mesaRepository = typeorm_1.getRepository(Mesa_1.Mesa);
|
||||
const mesa = await mesaRepository
|
||||
.createQueryBuilder('mesa')
|
||||
.where('mesa.activo = :activo', { activo: false })
|
||||
.orderBy('mesa.updatedAt', 'ASC')
|
||||
.getOne();
|
||||
const { prestamoId, operadorId } = req.body;
|
||||
if (!mesa) {
|
||||
res.status(400).json({
|
||||
err: 'Ya no hay mesas disponbles'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const prestamo = await prestamoRepository.findOne(prestamoId, {
|
||||
relations: ['equipo']
|
||||
});
|
||||
if (!prestamo) {
|
||||
res.status(400).json({
|
||||
err: 'El prestamo no existe'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const operador = await operadorRepository.findOne(operadorId);
|
||||
if (!operador) {
|
||||
res.status(400).json({
|
||||
err: 'El operador no existe'
|
||||
});
|
||||
return;
|
||||
}
|
||||
mesa.activo = true;
|
||||
prestamo.operadorEntrega = operador;
|
||||
prestamo.reservado = false;
|
||||
prestamo.activo = true;
|
||||
prestamo.mesa = mesa;
|
||||
try {
|
||||
await mesaRepository.save(mesa);
|
||||
await prestamoRepository.save(prestamo);
|
||||
res.status(200).json(prestamo);
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).json({ err: err.message });
|
||||
}
|
||||
}
|
||||
static async regreso(req, res) {
|
||||
const equipoRepository = typeorm_1.getRepository(Equipo_1.Equipo);
|
||||
const prestamoRepository = typeorm_1.getRepository(Prestamo_1.Prestamo);
|
||||
const operadorRepository = typeorm_1.getRepository(Operador_1.Operador);
|
||||
const mesaRepository = typeorm_1.getRepository(Mesa_1.Mesa);
|
||||
const prestamo = await prestamoRepository.findOne(req.body.prestamoId, {
|
||||
relations: ['equipo', 'mesa']
|
||||
});
|
||||
if (!prestamo) {
|
||||
res.status(400).json({ err: 'Prestamo no encontrado' });
|
||||
}
|
||||
const operador = await operadorRepository.findOne(req.body.operadorId);
|
||||
if (!operador) {
|
||||
res.status(400).json({ err: 'Operador no encontrado' });
|
||||
}
|
||||
prestamo.activo = false;
|
||||
prestamo.equipo.activo = false;
|
||||
prestamo.operadorRegreso = operador;
|
||||
prestamo.mesa.activo = false;
|
||||
try {
|
||||
await equipoRepository.save(prestamo.equipo);
|
||||
await mesaRepository.save(prestamo.mesa);
|
||||
await prestamoRepository.save(prestamo);
|
||||
res.status(200).json(prestamo);
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).json({ err: err.message });
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.ResevacionController = ResevacionController;
|
||||
//# sourceMappingURL=Reservacion.js.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Tipo_1 = require("../entity/Tipo");
|
||||
class TipoController {
|
||||
static async getAll(req, res) {
|
||||
const repository = await typeorm_1.getRepository(Tipo_1.Tipo);
|
||||
const tipos = await repository.find();
|
||||
res.status(200).json(tipos);
|
||||
}
|
||||
}
|
||||
exports.TipoController = TipoController;
|
||||
//# sourceMappingURL=Tipo.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Tipo.js","sourceRoot":"","sources":["../../src/controller/Tipo.ts"],"names":[],"mappings":";;AAEA,qCAAuC;AACvC,2CAAuC;AAEvC,MAAa,cAAc;IACzB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,GAAY,EAAE,GAAa;QAC9C,MAAM,UAAU,GAAG,MAAM,uBAAa,CAAC,WAAI,CAAC,CAAA;QAC5C,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAA;QACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;CACF;AAND,wCAMC"}
|
||||
Vendored
+126
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Usuario_1 = require("../entity/Usuario");
|
||||
const class_validator_1 = require("class-validator");
|
||||
const typeorm_1 = require("typeorm");
|
||||
const Auth_1 = require("./Auth");
|
||||
class UsuarioController {
|
||||
static async create(req, res) {
|
||||
console.log(req.file);
|
||||
const { id, nombre, apellidoPaterno, apellidoMaterno, correoAlternativo, numeroTelefonico, institucion, secreto, interno } = JSON.parse(req.body.usuario);
|
||||
const identificacion = req.file;
|
||||
if (!interno && !identificacion) {
|
||||
res.status(400).send({
|
||||
status: false,
|
||||
data: 'Un usuario externo tiene que mandar fotoo de su identificacion'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const usuario = new Usuario_1.Usuario();
|
||||
usuario.id = id;
|
||||
usuario.nombre = nombre;
|
||||
usuario.apellidoPaterno = apellidoPaterno;
|
||||
usuario.apellidoMaterno = apellidoMaterno;
|
||||
usuario.correoAlternativo = correoAlternativo;
|
||||
usuario.numeroTelefonico = numeroTelefonico;
|
||||
usuario.identificacion = interno ? 'null' : JSON.stringify(identificacion);
|
||||
usuario.institucion = institucion;
|
||||
usuario.secreto = secreto;
|
||||
usuario.interno = interno;
|
||||
usuario.hashPassword();
|
||||
const errors = await class_validator_1.validate(usuario);
|
||||
if (errors.length > 0) {
|
||||
res.status(400).send(errors);
|
||||
}
|
||||
const repository = typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
try {
|
||||
await repository.save(usuario);
|
||||
}
|
||||
catch (e) {
|
||||
res.status(409).send(e.message);
|
||||
return;
|
||||
}
|
||||
res.status(201).send('User create');
|
||||
}
|
||||
static async getAll(req, res) {
|
||||
const respository = typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
const result = await respository.find({
|
||||
select: ['id', 'nombre', 'apellidoMaterno', 'apellidoPaterno']
|
||||
});
|
||||
res.status(200).json(result);
|
||||
}
|
||||
static async getOne(req, res) {
|
||||
const respository = typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
const id = +req.params.id;
|
||||
try {
|
||||
const result = await respository.findOneOrFail(id, {
|
||||
select: ['id', 'nombre', 'apellidoMaterno', 'apellidoPaterno']
|
||||
});
|
||||
res.status(200).json(result);
|
||||
}
|
||||
catch (e) {
|
||||
res.status(404).send('Usuario no encontrado');
|
||||
}
|
||||
}
|
||||
static async login(req, res) {
|
||||
const repository = typeorm_1.getRepository(Usuario_1.Usuario);
|
||||
const { id, secreto } = req.body;
|
||||
try {
|
||||
const usuario = await repository.findOne({
|
||||
where: {
|
||||
id
|
||||
}
|
||||
});
|
||||
if (!usuario) {
|
||||
throw new Error('*Usuario o contraseña invalidos');
|
||||
}
|
||||
if (!usuario.checkIfUnencryptedPasswordIsValid(secreto)) {
|
||||
throw new Error('Usuario o *contraseña invalidos');
|
||||
}
|
||||
const token = await Auth_1.AuthController.signUsuario(usuario.interno ? 'usuarioInterno' : 'usuarioExterno', usuario.id);
|
||||
console.log(token);
|
||||
res.status(200).json({
|
||||
nombre: usuario.nombre,
|
||||
apellidoPaterno: usuario.apellidoPaterno,
|
||||
apellidoMaterno: usuario.apellidoMaterno,
|
||||
interno: usuario.interno,
|
||||
token
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
res.status(400).send(err.message);
|
||||
}
|
||||
}
|
||||
static async verificar(req, res) {
|
||||
const usuarios = ['415112132', '41511216'];
|
||||
const externos = ['315112132', '31511216'];
|
||||
const usuarioId = req.params.id;
|
||||
const usuarioInterno = {
|
||||
nombre: 'Arturo',
|
||||
apellidoPaterno: 'Guerrero',
|
||||
apellidoMaterno: 'Lopez',
|
||||
institucion: 'Fes acatlan',
|
||||
carrera: 'Matematicas aplicadas',
|
||||
interno: true
|
||||
};
|
||||
const usuarioExterno = {
|
||||
nombre: 'Paulina',
|
||||
apellidoPaterno: 'Guerrero',
|
||||
apellidoMaterno: 'Lopez',
|
||||
institucion: 'FES Iztacala',
|
||||
carrera: 'Biologia',
|
||||
interno: false
|
||||
};
|
||||
if (usuarios.includes(usuarioId)) {
|
||||
res.status(200).json(usuarioInterno);
|
||||
return;
|
||||
}
|
||||
if (externos.includes(usuarioId)) {
|
||||
res.status(200).json(usuarioExterno);
|
||||
return;
|
||||
}
|
||||
res.status(400).json({ err: 'no se encontro un usuario' });
|
||||
}
|
||||
}
|
||||
exports.UsuarioController = UsuarioController;
|
||||
//# sourceMappingURL=Usuario.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Usuario.js","sourceRoot":"","sources":["../../src/controller/Usuario.ts"],"names":[],"mappings":";;AAAA,iDAA6C;AAE7C,qDAA0C;AAC1C,qCAAuC;AACvC,iCAAuC;AACvC,MAAa,iBAAiB;IAC5B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,GAAY,EAAE,GAAa;QAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrB,MAAM,EACJ,EAAE,EACF,MAAM,EACN,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,OAAO,EACR,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAEhC,MAAM,cAAc,GAAG,GAAG,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE;YAC/B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,gEAAgE;aACvE,CAAC,CAAA;YACF,OAAO,KAAK,CAAA;SACb;QAED,MAAM,O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