waterlevel sensors

master
varun 1 year ago
parent 3af54baf9e
commit 6306ca9917

@ -14,9 +14,9 @@ exports.options = {
},
// We have to change this beacause this is running on local
// we have to run on this on swagger
//host: "localhost:3000", //Devlopemnt host on lcoal
host: "localhost:3000", //Devlopemnt host on lcoal
host: "35.207.198.4:3000", //Production for swagger
//host: "35.207.198.4:3000", //Production for swagger
schemes: ["http"],
consumes: ["application/json"],
produces: ["application/json"],

@ -500,7 +500,8 @@ exports.addStore = async (request, reply) => {
const moment = require('moment');
exports.createwaterlevelSensor = async (req, reply) => {
try {
const { hardwareId,hardwareId_company, type, indate,storeId } = req.body;
const storeId = req.params.storeId
const { hardwareId,hardwareId_company, type, indate } = req.body;
var mater_seq_id = await generatewaterlevelsensorId();
const date = moment().format('MM-DD');
const prefix = 'AS-' + date + '--MALOV1-';

@ -165,7 +165,7 @@ const installationschema = new mongoose.Schema({
const waterLeverSensorInSchema = new mongoose.Schema({
storeeId:{ type: String },
storeId:{ type: String },
hardwareId: { type: String },
masterId: { type: String, default: null },
type: { type: String },

@ -123,17 +123,27 @@ fastify.post('/api/stores', {
fastify.post("/api/createwaterlevelSensor", {
fastify.post("/api/createwaterlevelSensor/:storeId", {
schema: {
description: "This is for creating waterlevel Sensor",
tags: ["Store-Data"],
summary: "This is for creating waterlevel Sensor",
params: {
required: ["storeId"],
type: "object",
properties: {
storeId: {
type: "string",
description: "storeId",
},
},
},
body: {
type: "object",
properties: {
storeId: { type: "string" },
hardwareId: { type: "string" },
type: { type: "string" },
indate: { type: "string" },

Loading…
Cancel
Save