|
|
|
@ -1158,6 +1158,30 @@ fastify.post('/api/generateHardwareMasterId/:storeId', {
|
|
|
|
|
handler: storeController.generateHardwareMasterId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.post('/api/getSensorByHardwareId/:storeId', {
|
|
|
|
|
schema: {
|
|
|
|
|
description: 'Fetch details of a specific sensor using hardwareId',
|
|
|
|
|
tags: ['Store-Data'],
|
|
|
|
|
summary: 'Retrieve sensor details by hardwareId',
|
|
|
|
|
params: {
|
|
|
|
|
required: ['storeId'],
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
storeId: { type: 'string', description: 'Store ID' },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
body: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
required: ['hardwareId'],
|
|
|
|
|
properties: {
|
|
|
|
|
hardwareId: { type: 'string', description: 'Hardware ID of the sensor' },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
handler: storeController.getSensorByHardwareId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fastify.post("/api/updateSensorById/:_id", {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "Edit specific sensor fields",
|
|
|
|
@ -1189,30 +1213,75 @@ fastify.post("/api/updateSensorById/:_id", {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.post("/api/updateSensorQC/:_id", {
|
|
|
|
|
fastify.post('/api/updateSensorQC/:_id', {
|
|
|
|
|
schema: {
|
|
|
|
|
description: "Edit specific sensor QC fields",
|
|
|
|
|
tags: ["Store-Data"],
|
|
|
|
|
summary: "Update QC fields of a sensor",
|
|
|
|
|
description: 'Edit specific sensor QC fields',
|
|
|
|
|
tags: ['Store-Data'],
|
|
|
|
|
summary: 'Update QC fields of a sensor',
|
|
|
|
|
params: {
|
|
|
|
|
required: ["_id"],
|
|
|
|
|
type: "object",
|
|
|
|
|
required: ['_id'],
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
_id: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "Sensor ID",
|
|
|
|
|
},
|
|
|
|
|
_id: { type: 'string', description: 'Sensor ID' },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
qccheck: { type: "string", description: "QC check status" },
|
|
|
|
|
qcby: { type: "string", description: "QC checked by" },
|
|
|
|
|
comments: { type: "string", description: "QC comment" },
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
qccheck: { type: 'string', description: 'QC check status' },
|
|
|
|
|
qcby: { type: 'string', description: 'QC checked by' },
|
|
|
|
|
comments: { type: 'string', description: 'QC comment' },
|
|
|
|
|
quality_check_details: {
|
|
|
|
|
type: 'array',
|
|
|
|
|
description: 'Detailed quality check results',
|
|
|
|
|
items: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
damage_check: { type: 'string' },
|
|
|
|
|
stickering_check: { type: 'string' },
|
|
|
|
|
power_check: { type: 'string' },
|
|
|
|
|
master_connecting_gsm: { type: 'string' },
|
|
|
|
|
slave_connecting: { type: 'string' },
|
|
|
|
|
motor_starting: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
result: { type: 'string' },
|
|
|
|
|
steps: {
|
|
|
|
|
type: 'array',
|
|
|
|
|
items: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
step: { type: 'number' },
|
|
|
|
|
result: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
connecting_to_sensor: { type: 'string' },
|
|
|
|
|
connecting_to_slave: { type: 'string' },
|
|
|
|
|
data_sending: { type: 'string' },
|
|
|
|
|
distance_check: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
result: { type: 'string' },
|
|
|
|
|
steps: {
|
|
|
|
|
type: 'array',
|
|
|
|
|
items: {
|
|
|
|
|
type: 'object',
|
|
|
|
|
properties: {
|
|
|
|
|
step: { type: 'number' },
|
|
|
|
|
result: { type: 'string' }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handler: storeController.updateSensorQC,
|
|
|
|
|
});
|
|
|
|
|