|
|
|
@ -10,6 +10,7 @@ const libphonenumberjs = require("libphonenumber-js");
|
|
|
|
|
// offers http-friendly error objects.
|
|
|
|
|
const boom = require("boom");
|
|
|
|
|
const { Tankerbooking} = require("../models/tankers")
|
|
|
|
|
const {EstimationOrder} = require("../models/store");
|
|
|
|
|
|
|
|
|
|
// Get Data Models
|
|
|
|
|
const { RequestedBooking,Supplier, generateSupplierId, FriendRequest,DeliveryBoy} = require("../models/supplier")
|
|
|
|
@ -1500,4 +1501,20 @@ exports.getallsuppliers = async (req, reply) => {
|
|
|
|
|
} catch (err) {
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.estimationsget = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
// Find the specific tank
|
|
|
|
|
const estimations = await EstimationOrder.find({customerId:req.params.customerId
|
|
|
|
|
});
|
|
|
|
|
if (!estimations) {
|
|
|
|
|
return reply.send({ status_code: 404, error: "estimations not found" });
|
|
|
|
|
}
|
|
|
|
|
// Send the found tank within a list
|
|
|
|
|
reply.send({ status_code: 200, data: [estimations] });
|
|
|
|
|
} catch (err) {
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
}
|
|
|
|
|
};
|