Fix orders nos

This commit is contained in:
2026-04-22 12:31:46 +02:00
parent c2081191ae
commit 9a29f49669
15 changed files with 990 additions and 866 deletions

View File

@@ -1,10 +1,10 @@
import { ConsumeMessage } from "amqplib";
import { Request, Response } from "express"
import { SimNosUsecases } from "./SimNOS.usecases";
import { SimNosUsecases } from "./SimNOS.usecases.js";
import { EventBus } from "sim-shared/domain/EventBus.port.js";
import { Result } from "sim-shared/domain/Result.js";
import { SimEvents } from "sim-shared/domain/SimEvents.js";
import { iccidValidator } from "./httpValidators";
import { iccidValidator } from "./httpValidators.js";
export class SimNosController {
@@ -51,12 +51,12 @@ export class SimNosController {
await this.eventBus.ack(msg)
return result
} else {
console.error("Error general procesando el caso de uso", result.error)
console.error("Error general procesando el caso de uso (NOS)", result.error)
this.eventBus.nack(msg)
return result
}
} catch (e) {
console.error("Error general procesando el caso de uso")
console.error("Error general procesando el caso de uso (NOS)")
this.eventBus.nack(msg)
return {
error: String(e)
@@ -129,13 +129,11 @@ export class SimNosController {
const iccid: string | string[] = body.iccid
console.log("ICCID", iccid)
if (Array.isArray(iccid)) {
// TODO: Automatizar la paginacion
//const usecaseRes = this.uscases.selectMany({ iccid })
} else {
const usecaseRes = await this.uscases.selectOne({ iccid })
console.log(usecaseRes)
if (usecaseRes.error != undefined) {
res.status(500).json(usecaseRes)
return;
@@ -169,8 +167,6 @@ export class SimNosController {
res.status(200).send(usecaseRes.data)
return;
}
res.status(200).json({ ok: "true" })
}
}
}