|
|
|
@ -619,7 +619,7 @@ exports.getAllOrderaccepted = async (req, reply) => {
|
|
|
|
|
const customerId = req.params.customerId;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const orders = await Tankerbooking.find({ customerId: customerId, orderStatus: "accepted" })
|
|
|
|
|
const orders = await Tankerbooking.find({ customerId: customerId, orderStatus: "pending" })
|
|
|
|
|
.limit(limit)
|
|
|
|
|
.skip(startindex)
|
|
|
|
|
.exec();
|
|
|
|
@ -666,9 +666,10 @@ exports.getAllOrderreject = async (req, reply) => {
|
|
|
|
|
const limit = parseInt(req.query.limit) || 100;
|
|
|
|
|
const page = parseInt(req.query.page) || 1;
|
|
|
|
|
const startindex = (page - 1) * limit;
|
|
|
|
|
const customerId = req.params.customerId
|
|
|
|
|
//const customerId = req.params.customerId
|
|
|
|
|
try {
|
|
|
|
|
await Tankerbooking.find({ orderStatus: ["rejected"]})
|
|
|
|
|
await Tankerbooking.find({ customerId: customerId,orderStatus: ["rejected"]})
|
|
|
|
|
.limit(limit)
|
|
|
|
|
.skip(startindex)
|
|
|
|
|
.exec()
|
|
|
|
@ -680,6 +681,46 @@ exports.getAllOrderreject = async (req, reply) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getAllOrdersoutfordelivery = async (req, reply) => {
|
|
|
|
|
const limit = parseInt(req.query.limit) || 100;
|
|
|
|
|
const page = parseInt(req.query.page) || 1;
|
|
|
|
|
const startindex = (page - 1) * limit;
|
|
|
|
|
const customerId = req.params.customerId
|
|
|
|
|
//const customerId = req.params.customerId
|
|
|
|
|
try {
|
|
|
|
|
await Tankerbooking.find({ customerId: customerId,orderStatus: ["out_for_delivery"]})
|
|
|
|
|
.limit(limit)
|
|
|
|
|
.skip(startindex)
|
|
|
|
|
.exec()
|
|
|
|
|
.then((docs) => {
|
|
|
|
|
reply.send({ status_code: 200, data: docs, count: docs.length });
|
|
|
|
|
})
|
|
|
|
|
} catch (err) {
|
|
|
|
|
reply.status(400).send({ message: err.message });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.getAllOrdersdeliveryboyasigned = async (req, reply) => {
|
|
|
|
|
const limit = parseInt(req.query.limit) || 100;
|
|
|
|
|
const page = parseInt(req.query.page) || 1;
|
|
|
|
|
const startindex = (page - 1) * limit;
|
|
|
|
|
const customerId = req.params.customerId
|
|
|
|
|
//const customerId = req.params.customerId
|
|
|
|
|
try {
|
|
|
|
|
await Tankerbooking.find({ customerId: customerId,orderStatus: ["delivery_boy_assigned"]})
|
|
|
|
|
.limit(limit)
|
|
|
|
|
.skip(startindex)
|
|
|
|
|
.exec()
|
|
|
|
|
.then((docs) => {
|
|
|
|
|
reply.send({ status_code: 200, data: docs, count: docs.length });
|
|
|
|
|
})
|
|
|
|
|
} catch (err) {
|
|
|
|
|
reply.status(400).send({ message: err.message });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getCustomerOrderreject = async (req, reply) => {
|
|
|
|
|
const limit = parseInt(req.query.limit) || 100;
|
|
|
|
|
const page = parseInt(req.query.page) || 1;
|
|
|
|
|