Fix suspension && paso a plantilla de caso de uso
This commit is contained in:
@@ -51,7 +51,7 @@ export class SimUseCases {
|
||||
operation: string,
|
||||
operationPayload: PAYLOAD,
|
||||
iccid: string
|
||||
onError: (_: any) => void
|
||||
onError?: (_: any) => void
|
||||
// on code response??
|
||||
}): () => Promise<Result<string, boolean>> {
|
||||
return async () => {
|
||||
@@ -79,7 +79,7 @@ export class SimUseCases {
|
||||
if (args.correlation_id != undefined) {
|
||||
this.orderRepository.updateOrder({
|
||||
correlation_id: args.correlation_id!,
|
||||
new_status: "running",
|
||||
new_status: "running", // Siempre es runing la primera vez que se consume
|
||||
})
|
||||
.then(e => console.log("Order actualizado: ", e))
|
||||
.catch(e => console.error("Error actualizando order", args.correlation_id))
|
||||
@@ -220,8 +220,17 @@ export class SimUseCases {
|
||||
}
|
||||
}
|
||||
|
||||
// Metodo nuevo
|
||||
public suspend(suspendData: ActionData): () => Promise<Result<string, boolean>> {
|
||||
const OPERATION_URL = "/actions/suspendLine"
|
||||
return this.generateUseCase({
|
||||
correlation_id: suspendData.correlation_id,
|
||||
operationPayload: suspendData,
|
||||
url: OPERATION_URL,
|
||||
iccid: suspendData.identifier.identifiers,
|
||||
operation: "suspend"
|
||||
})
|
||||
|
||||
return async () => {
|
||||
const req = this.httpClient.client.post(OPERATION_URL, {
|
||||
...suspendData
|
||||
|
||||
Reference in New Issue
Block a user