diff --git a/src/routes/storeRoute.js b/src/routes/storeRoute.js index f525781d..b5700d01 100644 --- a/src/routes/storeRoute.js +++ b/src/routes/storeRoute.js @@ -154,11 +154,12 @@ fastify.post("/api/createwaterlevelSensor/:storeId", { handler: storeController.createwaterlevelSensor, }) -fastify.post("/api/installwaterlevelSensor/:storeId", { + +fastify.get("/api/getHardware/:storeId", { schema: { - description: "This is for installing waterlevel Sensor", tags: ["Store-Data"], - summary: "This is for installing waterlevel Sensor", + description: "This is to Get Waterlevel sensor Data", + summary: "This is to Get Waterlevel sensor Data", params: { required: ["storeId"], type: "object", @@ -169,21 +170,15 @@ fastify.post("/api/installwaterlevelSensor/:storeId", { }, }, }, - - body: { - type: "object", - - properties: { - - hardwareId: { type: "string" }, - dateofinstallation: { type: "string" }, - customerId: { type: "string" }, - installedby: { type: "string" } + security: [ + { + basicAuth: [], }, - }, + ], }, - handler: storeController.installwaterlevelSensor, -}) + // preHandler: fastify.auth([fastify.authenticate]), + handler: storeController.getHardware, +}); fastify.post("/api/qccheckwaterlevelSensor/:hardwareId", { schema: { @@ -217,55 +212,27 @@ fastify.post("/api/qccheckwaterlevelSensor/:hardwareId", { handler: storeController.qccheckwaterlevelSensor, }) -fastify.post("/api/qccheckwaterlevelslaveSensor/:storeId", { + +fastify.put("/api/getHardwareqc/:storeId", { schema: { - description: "This is for checking waterlevel Sensor slaves", tags: ["Store-Data"], - summary: "This is for checking waterlevel Sensor slaves", + description: "This is to Get Quality Check Details Of Waterlevel Sensor", + summary: "This is to Get Quality Details Of Waterlevel Sensor", params: { required: ["storeId"], type: "object", properties: { storeId: { type: "string", - description: "Store ID", + description: "storeId", }, - }, }, body: { type: "object", properties: { hardwareId: { type: "string" }, - tankhardwareId: { type: "string" }, - qccheck: { type: "string" }, - qccheckdate: { type: "string" }, - qcby: { type: "string" }, - comment: { type: "string" }, - outforrepairdate: { type: "string" }, - sendto: { type: "string" }, - repairfeedback: { type: "string" }, - }, - }, - }, - handler: storeController.qccheckwaterlevelSensorSlave, -}); - - - -fastify.get("/api/getHardware/:storeId", { - schema: { - tags: ["Store-Data"], - description: "This is to Get Hardware Data", - summary: "This is to Get Hardware Data", - params: { - required: ["storeId"], - type: "object", - properties: { - storeId: { - type: "string", - description: "storeId", - }, + }, }, security: [ @@ -275,14 +242,15 @@ fastify.get("/api/getHardware/:storeId", { ], }, // preHandler: fastify.auth([fastify.authenticate]), - handler: storeController.getHardware, + handler: storeController.getHardwareqc, }); -fastify.put("/api/getHardwareqc/:storeId", { + +fastify.post("/api/installwaterlevelSensor/:storeId", { schema: { + description: "This is for installing waterlevel Sensor", tags: ["Store-Data"], - description: "This is to Get Quality Check Hardware Data", - summary: "This is to Get Quality Check Hardware Data", + summary: "This is for installing waterlevel Sensor", params: { required: ["storeId"], type: "object", @@ -293,29 +261,28 @@ fastify.put("/api/getHardwareqc/:storeId", { }, }, }, + body: { type: "object", + properties: { + hardwareId: { type: "string" }, - + dateofinstallation: { type: "string" }, + customerId: { type: "string" }, + installedby: { type: "string" } }, }, - security: [ - { - basicAuth: [], - }, - ], }, - // preHandler: fastify.auth([fastify.authenticate]), - handler: storeController.getHardwareqc, -}); + handler: storeController.installwaterlevelSensor, +}) fastify.post("/api/addSlave/:hardwareId", { schema: { - description: "This is for adding a slave to the water level sensor", + description: "This is for adding slaves to waterlevel Sensor(Slave)", tags: ["Store-Data"], - summary: "Add a slave to the water level sensor", + summary: "This is for adding slaves to waterlevel Sensor(Slave)", params: { required: ["hardwareId"], type: "object", @@ -340,11 +307,12 @@ fastify.post("/api/addSlave/:hardwareId", { }); -fastify.post("/api/installwaterlevelSensorSlave/:storeId", { + +fastify.post("/api/qccheckwaterlevelslaveSensor/:storeId", { schema: { - description: "This is for installing waterlevel Sensor Slaves", + description: "This is for checking slaves (Slave)", tags: ["Store-Data"], - summary: "This is for installing waterlevel Sensor Slaves", + summary: "This is for checking slaves (Slave)", params: { required: ["storeId"], type: "object", @@ -353,28 +321,34 @@ fastify.post("/api/installwaterlevelSensorSlave/:storeId", { type: "string", description: "Store ID", }, + }, }, body: { type: "object", properties: { hardwareId: { type: "string" }, - tankhardwareId: { type: "string" }, // Add tankhardwareId in body - dateofinstallation: { type: "string" }, - customerId: { type: "string" }, - installedby: { type: "string" } + tankhardwareId: { type: "string" }, + qccheck: { type: "string" }, + qccheckdate: { type: "string" }, + qcby: { type: "string" }, + comment: { type: "string" }, + outforrepairdate: { type: "string" }, + sendto: { type: "string" }, + repairfeedback: { type: "string" }, }, }, }, - handler: storeController.installwaterlevelSensorSlave, + handler: storeController.qccheckwaterlevelSensorSlave, }); + fastify.put("/api/getHardwareqcslave/:storeId", { schema: { tags: ["Store-Data"], - description: "This is to Get Quality Check Hardware Data Slave", - summary: "This is to Get Quality Check Hardware Data slave", + description: "This is to Get Quality Check Data Of Slave (Slave)", + summary: "This is to Get Quality Check Data Of Slave (Slave)", params: { required: ["storeId"], type: "object", @@ -402,6 +376,39 @@ fastify.put("/api/getHardwareqcslave/:storeId", { }); + +fastify.post("/api/installwaterlevelSensorSlave/:storeId", { + schema: { + description: "This is for installing Slaves (Slave)", + tags: ["Store-Data"], + summary: "This is for installing Slaves (Slave)", + params: { + required: ["storeId"], + type: "object", + properties: { + storeId: { + type: "string", + description: "Store ID", + }, + }, + }, + body: { + type: "object", + properties: { + hardwareId: { type: "string" }, + tankhardwareId: { type: "string" }, // Add tankhardwareId in body + dateofinstallation: { type: "string" }, + customerId: { type: "string" }, + installedby: { type: "string" } + }, + }, + }, + handler: storeController.installwaterlevelSensorSlave, +}); + + + + fastify.post("/api/createmotorswitchSensor/:storeId", { schema: { description: "This is for creating motor switch", @@ -434,11 +441,38 @@ fastify.post("/api/createmotorswitchSensor/:storeId", { }) +fastify.get("/api/getHardwaremotorswitch/:storeId", { + schema: { + tags: ["Store-Data"], + description: "This is to Get Motor Switches", + summary: "This is to Get Motor Switches", + params: { + required: ["storeId"], + type: "object", + properties: { + storeId: { + type: "string", + description: "storeId", + }, + }, + }, + security: [ + { + basicAuth: [], + }, + ], + }, + // preHandler: fastify.auth([fastify.authenticate]), + handler: storeController.getHardwaremotorswitch, +}); + + + fastify.post("/api/qccheckpumpswitch/:motorId", { schema: { - description: "This is for checking motor switch", + description: "This is for checking Motor Switch", tags: ["Store-Data"], - summary: "This is for checking motor switch", + summary: "This is for checking Motor Switch", params: { required: ["motorId"], type: "object", @@ -467,30 +501,6 @@ fastify.post("/api/qccheckpumpswitch/:motorId", { }) -fastify.get("/api/getHardwaremotorswitch/:storeId", { - schema: { - tags: ["Store-Data"], - description: "This is to Get Motor Switches", - summary: "This is to Get Motor Switches", - params: { - required: ["storeId"], - type: "object", - properties: { - storeId: { - type: "string", - description: "storeId", - }, - }, - }, - security: [ - { - basicAuth: [], - }, - ], - }, - // preHandler: fastify.auth([fastify.authenticate]), - handler: storeController.getHardwaremotorswitch, -}); fastify.post("/api/installmotorswitch/:storeId", { schema: {