|
|
|
@ -18,7 +18,7 @@ exports.addTankers = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
//const username = req.params.username;
|
|
|
|
|
|
|
|
|
|
console.log(req.params);
|
|
|
|
|
console.log(req.params);
|
|
|
|
|
const supplierId = req.params.supplierId;
|
|
|
|
|
//console.log(loginObject.user.username)
|
|
|
|
|
// const userInfo = await User.findOne({ username: username.toString() });
|
|
|
|
@ -200,7 +200,8 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
capacity: req.body.capacity,
|
|
|
|
|
address: req.body.address,
|
|
|
|
|
dateOfOrder: req.body.dateOfOrder,
|
|
|
|
|
price:req.body.price
|
|
|
|
|
price:req.body.price,
|
|
|
|
|
supplierId:req.body.supplierId
|
|
|
|
|
//date: req.body.date,
|
|
|
|
|
// time: req.body.time,
|
|
|
|
|
|
|
|
|
@ -219,6 +220,8 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
tankersBookingData.typeofwater = usertobeInserted.typeofwater;
|
|
|
|
|
tankersBookingData.address = usertobeInserted.address;
|
|
|
|
|
tankersBookingData.dateOfOrder = usertobeInserted.dateOfOrder;
|
|
|
|
|
tankersBookingData.price = usertobeInserted.price;
|
|
|
|
|
tankersBookingData.supplierId = usertobeInserted.supplierId;
|
|
|
|
|
//tankersBookingData.date = usertobeInserted.date;
|
|
|
|
|
//tankersBookingData.time = usertobeInserted.time;
|
|
|
|
|
|
|
|
|
@ -300,36 +303,30 @@ exports.getTankersBookingdetails = async (req, reply) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getAllTankersBookingdetails = async (req, reply) => {
|
|
|
|
|
const limit = parseInt(req.query.limit) || 100;
|
|
|
|
|
const page = parseInt(req.query.page) || 1;
|
|
|
|
|
const startindex = (page - 1) * limit;
|
|
|
|
|
const supplierId = req.params.supplierId
|
|
|
|
|
try {
|
|
|
|
|
const supplierId = req.params.customerId
|
|
|
|
|
// const tankerName = req.query.tankerName
|
|
|
|
|
|
|
|
|
|
await Tankerbooking.find({ supplierId:supplierId })
|
|
|
|
|
await Tankerbooking.find( { supplierId:supplierId })
|
|
|
|
|
.limit(limit)
|
|
|
|
|
.skip(startindex)
|
|
|
|
|
.exec()
|
|
|
|
|
.then((docs) => {
|
|
|
|
|
reply.send({ status_code: 200, data: docs, count: docs.length });
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err);
|
|
|
|
|
reply.send({ error: err });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.addBores = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|