Bug preactivacion si id de operacion
This commit is contained in:
@@ -15,7 +15,9 @@ params:query {
|
||||
}
|
||||
|
||||
body:form-urlencoded {
|
||||
iccid: 8933201125065160380
|
||||
iccid: 8934909001500954922
|
||||
offer: mensual
|
||||
orderId: test
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -84,12 +84,14 @@ export class SimAlaiController {
|
||||
|
||||
public preactivate() {
|
||||
return async (msg: ConsumeMessage) => {
|
||||
console.log("[i] Evento activate ", msg.fields)
|
||||
const data = this.validateMsg(msg) as SimEvents.activation
|
||||
console.log("[i] Evento preactivate ", msg)
|
||||
const data = this.validateMsg(msg) as SimEvents.preActivation
|
||||
const iccid = data.payload.iccid
|
||||
const correlation_id = data.headers?.message_id
|
||||
const externalId = data.payload.orderId
|
||||
|
||||
console.log("MSG:", data, data.headers)
|
||||
|
||||
const res = await this.tryUseCase(msg, this.uscases.preactivate({
|
||||
iccid: iccid,
|
||||
correlation_id: correlation_id,
|
||||
@@ -133,7 +135,7 @@ export class SimAlaiController {
|
||||
|
||||
public terminate() {
|
||||
return async (msg: ConsumeMessage) => {
|
||||
console.log("Evento reActivate ", msg.fields)
|
||||
console.log("Evento reActivate ", msg.fields, msg)
|
||||
const data = this.validateMsg(msg) as SimEvents.reActivation
|
||||
const iccid = data.payload.iccid
|
||||
const correlation_id = data.headers?.message_id
|
||||
|
||||
@@ -24,7 +24,7 @@ export class SimAlaiRouter {
|
||||
["pause", this.simController.suspend()],
|
||||
["reactivate", this.simController.reActivate()],
|
||||
["cancel", this.simController.terminate()],
|
||||
["preActivate", this.simController.preactivate()]
|
||||
["preactivate", this.simController.preactivate()]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class SimRouter {
|
||||
["pause", this.simController.suspend()],
|
||||
["cancel", this.simController.terminate()],
|
||||
["reactivate", this.simController.reActivate()],
|
||||
["preActivate", this.simController.preActivate()]
|
||||
["preactivate", this.simController.preActivate()]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ export class SimUseCases {
|
||||
console.log("Sim preactivada con exito", resp.data)
|
||||
const operation: ObjeniousOperation = {
|
||||
correlation_id: preActivateData.correlation_id,
|
||||
operation: "preActivate",
|
||||
operation: "preactivate",
|
||||
iccids: String(preActivateData.identifier.identifiers),
|
||||
status: "noMassID",
|
||||
request_id: resp.data.requestId
|
||||
|
||||
@@ -164,15 +164,16 @@ export class SimUsecases {
|
||||
Promise<Result<string, { iccid: string, message_id: string, operation: "preactivation" }>> {
|
||||
|
||||
const preActivationEvent = <SimEvents.preActivation>{
|
||||
key: `sim.${args.compañia}.preActivate`,
|
||||
key: `sim.${args.compañia}.preactivate`,
|
||||
payload: {
|
||||
iccid: args.iccid
|
||||
}
|
||||
}
|
||||
console.log("[d] Pre - activation ", preActivationEvent)
|
||||
await this.eventBus.publish([preActivationEvent])
|
||||
const preactivationWithId = this.addMessage_id(preActivationEvent)
|
||||
const createdOrder = await this.saveOrder<SimEvents.preActivation>(preactivationWithId)
|
||||
|
||||
const preActivationWithId = this.addMessage_id(preActivationEvent)
|
||||
console.log("[d] Pre - activation ", preActivationWithId)
|
||||
await this.eventBus.publish([preActivationWithId])
|
||||
const createdOrder = await this.saveOrder<SimEvents.preActivation>(preActivationWithId)
|
||||
if (createdOrder.error != undefined) {
|
||||
console.error(createdOrder.error)
|
||||
return {
|
||||
|
||||
@@ -18,9 +18,10 @@ export namespace SimEvents {
|
||||
}
|
||||
|
||||
export type preActivation = DomainEvent & {
|
||||
key: `sim.${string}.preActivate`,
|
||||
key: `sim.${string}.preactivate`,
|
||||
payload: {
|
||||
iccid: string
|
||||
iccid: string,
|
||||
orderId?: string // Solo Alai
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user