|
|
|
@ -1600,7 +1600,8 @@ exports.editQuotationForSensor = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
exports.createEstimationPrice = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
const { items } = req.body;
|
|
|
|
|
const { customerId,items } = req.body;
|
|
|
|
|
const user = await User.findOne({ customerId });
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(items) || items.length === 0) {
|
|
|
|
|
return reply.code(400).send({ message: "Items array is required and cannot be empty" });
|
|
|
|
@ -1642,7 +1643,8 @@ exports.createEstimationPrice = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
return reply.code(200).send({
|
|
|
|
|
items: itemDetails,
|
|
|
|
|
estimatedTotal: totalEstimation
|
|
|
|
|
estimatedTotal: totalEstimation,
|
|
|
|
|
userDetails: user || null // Include user details in the response
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|