|
|
@ -1300,6 +1300,7 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
quatationId,
|
|
|
|
quatationId,
|
|
|
|
customerId: customerId,
|
|
|
|
customerId: customerId,
|
|
|
|
installationId: installationId,
|
|
|
|
installationId: installationId,
|
|
|
|
|
|
|
|
quote_status:"sentfrominstaller",
|
|
|
|
masters,
|
|
|
|
masters,
|
|
|
|
slaves,
|
|
|
|
slaves,
|
|
|
|
sensors,
|
|
|
|
sensors,
|
|
|
@ -1498,4 +1499,30 @@ exports.addToCartService = async (req, reply) => {
|
|
|
|
console.error(error);
|
|
|
|
console.error(error);
|
|
|
|
reply.code(500).send({ message: 'Error adding item to cart', error });
|
|
|
|
reply.code(500).send({ message: 'Error adding item to cart', error });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getquotationofinstalleranduser = async (req, reply) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const installationId = req.params.installationId;
|
|
|
|
|
|
|
|
const customerId = req.body.customerId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Find the specific tank
|
|
|
|
|
|
|
|
const result = await SensorQuotation.find({
|
|
|
|
|
|
|
|
installationId: installationId,
|
|
|
|
|
|
|
|
customerId: customerId,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!result) {
|
|
|
|
|
|
|
|
return reply.send({ status_code: 404, error: "not found" });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reply.send({ status_code: 200, data: result });
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|