Merge branch 'main' into WEBINT-338_tiempo_suspension
This commit is contained in:
@@ -15,7 +15,7 @@ params:query {
|
||||
}
|
||||
|
||||
body:form-urlencoded {
|
||||
iccid: 8935103196306448300
|
||||
iccid: 8933201125065160331
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"setup:runtime": "mkdir -p dist/packages/node_modules && ln -sf ../sim-shared dist/packages/node_modules/sim-shared && ln -sf ../sf-consumidor-objenious dist/packages/node_modules/sim-consumidor-objenious",
|
||||
"start": "yarn setup:runtime && yarn workspaces foreach -Apiv run start",
|
||||
"typecheck": "npx tsc --noEmit",
|
||||
"dev": "yarn workspaces foreach -Apiv --exclude sim-objenious-cron run dev",
|
||||
"dev": "yarn workspaces foreach -Apiv run dev",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"format": "prettier --write .",
|
||||
|
||||
@@ -321,13 +321,14 @@ export class SimUseCases {
|
||||
}
|
||||
|
||||
// TODO REGISTRAR EL ORDER
|
||||
/*
|
||||
if (correlation_id != undefined) {
|
||||
await this.orderRepository.createOrder({
|
||||
correlation_id: correlation_id,
|
||||
order_type: "pause"
|
||||
})
|
||||
}
|
||||
|
||||
*/
|
||||
let activationDate;
|
||||
try {
|
||||
activationDate = await this.findActivationDate(suspendData)
|
||||
|
||||
@@ -62,7 +62,7 @@ async function startCron() {
|
||||
orderRepository
|
||||
)
|
||||
|
||||
await objTask.getPendingOperations()
|
||||
//await objTask.getPendingOperations()
|
||||
const PERIODO_PETICIONES = 10 * 60 * 1000
|
||||
const interval = setInterval(async () => {
|
||||
try {
|
||||
|
||||
@@ -37,6 +37,11 @@ export class CheckObjeniousRequests {
|
||||
// Todas las validas
|
||||
const operacionesValidas = pendingOperations.data
|
||||
.filter((e) => e.request_id != undefined)
|
||||
.filter((e) => e.operation != "terminate" && e.operation != "suspend")
|
||||
|
||||
// Filtrar suspension / terminacion
|
||||
|
||||
|
||||
// Validas sin MassId
|
||||
const solicitarMassId = operacionesValidas
|
||||
.filter((e) => e.mass_action_id == undefined)
|
||||
|
||||
@@ -66,6 +66,7 @@ export class PauseTerminateTask {
|
||||
}
|
||||
|
||||
while (!lines.done) {
|
||||
lines = await lineGenerator.next()
|
||||
if (lines.value.error != undefined || lines.value.data == undefined) {
|
||||
logger.error("Error cargando las lineas", lines.value.error)
|
||||
finError(lines.value.error)
|
||||
@@ -74,7 +75,6 @@ export class PauseTerminateTask {
|
||||
lineasActualizadas.push(...lines.value.data)
|
||||
}
|
||||
|
||||
lines = await lineGenerator.next()
|
||||
}
|
||||
|
||||
console.log("Cargado: ", lineasActualizadas)
|
||||
@@ -126,6 +126,7 @@ export class PauseTerminateTask {
|
||||
switch (operacionTipo) {
|
||||
case "suspend":
|
||||
result = await this.simUsecases.suspend(actionData)()
|
||||
console.log("SUSPENDED", result)
|
||||
break;
|
||||
case "terminate":
|
||||
result = await this.simUsecases.terminate(actionData)()
|
||||
|
||||
Reference in New Issue
Block a user