|
|
|
@ -797,8 +797,7 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
// required: ['phone'],
|
|
|
|
|
properties: {
|
|
|
|
|
motor_id: { type: "string", default: null },
|
|
|
|
|
auto_min_percentage: { type: "string", default: null },
|
|
|
|
|
auto_max_percentage: { type: "string", default: null },
|
|
|
|
|
|
|
|
|
|
auto_mode: { type: "string", default: null },
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -818,6 +817,50 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: "PUT",
|
|
|
|
|
url: "/api/update_auto_percentage/:customerId",
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ["Tank"],
|
|
|
|
|
summary: "This is for changing auto mode for motor with min and max levels",
|
|
|
|
|
params: {
|
|
|
|
|
required: ["customerId"],
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
customerId: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "customerId",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
// required: ['phone'],
|
|
|
|
|
properties: {
|
|
|
|
|
tankName: { type: "string", default: null },
|
|
|
|
|
auto_min_percentage: { type: "string", default: null },
|
|
|
|
|
auto_max_percentage: { type: "string", default: null },
|
|
|
|
|
tankLocation: { type: "string", default: null },
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
security: [
|
|
|
|
|
{
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// preHandler: [
|
|
|
|
|
// fastify.auth([fastify.operatorAuthenticate]),
|
|
|
|
|
// validationHandler.validatePhoneFormat,
|
|
|
|
|
// ],
|
|
|
|
|
//preHandler: fastify.auth([fastify.authenticate]),
|
|
|
|
|
handler: tanksController.update_auto_percentage,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|