|
|
|
@ -593,6 +593,81 @@ fastify.post(
|
|
|
|
|
handler: installationController.getMasterSlaveSummary,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fastify.get('/api/master-with-slaves/:installationId/:customerId/:hardwareId', {
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ['Installation'],
|
|
|
|
|
summary: 'Get Individual master device and its connected slaves',
|
|
|
|
|
description: 'Fetch a master device from Insensors by hardwareId and list all connected slave devices for the same customer and installation.',
|
|
|
|
|
params: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
required: ['installationId', 'customerId', 'hardwareId'],
|
|
|
|
|
properties: {
|
|
|
|
|
installationId: { type: 'string', description: 'Installation ID from Order' },
|
|
|
|
|
customerId: { type: 'string', description: 'Customer ID' },
|
|
|
|
|
hardwareId: { type: 'string', description: 'Master hardwareId' },
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// response: {
|
|
|
|
|
// 200: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// properties: {
|
|
|
|
|
// success: { type: 'boolean' },
|
|
|
|
|
// master: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// description: 'Master device details',
|
|
|
|
|
// properties: {
|
|
|
|
|
// _id: { type: 'string' },
|
|
|
|
|
// hardwareId: { type: 'string' },
|
|
|
|
|
// customerId: { type: 'string' },
|
|
|
|
|
// type: { type: 'string' },
|
|
|
|
|
// // Add other master fields as needed...
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// slaves: {
|
|
|
|
|
// type: 'array',
|
|
|
|
|
// description: 'List of connected slave devices',
|
|
|
|
|
// items: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// properties: {
|
|
|
|
|
// _id: { type: 'string' },
|
|
|
|
|
// hardwareId: { type: 'string' },
|
|
|
|
|
// connected_to: { type: 'string' },
|
|
|
|
|
// customerId: { type: 'string' },
|
|
|
|
|
// type: { type: 'string' },
|
|
|
|
|
// // Add other slave fields as needed...
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// 400: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// properties: {
|
|
|
|
|
// success: { type: 'boolean' },
|
|
|
|
|
// message: { type: 'string' }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// 404: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// properties: {
|
|
|
|
|
// success: { type: 'boolean' },
|
|
|
|
|
// message: { type: 'string' }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// 500: {
|
|
|
|
|
// type: 'object',
|
|
|
|
|
// properties: {
|
|
|
|
|
// success: { type: 'boolean' },
|
|
|
|
|
// message: { type: 'string' }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
handler: installationController.getMasterWithSlaves,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/getwaitingmasterlistwithslaves/:customerId", {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "Get waiting manager masrter connected slave data with full info",
|
|
|
|
|