Reconexiones automaticas si se cae rabbitmq
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Request, Response } from "express"
|
||||
import { SimUsecases } from "aplication/Sim.usecases"
|
||||
import { error } from "node:console"
|
||||
|
||||
// Partiendo del caracter 3 2 de pais + 2 de compañia
|
||||
// Metiendolo a la BDD podria ser mas dinamico pero perderia
|
||||
@@ -31,8 +32,22 @@ export class SimController {
|
||||
const { iccid } = req.body
|
||||
const compañia = this.compañiaFromIccid(iccid)
|
||||
|
||||
if (compañia == undefined) {
|
||||
res.status(500).json({
|
||||
errors: {
|
||||
msg: "El iccid no pertenece a una compañia conocida"
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.simUseCases.activation({ iccid, compañia })
|
||||
|
||||
res.status(200).json({
|
||||
iccid: iccid,
|
||||
operation: "activation"
|
||||
}).send()
|
||||
} catch (err) {
|
||||
console.error("Error activando la sim ", req.body)
|
||||
res.status(500).json({
|
||||
@@ -41,11 +56,6 @@ export class SimController {
|
||||
}
|
||||
}).send()
|
||||
}
|
||||
|
||||
res.status(200).json({
|
||||
iccid: iccid,
|
||||
operation: "activation"
|
||||
}).send()
|
||||
}
|
||||
|
||||
async cancelation(req: Request, res: Response) {
|
||||
|
||||
Reference in New Issue
Block a user