Bhaskara Kishore 3 years ago
commit b387e6ad12

@ -27,6 +27,9 @@ console.log(req.params);
// console.log("This is the reply in the handler after the validations", reply);
tankersData = {
supplierId:supplierId,
supplier_name:req.body.username,
supplier_address : req.body.supplier_address,
tankerName: req.body.tankerName,
phoneNumber: req.body.phoneNumber,
alternative_phoneNumber: req.body.alternative_phoneNumber,
@ -48,6 +51,8 @@ console.log(req.params);
if (checkFormEncoding.isUserFormUrlEncoded) {
usertobeInserted = checkFormEncoding.tankers;
console.log("thsi true url string");
tankers.supplier_name = usertobeInserted.supplier_name;
tankers.supplier_address = usertobeInserted.supplier_address;
tankers.tankerName = usertobeInserted.tankerName;
tankers.phoneNumber = usertobeInserted.phoneNumber;
tankers.alternative_phoneNumber = usertobeInserted.alternative_phoneNumber;

@ -15,8 +15,10 @@ const tankersSchema = new mongoose.Schema({
tankerName: { type: String, default: null },
phoneNumber: { type: String, default: null },
alternative_phoneNumber: { type: String, default: null },
typeofwater: [{ typeofwater: String}],
capacity: [{ capacity: String}],
typeofwater: { typeofwater: String},
capacity: { capacity: String},
supplier_address: { type: String, default: null },
supplier_name : { type: String, default: null },
});
@ -34,6 +36,10 @@ const tankersbookingSchema = new mongoose.Schema({
price: { type: String, default: "750" },
payment_status : { type: String, default: "due" },
orderStatus: { type: String, default: "pending" },
delivery_agent : { type: String, default: "null" },
delivery_agent_mobile : { type: String, default: "null" },
delivery_agent_alternative_mobile : { type: String, default: "null" },
quantityDelivered: { type: String, default: null},
amount_paid: { type: String, default: null },
amount_due: { type: String, default: null },

@ -26,32 +26,13 @@ module.exports = function (fastify, opts, next) {
body: {
type: "object",
properties: {
supplier_name: { type: "string" },
supplier_address:{ type: "string" },
tankerName: { type: "string" },
phoneNumber: { type: "string"},
alternative_phoneNumber: { type: "string"},
typeofwater: {
type: "array",
maxItems: 2500,
items: {
type: "object",
properties: {
typeofwater: { type: "string", default: null },
},
},
},
capacity: {
type: "array",
maxItems: 2500,
items: {
type: "object",
properties: {
capacity: { type: "string", default: null },
},
},
},
typeofwater: { type: "string"},
capacity: { type: "string"},
},
},

Loading…
Cancel
Save