|
|
|
@ -103,7 +103,8 @@ exports.deleteTankerInfo = async (req, reply) => {
|
|
|
|
|
exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var customerId = req.params.customerId;
|
|
|
|
|
const customerId = req.params.customerId;
|
|
|
|
|
const tankerName = req.body.tankerName;
|
|
|
|
|
var b_id = await generateBookingId()
|
|
|
|
|
const date = new Date()
|
|
|
|
|
const year = date.getFullYear()
|
|
|
|
@ -118,6 +119,7 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
bookingsData = {
|
|
|
|
|
tankerName:tankerName,
|
|
|
|
|
customerId:customerId,
|
|
|
|
|
bookingid : bookingId,
|
|
|
|
|
typeofwater: req.body.typeofwater,
|
|
|
|
@ -134,6 +136,7 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
usertobeInserted = checkFormEncoding.tankersBookingData;
|
|
|
|
|
console.log("thsi true url string");
|
|
|
|
|
tankersBookingData.customerId = customerId;
|
|
|
|
|
tankersBookingData.tankerName = tankerName;
|
|
|
|
|
tankersBookingData.bookingid = bookingId;
|
|
|
|
|
tankersBookingData.capacity = usertobeInserted.capacity;
|
|
|
|
|
tankersBookingData.typeofwater = usertobeInserted.typeofwater;
|
|
|
|
@ -144,6 +147,7 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const booking_data = await tankersBookingData.save();
|
|
|
|
|
reply.send({ status_code: 200, data: booking_data });
|
|
|
|
|
|
|
|
|
|
return booking_data;
|
|
|
|
|
|
|
|
|
|