Merge pull request 'hotfix kmMax' (!2003) from hotfix-kmMax into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2003
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-02-07 10:31:20 +00:00
commit fe1ccf98e6
2 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@
"Claim state has changed to": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *{{newState}}*", "Claim state has changed to": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *{{newState}}*",
"Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}", "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
"ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto", "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000", "Distance must be lesser than 4000": "La distancia debe ser inferior a 4000",
"This ticket is deleted": "Este ticket está eliminado", "This ticket is deleted": "Este ticket está eliminado",
"Unable to clone this travel": "No ha sido posible clonar este travel", "Unable to clone this travel": "No ha sido posible clonar este travel",
"This thermograph id already exists": "La id del termógrafo ya existe", "This thermograph id already exists": "La id del termógrafo ya existe",

View File

@ -21,16 +21,16 @@ module.exports = Self => {
require('../methods/route/getByWorker')(Self); require('../methods/route/getByWorker')(Self);
Self.validate('kmStart', validateDistance, { Self.validate('kmStart', validateDistance, {
message: 'Distance must be lesser than 1000' message: 'Distance must be lesser than 4000'
}); });
Self.validate('kmEnd', validateDistance, { Self.validate('kmEnd', validateDistance, {
message: 'Distance must be lesser than 1000' message: 'Distance must be lesser than 4000'
}); });
function validateDistance(err) { function validateDistance(err) {
const routeTotalKm = this.kmEnd - this.kmStart; const routeTotalKm = this.kmEnd - this.kmStart;
const routeMaxKm = 1000; const routeMaxKm = 4000;
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd) if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err(); err();
} }