From 792e511641f746252294094659e370f08efb9cb4 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Tue, 12 Aug 2025 13:55:39 +0530 Subject: [PATCH] googleLocation added in branch --- src/controllers/departmentController.js | 14 ++++++++++++-- src/models/Department.js | 6 ++++++ src/routes/departmentRoute.js | 8 ++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/controllers/departmentController.js b/src/controllers/departmentController.js index 854df14f..ecdc7b57 100644 --- a/src/controllers/departmentController.js +++ b/src/controllers/departmentController.js @@ -79,7 +79,9 @@ const generateDepartmentId = async (city, departmentName) => { updatedBy, email, gstNo, - googleLocation + googleLocation, + latitude, + longitude } = request.body; // Generate unique cityId @@ -118,6 +120,8 @@ const generateDepartmentId = async (city, departmentName) => { email, gstNo, googleLocation, + latitude, + longitude, createdBy, updatedBy, }); @@ -148,7 +152,10 @@ const generateDepartmentId = async (city, departmentName) => { createdBy, updatedBy, email, - nameoftheContactPerson + nameoftheContactPerson, + googleLocation, + latitude, + longitude } = request.body; // Generate departmentId based on departmentName @@ -178,6 +185,9 @@ const generateDepartmentId = async (city, departmentName) => { pincode, email, nameoftheContactPerson, + googleLocation, + latitude, + longitude, // departmentName, createdBy, updatedBy, diff --git a/src/models/Department.js b/src/models/Department.js index 3d03196e..acb6bd81 100644 --- a/src/models/Department.js +++ b/src/models/Department.js @@ -15,6 +15,8 @@ const citySchema = new mongoose.Schema( address2: String, pincode: { type: String }, zone: { type: String }, + longitude: { type: Number, default: 0.0 }, + latitude: { type: Number, default: 0.0 }, googleLocation: { type: String }, gstNo: { type: String }, city: { type: String }, @@ -54,6 +56,10 @@ const citySchema = new mongoose.Schema( zone: { type: String , default: "ALL"}, city: { type: String }, location: [{ type : String}], + googleLocation: { type: String }, + longitude: { type: Number, default: 0.0 }, + latitude: { type: Number, default: 0.0 }, + googleLocation: { type: String }, state: String, country: String, nameoftheContactPerson: String, diff --git a/src/routes/departmentRoute.js b/src/routes/departmentRoute.js index 2c5017b6..ad141010 100644 --- a/src/routes/departmentRoute.js +++ b/src/routes/departmentRoute.js @@ -28,7 +28,8 @@ module.exports = function (fastify, opts, next) { pincode: { type: "string" }, googleLocation: { type: "string" }, gstNo: { type: "string" }, - + latitude: { type: 'number', default: 0.0 }, + longitude: { type: 'number', default: 0.0 }, //departmentName: { type: "string" }, }, }, @@ -567,7 +568,10 @@ module.exports = function (fastify, opts, next) { address2: { type: "string" }, zone: { type: "string" }, pincode: { type: "string" }, - nameoftheContactPerson: { type: "string"} + nameoftheContactPerson: { type: "string"}, + googleLocation: { type: "string" }, + latitude: { type: 'number', default: 0.0 }, + longitude: { type: 'number', default: 0.0 }, //departmentName: { type: "string" }, }, },