|
|
|
@ -2236,6 +2236,7 @@ exports.acceptQuotation = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
// Find the quotation by ID
|
|
|
|
|
const quotation = await SensorQuotation.findOne({ quatationId: quotationId });
|
|
|
|
|
console.log(quotation,"quotation")
|
|
|
|
|
|
|
|
|
|
if (!quotation) {
|
|
|
|
|
return reply.status(404).send({ error: "Quotation not found" });
|
|
|
|
@ -2250,6 +2251,7 @@ exports.acceptQuotation = async (req, reply) => {
|
|
|
|
|
});
|
|
|
|
|
} else if (action === "accept") {
|
|
|
|
|
const { customerId, masters, slaves, sensors, master_connections } = quotation;
|
|
|
|
|
console.log(customerId,masters,slaves,sensors,master_connections)
|
|
|
|
|
|
|
|
|
|
// Convert quotation to an order object and include storeId
|
|
|
|
|
const newOrder = new Order({
|
|
|
|
|