Planning

Error messages – Planning

Errores de validación

Los siguientes mensajes de error pueden aparecer debido a parámetros omitidos o introducidos incorrectamente. El código de error devuelto por la API será 400 (Bad Request) y el JSON devuelto tendrá la siguiente estructura:

{
    "logId": "5e8f64f0-0ece-4e26-84c3-7ff889eff092",
    "message": "Validation failed",
    "errors": [
        "sites may not be empty",
        "operations[0].customerSite reference not found",
        "operations[1].customerSite reference not found"
    ]
}

La siguiente tabla muestra las validaciones aplicadas a cada entidad y el mensaje de error devuelto:

ParámetroValidacionesMensajes de error
sitesnotEmptymay not be empty
depotsnotEmptymay not be empty
operationsnotEmptymay not be empty
vehicleTypesnotEmptymay not be empty
vehiclesnotEmptymay not be empty
productsnotEmptymay not be empty
legislationProfilesnotEmptymay not be empty
logisticConstraintsnotEmptymay not be empty
optimizationProfilenotBlankis mandatory
optimizationProfileinvalid profileoptimizationProfile {name} not found
tripsProfilenotBlankis mandatory
startDatenotNullis mandatory
Tabla de reglas de validación para entidades principales

Las siguientes tablas muestran las validaciones aplicadas para cada entidad específica:

operations
ParámetroValidacionesMensajes de error
idnotBlank, uniqueis mandatory, already exists
weightnotNull, notNegativeis mandatory, may not be negative
volumenotNull, notNegativeis mandatory, may not be negative
productnotBlank, validReferenceis mandatory, reference not found
typenotBlank, isContainedInis mandatory, does not have a valid value. Allowed values: [COLLECTION, DELIVERY]
prioritynotNegativemay not be negative
depotSitenotBlank, validReferenceis mandatory, reference not found
customerSitenotBlank, validReferenceis mandatory, reference not found
customerTimeWindowsnotEmptymay not be empty
Tabla de reglas de validación para el parámetro operations
vehicles
ParámetroValidacionesMensajes de error
namenotBlank, uniqueis mandatory, already exists
vehicleTypenotBlank, validReferenceis mandatory, reference not found
legislationProfilenotBlank, validReferenceis mandatory, reference not found
availablePeriodsnotEmptymay not be empty
prioritynotNegativemay not be negative
Tabla de reglas de validación para el parámetro vehicle
vehicleTypes
ParámetroValidacionesMensajes de error
namenotNull, uniqueis mandatory, already exists
maxWeightnotNull, notNegativeis mandatory, may not be negative
maxVolumenotNull, notNegativeis mandatory, may not be negative
sizenotNegativemay not be negative
maxSitesNumbernotNegativemay not be negative
compartmentsAccessModenotNull, isContainedInis mandatory, does not have a valid value. Allowed values: [ALL_COMPARTMENTS, REAR_ACCESS]
trip.calculationModenotNullis mandatory
trip.toll.vehicleTypenotNullis mandatory
Tabla de reglas de validación para el parámetro vehicleTypes
sites y depots
ParámetroValidacionesMensajes de error
namenotBlank, uniqueis mandatory, already exists
coordinatesnotNullis mandatory
coordinates.latitudenotNull, range(-90, 90)is mandatory, must be between -90 and 90
coordinates.longitudenotNull, range(-180, 180)is mandatory, must be between -180 and 180
logisticConstraintsnotBlank, validReferenceis mandatory, reference not found
Tabla de reglas de validación para el parámetros sites y depots
legislationProfile
ParámetroValidacionesMensajes de error
namenotBlank, uniqueis mandatory, already exists
maxContinuousDrivingTimegreaterThanZeromust be greater than zero
drivingPauseDurationgreaterThanZeromust be greater than zero
maxContinuousWorkingTimegreaterThanZeromust be greater than zero
workingPauseDurationgreaterThanZeromust be greater than zero
Tabla de reglas de validación para el parámetro legislationProfile
callback
ParámetroValidacionesMensajes de error
urlnotNullis mandatory
urlInvalid urldoes not have a valid value. Example of allowed values: http://www.foo.br, https://www.foo.br, http://www.foo.br/bar
Tabla de reglas de validación para el parámetro callback

