get quotations

master
Varun 9 months ago
parent b90735fbbf
commit c09359177f

@ -1300,6 +1300,7 @@ exports.createquotationforSensor = async (req, reply) => {
quatationId,
customerId: customerId,
installationId: installationId,
quote_status:"sentfrominstaller",
masters,
slaves,
sensors,
@ -1498,4 +1499,30 @@ exports.addToCartService = async (req, reply) => {
console.error(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);
}
};

@ -1178,6 +1178,40 @@ fastify.post("/api/createquotationforSensor/:installationId", {
});
fastify.post("/api/getquotationofinstalleranduser/:installationId", {
schema: {
tags: ["Install"],
description: "This is to Get Quotations for installer and particular user",
summary: "This is to Get Quotations for installer and particular user",
params: {
required: ["installationId"],
type: "object",
properties: {
installationId: {
type: "string",
description: "installationId",
},
},
},
body: {
type: "object",
properties: {
customerId: { type: "string" },
},
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: storeController.getquotationofinstalleranduser,
});
fastify.get("/api/getallquotationdata", {

Loading…
Cancel
Save