ashok 1 year ago
commit af36698c79

@ -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