From b096ddce3ac49ea23ec982abdebd996539774ea0 Mon Sep 17 00:00:00 2001 From: varun Date: Thu, 9 Feb 2023 07:02:40 -0500 Subject: [PATCH] added capacity in bores and pipelines --- src/controllers/tankersController.js | 8 ++++++-- src/models/tankers.js | 3 +++ src/routes/tankersRoute.js | 11 ++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/controllers/tankersController.js b/src/controllers/tankersController.js index 6215417c..1f00f7e3 100644 --- a/src/controllers/tankersController.js +++ b/src/controllers/tankersController.js @@ -180,6 +180,7 @@ exports.addBores = async (req, reply) => { boresData = { customerId:customerId, boreName: req.body.boreName, + capacity: req.body.capacity, typeofwater: req.body.typeofwater, description: req.body.description, }; @@ -199,7 +200,8 @@ exports.addBores = async (req, reply) => { usertobeInserted = checkFormEncoding.bores; console.log("thsi true url string"); bores.customerId = usertobeInserted.customerId - bores.boreName = usertobeInserted.boreName; + bores.boreName = usertobeInserted.boreName; + bores.capacity = usertobeInserted.capacity; bores.typeofwater = usertobeInserted.typeofwater; bores.description = usertobeInserted.description; } @@ -278,6 +280,7 @@ exports.addGovtPIpeline = async (req, reply) => { pipelineData = { customerId:customerId, Name: req.body.Name, + capacity: req.body.capacity, typeofwater: req.body.typeofwater, description: req.body.description, }; @@ -297,7 +300,8 @@ exports.addGovtPIpeline = async (req, reply) => { usertobeInserted = checkFormEncoding.pipe_line; console.log("thsi true url string"); pipe_line.customerId = usertobeInserted.customerId - pipe_line.Name = usertobeInserted.Name; + pipe_line.Name = usertobeInserted.Name; + pipe_line.capacity = usertobeInserted.capacity; pipe_line.typeofwater = usertobeInserted.typeofwater; pipe_line.description = usertobeInserted.description; } diff --git a/src/models/tankers.js b/src/models/tankers.js index 7a995566..fe748815 100644 --- a/src/models/tankers.js +++ b/src/models/tankers.js @@ -38,7 +38,9 @@ const tankersbookingSchema = new mongoose.Schema({ const boreSchema = new mongoose.Schema({ customerId: { type: String, default: null }, + boreName: { type: String, default: null }, + capacity: { type: String, default: null }, typeofwater: { type: String, default: null }, description: { type: String, default: null }, @@ -48,6 +50,7 @@ const boreSchema = new mongoose.Schema({ const GovtPipeLineSchema = new mongoose.Schema({ customerId: { type: String, default: null }, Name: { type: String, default: null }, + capacity: { type: String, default: null }, typeofwater: { type: String, default: null }, description: { type: String, default: null }, diff --git a/src/routes/tankersRoute.js b/src/routes/tankersRoute.js index 20c46847..57aee207 100644 --- a/src/routes/tankersRoute.js +++ b/src/routes/tankersRoute.js @@ -227,6 +227,7 @@ module.exports = function (fastify, opts, next) { type: "object", properties: { boreName: { type: "string" }, + capacity: { type: "string" }, typeofwater: { type: "string" }, description: { type: "string" }, }, @@ -321,6 +322,7 @@ module.exports = function (fastify, opts, next) { properties: { boreName: { type: "string" }, + capacity: { type: "string" }, typeofwater: { type: "string" }, description: { type: "string" }, }, @@ -363,6 +365,7 @@ module.exports = function (fastify, opts, next) { type: "object", properties: { Name: { type: "string" }, + capacity: { type: "string" }, typeofwater: { type: "string" }, description: { type: "string" }, }, @@ -457,6 +460,7 @@ module.exports = function (fastify, opts, next) { properties: { Name: { type: "string" }, + capacity: { type: "string" }, typeofwater: { type: "string" }, description: { type: "string" }, }, @@ -477,13 +481,6 @@ module.exports = function (fastify, opts, next) { - - - - - - - next(); }