expectedDateOfOrder and description fields are added

master
Bhaskara Kishore 2 years ago
parent 7da21af9c8
commit f18d21d0ad

@ -91,6 +91,7 @@ exports.loginDeliveryBoy = async (req) => {
emails: req.body.emails, emails: req.body.emails,
password: req.body.password, password: req.body.password,
phone: req.body.phone, phone: req.body.phone,
description: req.body.description,
profile: { profile: {
firstName: req.body.firstName, firstName: req.body.firstName,
lastName: req.body.lastName, lastName: req.body.lastName,
@ -131,7 +132,7 @@ exports.loginDeliveryBoy = async (req) => {
supplier.latitude = suppliertobeInserted.latitude; supplier.latitude = suppliertobeInserted.latitude;
supplier.longitude = suppliertobeInserted.longitude; supplier.longitude = suppliertobeInserted.longitude;
supplier.fcmId = suppliertobeInserted.fcmId supplier.fcmId = suppliertobeInserted.fcmId
supplier.description = suppliertobeInserted.description
} }
console.log("---------checkurl ecnoded string-----------------------"); console.log("---------checkurl ecnoded string-----------------------");
@ -168,7 +169,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 fcmId : insertedSupplier.fcmId,
description : insertedSupplier.description
}, },
status_code: 200, status_code: 200,
}; };
@ -198,6 +200,8 @@ exports.loginDeliveryBoy = async (req) => {
if (updateData.country) supplierInfo.profile.country = updateData.country; if (updateData.country) supplierInfo.profile.country = updateData.country;
if (updateData.zip) supplierInfo.profile.zip = updateData.zip; if (updateData.zip) supplierInfo.profile.zip = updateData.zip;
if (updateData.phone) supplierInfo.phone = updateData.phone; if (updateData.phone) supplierInfo.phone = updateData.phone;
if (updateData.description) supplierInfo.description = updateData.description;
if (updateData.emails) supplierInfo.emails = updateData.emails; if (updateData.emails) supplierInfo.emails = updateData.emails;
console.log(supplierInfo.emails[0].email) console.log(supplierInfo.emails[0].email)
if (updateData.role) supplierInfo.profile.role = updateData.role; if (updateData.role) supplierInfo.profile.role = updateData.role;

@ -20,7 +20,7 @@ exports.orderNow = async (req, reply) => {
const booking_info = await Tankerbooking.findOne({ bookingid: bookingId}) const booking_info = await Tankerbooking.findOne({ bookingid: bookingId})
const action = req.body.action const action = req.body.action
const typeofwater = req.body.typeofwater const typeofwater = req.body.typeofwater
const expectedDateOfDelivery = req.body.expectedDateOfDelivery;
if(action === "accept"){ if(action === "accept"){
const price = req.body.price const price = req.body.price
@ -39,6 +39,7 @@ exports.orderNow = async (req, reply) => {
booking_info.orderStatus = "rejected" booking_info.orderStatus = "rejected"
} }
booking_info.expectedDateOfDelivery = expectedDateOfDelivery;
const booking = await booking_info.save(); const booking = await booking_info.save();
return booking; return booking;

@ -194,6 +194,7 @@ exports.loginSupplier = async (request, reply) => {
latitude: loginObject.supplier.latitude, latitude: loginObject.supplier.latitude,
longitude: loginObject.supplier.longitude, longitude: loginObject.supplier.longitude,
type: loginObject.supplier.profile.role, type: loginObject.supplier.profile.role,
description : loginObject.supplier.description,
typeasobj: stringToJsonObject, typeasobj: stringToJsonObject,
}, },
}); });
@ -214,6 +215,7 @@ exports.loginSupplier = async (request, reply) => {
oneTimePasswordSetFlag: loginObject.supplier.oneTimePasswordSetFlag, oneTimePasswordSetFlag: loginObject.supplier.oneTimePasswordSetFlag,
latitude: loginObject.supplier.latitude, latitude: loginObject.supplier.latitude,
longitude: loginObject.supplier.longitude, longitude: loginObject.supplier.longitude,
description : loginObject.supplier.description,
type: loginObject.supplier.profile.role, type: loginObject.supplier.profile.role,
typeasobj: stringToJsonObject, typeasobj: stringToJsonObject,
}, },

@ -30,7 +30,7 @@ const supplierSchema = new mongoose.Schema(
oneTimePasswordSetFlag: { type: Boolean, default: false }, oneTimePasswordSetFlag: { type: Boolean, default: false },
emails: [{ email: String, verified: { type: Boolean, default: false } }], emails: [{ email: String, verified: { type: Boolean, default: false } }],
services: { password: { bcrypt: String } }, services: { password: { bcrypt: String } },
description: {type : String, default: null},
profile: { profile: {
role: [{ type: String, default: "supplier" }], role: [{ type: String, default: "supplier" }],
firstName: { type: String, default: null }, firstName: { type: String, default: null },

@ -38,6 +38,7 @@ const tankersbookingSchema = new mongoose.Schema({
bookingid: { type: String, default: null,unique: true }, bookingid: { type: String, default: null,unique: true },
supplierId:{type: String, default: null}, supplierId:{type: String, default: null},
dateOfOrder: { type: String, default: null }, dateOfOrder: { type: String, default: null },
expectedDateOfDelivery: { type: String, default: null },
date: { type: String, default: null }, date: { type: String, default: null },
time: { type: String, default: null }, time: { type: String, default: null },
typeofwater: { type: String, default: null }, typeofwater: { type: String, default: null },

@ -38,7 +38,7 @@ module.exports = function (fastify, opts, next) {
delivery_agent :{type:"string"}, delivery_agent :{type:"string"},
agent_mobile :{type:"string"}, agent_mobile :{type:"string"},
agent_alternative_mobile :{type:"string"}, agent_alternative_mobile :{type:"string"},
expectedDateOfDelivery : { type: "string"},
}, },
}, },

@ -281,6 +281,8 @@ module.exports = function (fastify, opts, next) {
latitude: { type: 'number', default: 0.0}, latitude: { type: 'number', default: 0.0},
longitude: { type: 'number', default: 0.0}, longitude: { type: 'number', default: 0.0},
fcmId: { type: "string", default: null }, fcmId: { type: "string", default: null },
description: { type: "string", default: null },
}, },
}, },
security: [ security: [
@ -522,6 +524,8 @@ module.exports = function (fastify, opts, next) {
state: { type: "string" }, state: { type: "string" },
country: { type: "string" }, country: { type: "string" },
zip: { type: "string" }, zip: { type: "string" },
description: { type: "string" },
}, },
}, },
security: [ security: [

Loading…
Cancel
Save