fcmId added

master
Bhaskara Kishore 3 years ago
parent 3f8db59d33
commit ba7006a2b3

@ -104,7 +104,8 @@ exports.loginDeliveryBoy = async (req) => {
zip: req.body.zip, zip: req.body.zip,
}, },
latitude: req.body.latitude, latitude: req.body.latitude,
longitude: req.body.longitude longitude: req.body.longitude,
fcmId : req.body.fcmId
}; };
var supplier = new Supplier(s_data); var supplier = new Supplier(s_data);
@ -129,6 +130,7 @@ exports.loginDeliveryBoy = async (req) => {
supplier.alternativeContactNumber = suppliertobeInserted.alternativeContactNumber; supplier.alternativeContactNumber = suppliertobeInserted.alternativeContactNumber;
supplier.latitude = suppliertobeInserted.latitude; supplier.latitude = suppliertobeInserted.latitude;
supplier.longitude = suppliertobeInserted.longitude; supplier.longitude = suppliertobeInserted.longitude;
supplier.fcmId = suppliertobeInserted.fcmId
} }
@ -165,7 +167,8 @@ exports.loginDeliveryBoy = async (req) => {
], ],
profile: insertedSupplier.profile, profile: insertedSupplier.profile,
latitude: insertedSupplier.latitude, latitude: insertedSupplier.latitude,
longitude: insertedSupplier.longitude longitude: insertedSupplier.longitude,
fcmId : insertedSupplier.fcmId
}, },
status_code: 200, status_code: 200,
}; };

@ -75,7 +75,7 @@ exports.orderNow = async (req, reply) => {
status:req.body.status, status:req.body.status,
longitude: req.body.longitude, longitude: req.body.longitude,
latitude:req.body.latitude, latitude:req.body.latitude,
fcmId: req.body.fcmId
}; };
var agent_mobile = req.body.phone var agent_mobile = req.body.phone
@ -104,6 +104,7 @@ exports.orderNow = async (req, reply) => {
agent.status = usertobeInserted.status agent.status = usertobeInserted.status
agent.longitude = usertobeInserted.longitude agent.longitude = usertobeInserted.longitude
agent.latitude = usertobeInserted.latitude agent.latitude = usertobeInserted.latitude
agent.fcmId = usertobeInserted.fcmId
} }
} }

@ -193,6 +193,7 @@ exports.addUser = async (req, reply) => {
}, },
longitude: req.body.longitude, longitude: req.body.longitude,
latitude:req.body.latitude, latitude:req.body.latitude,
fcmId: req.body.fcmId
}; };
@ -218,7 +219,7 @@ exports.addUser = async (req, reply) => {
user.customerId = usertobeInserted.customer_id; user.customerId = usertobeInserted.customer_id;
user.latitude = usertobeInserted.latitude; user.latitude = usertobeInserted.latitude;
user.longitude = usertobeInserted.longitude user.longitude = usertobeInserted.longitude
user.fcmId = usertobeInserted.fcmId
} }
console.log("---------checkurl ecnoded string-----------------------"); console.log("---------checkurl ecnoded string-----------------------");
@ -258,6 +259,7 @@ exports.addUser = async (req, reply) => {
profile: insertedUser.profile, profile: insertedUser.profile,
longitude: insertedUser.longitude, longitude: insertedUser.longitude,
latitude:insertedUser.latitude, latitude:insertedUser.latitude,
fcmId: insertedUser.fcmId
}, },
status_code: 200, status_code: 200,
}; };

@ -225,6 +225,7 @@ fastify.post("/api/login", {
latitude: loginObject.user.latitude, latitude: loginObject.user.latitude,
longitude: loginObject.user.longitude, longitude: loginObject.user.longitude,
type: loginObject.user.profile.role, type: loginObject.user.profile.role,
fcmId: loginObject.user.fcmId,
typeasobj: stringToJsonObject, typeasobj: stringToJsonObject,
}, },
}); });

@ -95,6 +95,7 @@ const userSchema = new mongoose.Schema(
latitude: {type: Number}, latitude: {type: Number},
isActive: Boolean, isActive: Boolean,
tenantId: ObjectId, tenantId: ObjectId,
fcmId: { type: String, default: null },
createdAt: { createdAt: {
type: Date, type: Date,
default: function () { default: function () {

@ -67,6 +67,7 @@ const supplierSchema = new mongoose.Schema(
latitude: {type: Number}, latitude: {type: Number},
isActive: Boolean, isActive: Boolean,
tenantId: ObjectId, tenantId: ObjectId,
fcmId: { type: String, default: null },
createdAt: { createdAt: {
type: Date, type: Date,
default: function () { default: function () {
@ -127,6 +128,7 @@ const supplierSchema = new mongoose.Schema(
status: { type: String, default: "Inactive" }, status: { type: String, default: "Inactive" },
longitude: { type : Number}, longitude: { type : Number},
latitude: {type: Number}, latitude: {type: Number},
fcmId: { type: String, default: null },
}); });

@ -87,7 +87,9 @@ module.exports = function (fastify, opts, next) {
zip: { type: "string", default: null }, zip: { type: "string", default: null },
status: { type: "string" }, status: { type: "string" },
latitude: { type: 'number' }, latitude: { type: 'number' },
longitude: { type: 'number'} longitude: { type: 'number'},
fcmId: { type: "string", default: null },
}, },
}, },

@ -279,7 +279,8 @@ module.exports = function (fastify, opts, next) {
zip: { type: "string", default: null }, zip: { type: "string", default: null },
country: { type: "string", default: null }, country: { type: "string", default: null },
latitude: { type: 'number' }, latitude: { type: 'number' },
longitude: { type: 'number'} longitude: { type: 'number'},
fcmId: { type: "string", default: null },
}, },
}, },
security: [ security: [

@ -156,7 +156,8 @@ module.exports = function (fastify, opts, next) {
country: { type: "string", default: null }, country: { type: "string", default: null },
notes: { type: "string", default: null }, notes: { type: "string", default: null },
latitude: { type: 'number' }, latitude: { type: 'number' },
longitude: { type: 'number'} longitude: { type: 'number'},
fcmId: { type: "string", default: null },
}, },
}, },
security: [ security: [

Loading…
Cancel
Save