2019-03-22 10:10:23 +00:00
|
|
|
module.exports = Self => {
|
2019-04-25 06:28:08 +00:00
|
|
|
require('../methods/route/filter')(Self);
|
2019-03-22 10:10:23 +00:00
|
|
|
require('../methods/route/summary')(Self);
|
2019-03-25 12:16:34 +00:00
|
|
|
require('../methods/route/getTickets')(Self);
|
2019-04-04 11:06:41 +00:00
|
|
|
require('../methods/route/guessPriority')(Self);
|
2019-06-05 11:51:34 +00:00
|
|
|
require('../methods/route/updateVolume')(Self);
|
2019-12-10 11:42:14 +00:00
|
|
|
require('../methods/route/getDeliveryPoint')(Self);
|
2020-12-21 13:48:47 +00:00
|
|
|
require('../methods/route/insertTicket')(Self);
|
2020-12-24 10:31:20 +00:00
|
|
|
require('../methods/route/clone')(Self);
|
2021-03-15 10:32:17 +00:00
|
|
|
require('../methods/route/getSuggestedTickets')(Self);
|
2022-02-23 15:12:29 +00:00
|
|
|
require('../methods/route/unlink')(Self);
|
2022-07-05 08:19:06 +00:00
|
|
|
require('../methods/route/updateWorkCenter')(Self);
|
2022-09-26 06:07:45 +00:00
|
|
|
require('../methods/route/driverRoutePdf')(Self);
|
|
|
|
require('../methods/route/driverRouteEmail')(Self);
|
2022-10-20 13:04:25 +00:00
|
|
|
require('../methods/route/sendSms')(Self);
|
2023-01-17 13:06:18 +00:00
|
|
|
require('../methods/route/downloadZip')(Self);
|
2023-08-02 05:35:40 +00:00
|
|
|
require('../methods/route/cmr')(Self);
|
2023-08-08 12:16:47 +00:00
|
|
|
require('../methods/route/getExternalCmrs')(Self);
|
2023-09-01 10:10:39 +00:00
|
|
|
require('../methods/route/downloadCmrsZip')(Self);
|
2024-01-23 13:13:40 +00:00
|
|
|
require('../methods/route/cmrEmail')(Self);
|
2023-11-15 09:09:04 +00:00
|
|
|
require('../methods/route/getExpeditionSummary')(Self);
|
2023-11-22 14:54:38 +00:00
|
|
|
require('../methods/route/getByWorker')(Self);
|
2020-02-18 11:51:29 +00:00
|
|
|
|
|
|
|
Self.validate('kmStart', validateDistance, {
|
2024-02-07 10:27:18 +00:00
|
|
|
message: 'Distance must be lesser than 4000'
|
2020-02-18 11:51:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Self.validate('kmEnd', validateDistance, {
|
2024-02-07 10:27:18 +00:00
|
|
|
message: 'Distance must be lesser than 4000'
|
2020-02-18 11:51:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function validateDistance(err) {
|
|
|
|
const routeTotalKm = this.kmEnd - this.kmStart;
|
2024-02-07 10:27:18 +00:00
|
|
|
const routeMaxKm = 4000;
|
2020-11-20 11:12:06 +00:00
|
|
|
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
|
2020-02-18 11:51:29 +00:00
|
|
|
err();
|
2023-11-15 09:09:04 +00:00
|
|
|
}
|
2019-03-22 10:10:23 +00:00
|
|
|
};
|