Las validaciones a continuación se aplican a las ventanas de tiempo descritas en los parámetros vehicles[n].availablePeriodsoperations[n].customerTimeWindows y operations[n].depotTimeWindows:

timeWindow
ParámetroValidacionesMensajes de error
startnotNullis mandatory
endnotNullis mandatory
start, endstart < endmust have the start less than to the end
start, endstart != endmust not start the same as the end
endend < startDatemust have at least one timeWindow with end after problem’s startDate
Tabla de reglas de validación para parámetros relacionados con la ventana de tiempo.

Errores de procesamiento

Los siguientes mensajes de error pueden aparecer al consultar el estado del procesamiento de la solicitud a través de los endpints https://api.maplink.global/planning/v1/events?jobId={{planningId}} y https://api.maplink.global/planning/v1/jobs/{{planningId}}.

El mensaje de error sigue la siguiente estructura:

{
        "id": "688d267a74be5d22a1ac9002",
        "jobId": "688d26787766ef668397ff50",
        "type": "ERROR",
        "description": "{'logId':'db496388-c45a-4902-af42-0971578cbb38','errors':[{'code':'TECHNICAL_ERROR','description':'global.maplink.matrixinprocessor.exception.ProcessException: [ProcessError(code=INVALID_SITE_POSITION, description=Some sites have not been positionned, detail=[Cliente1])]'}]}",
        "createdAt": 1754080890262
    }

El evento retorna con el type igual a ERROR y se pueden devolver los siguientes mensajes en la description:

Mensaje de errorCausa
{‘logId’:’{{logId}}‘,’errors’:
[{‘code’:’TECHNICAL_ERROR’,’description’:’Not possible to create route between sites {{siteId}} and {{siteId}}‘}]}
No se pudo encontrar una ruta entre los dos puntos. El punto podría estar mal ubicado o no existir ninguna ruta, como un punto en una calle sin salida de un solo sentido.
Error in process MRS: Cannot find point {{latitude}},{{longitude}}No se pudo encontrar la ubicación de las coordenadas proporcionadas. Algunas coordenadas podrían no ser válidas, por ejemplo, al caer al océano.
Tabla de mensajes de error de procesamiento

Ejemplo de una ruta con un mensaje de error:

[
    {
        "id": "688d29735e59ee6e88b67adb",
        "jobId": "688d29737766ef668397ff52",
        "type": "STATUS_CHANGE",
        "description": "ENQUEUED",
        "createdAt": 1754081651310
    },
    {
        "id": "688d297374be5d22a1ac900b",
        "jobId": "688d29737766ef668397ff52",
        "type": "STATUS_CHANGE",
        "description": "CONVERT_TO_MATRIX",
        "createdAt": 1754081651314
    },
    {
        "id": "688d29735e59ee6e88b67adc",
        "jobId": "688d29737766ef668397ff52",
        "type": "PERCENT_CHANGE",
        "description": "1",
        "createdAt": 1754081651317
    },
    {
        "id": "688d297308fc0e441d9e9d23",
        "jobId": "688d29737766ef668397ff52",
        "type": "STATUS_CHANGE",
        "description": "PROCESSING",
        "createdAt": 1754081651339
    },
    {
        "id": "688d29745e59ee6e88b67add",
        "jobId": "688d29737766ef668397ff52",
        "type": "ERROR",
        "description": "{'logId':'e687f91b-e4ce-4cbf-b6c5-8e304e281617','errors':[{'code':'TECHNICAL_ERROR','description':Not possible to create route between sites OP-1 and OP-2'}]},
        "createdAt": 1754081652037
    }
]