Order para pause, activate y terminate
This commit is contained in:
@@ -111,7 +111,7 @@ export class SimUsecases {
|
||||
const activationWithId = this.addMessage_id(activationEvent)
|
||||
console.log("[d] Activation ", activationWithId)
|
||||
await this.eventBus.publish([activationWithId])
|
||||
this.saveOrder(activationWithId)
|
||||
await this.saveOrder(activationWithId)
|
||||
}
|
||||
|
||||
async preActivation(args: { iccid: string, compañia: string }) {
|
||||
@@ -131,14 +131,18 @@ export class SimUsecases {
|
||||
*/
|
||||
async cancelation(args: { iccid: string, compañia: string }) {
|
||||
|
||||
const activationEvent = <SimEvents.cancel>{
|
||||
const cancelationEvent = <SimEvents.cancel>{
|
||||
key: `sim.${args.compañia}.cancel`,
|
||||
payload: {
|
||||
iccid: args.iccid
|
||||
}
|
||||
}
|
||||
console.log("[d] Cancelation ", activationEvent)
|
||||
return this.eventBus.publish([activationEvent])
|
||||
|
||||
const cancelationWithId = this.addMessage_id(cancelationEvent)
|
||||
console.log("[d] Cancelation ", cancelationWithId)
|
||||
await this.eventBus.publish([cancelationWithId])
|
||||
await this.saveOrder(cancelationWithId)
|
||||
return cancelationWithId
|
||||
}
|
||||
// alias por si acaso
|
||||
public terminate = this.cancelation;
|
||||
@@ -147,15 +151,18 @@ export class SimUsecases {
|
||||
* alias de bloquear / suspender en objenious
|
||||
*/
|
||||
async pause(args: { iccid: string, compañia: string }) {
|
||||
const cancelationEvent = <SimEvents.pause>{
|
||||
const pauseEvent = <SimEvents.pause>{
|
||||
key: `sim.${args.compañia}.pause`,
|
||||
payload: {
|
||||
iccid: args.iccid
|
||||
}
|
||||
}
|
||||
|
||||
return this.eventBus.publish([cancelationEvent])
|
||||
const pauseWithId = this.addMessage_id(pauseEvent)
|
||||
await this.eventBus.publish([pauseWithId])
|
||||
await this.saveOrder(pauseWithId)
|
||||
return pauseWithId
|
||||
}
|
||||
|
||||
async free(args: { iccid: string, compañia: string }) {
|
||||
const cancelationEvent = <SimEvents.free>{
|
||||
key: `sim.${args.compañia}.free`,
|
||||
|
||||
Reference in New Issue
Block a user