43 lines
912 B
TypeScript
43 lines
912 B
TypeScript
import { EventBus } from "../../shared/domain/EventBus.port";
|
|
import { SimEvents } from "../../shared/domain/SimEvents";
|
|
|
|
/**
|
|
* TODO:
|
|
* - Conexion con la BDD
|
|
* - Conexion con RabbitMQ
|
|
* - Pasar a clase cuando existan las conexiones
|
|
*/
|
|
export class SimUsecases {
|
|
private eventBus: EventBus
|
|
|
|
constructor(args: {
|
|
eventBus: EventBus
|
|
}
|
|
) {
|
|
this.eventBus = args.eventBus
|
|
}
|
|
|
|
async activation(args: { iccid: string }) {
|
|
const activationEvent = <SimEvents.activation>{
|
|
key: "sim.activation",
|
|
payload: {
|
|
iccid: args.iccid
|
|
}
|
|
}
|
|
|
|
return this.eventBus.publish([activationEvent])
|
|
}
|
|
|
|
cancelation(args: { iccid: string }) {
|
|
throw new Error("Function not implemented.");
|
|
}
|
|
|
|
pause(args: { iccid: string }) {
|
|
throw new Error("Function not implemented.");
|
|
}
|
|
free(args: { iccid: string }) {
|
|
throw new Error("Function not implemented.");
|
|
}
|
|
}
|
|
|