|
|
|
@ -886,6 +886,93 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
handler: installationController.assignCategorizeIssue
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: 'POST',
|
|
|
|
|
url: '/api/updateHarwareList/:supportId/:customerId/:hardwareId',
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ['Support'],
|
|
|
|
|
summary: 'Update hardware list for an escalated issue',
|
|
|
|
|
description: 'Updates the hardwareList in Insensors schema only if issue is categorized as Escalation',
|
|
|
|
|
params: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
required: ['supportId', 'customerId', 'hardwareId'],
|
|
|
|
|
properties: {
|
|
|
|
|
supportId: { type: 'string', description: 'Support record ID' },
|
|
|
|
|
customerId: { type: 'string', description: 'Customer ID' },
|
|
|
|
|
hardwareId: { type: 'string', description: 'Hardware ID of the master/slave' }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
body: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
required: ['hardwareList'],
|
|
|
|
|
properties: {
|
|
|
|
|
hardwareList: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
description: 'Hardware summary object (e.g. { masters: 2, slaves: 2 })',
|
|
|
|
|
additionalProperties: { type: 'number' },
|
|
|
|
|
example: {
|
|
|
|
|
masters: 2,
|
|
|
|
|
slaves: 2,
|
|
|
|
|
sensors: 4,
|
|
|
|
|
plugs: 3,
|
|
|
|
|
wires: 200
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
response: {
|
|
|
|
|
200: {
|
|
|
|
|
description: 'Successfully updated hardwareList',
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
status_code: { type: 'number' },
|
|
|
|
|
message: { type: 'string' },
|
|
|
|
|
data: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
supportId: { type: 'string' },
|
|
|
|
|
customerId: { type: 'string' },
|
|
|
|
|
hardwareId: { type: 'string' },
|
|
|
|
|
hardwareList: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
additionalProperties: { type: 'number' }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
400: {
|
|
|
|
|
description: 'Missing or invalid input',
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
error: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
403: {
|
|
|
|
|
description: 'Not allowed (issue is not escalated)',
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
error: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
404: {
|
|
|
|
|
description: 'Support or sensor not found',
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
error: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
500: {
|
|
|
|
|
description: 'Internal server error',
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
error: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handler: installationController.updateHardwareList
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fastify.post("/api/my-categorized-issues/:support_teamMemberId/:customerId", {
|
|
|
|
|
schema: {
|
|
|
|
|