|
|
@ -5345,6 +5345,7 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
const { supportId } = request.params;
|
|
|
|
const { supportId } = request.params;
|
|
|
|
const { support_teamMemberId, startDate, endDate, category, masterHardwareId } = request.body;
|
|
|
|
const { support_teamMemberId, startDate, endDate, category, masterHardwareId } = request.body;
|
|
|
@ -5371,10 +5372,13 @@ exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
return reply.code(400).send({ error: 'Invalid startDate or endDate' });
|
|
|
|
return reply.code(400).send({ error: 'Invalid startDate or endDate' });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ✅ Format to "DD-MM-YYYY HH:mm:ss"
|
|
|
|
|
|
|
|
const formattedStart = moment(start).format("DD-MM-YYYY HH:mm:ss");
|
|
|
|
|
|
|
|
const formattedEnd = moment(end).format("DD-MM-YYYY HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
let assignedCount = 0;
|
|
|
|
let assignedCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
support.categorizedIssues.forEach(issue => {
|
|
|
|
support.categorizedIssues.forEach(issue => {
|
|
|
|
const issueDate = new Date(issue.movedAt);
|
|
|
|
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
issue.masterHardwareId === masterHardwareId &&
|
|
|
|
issue.masterHardwareId === masterHardwareId &&
|
|
|
|
issue.category === category
|
|
|
|
issue.category === category
|
|
|
@ -5384,8 +5388,8 @@ exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
support_teamMemberId: teamMember.support_teamMemberId,
|
|
|
|
support_teamMemberId: teamMember.support_teamMemberId,
|
|
|
|
phone: teamMember.phone,
|
|
|
|
phone: teamMember.phone,
|
|
|
|
email: teamMember.email,
|
|
|
|
email: teamMember.email,
|
|
|
|
startDate: startDate, // Add startDate
|
|
|
|
startDate: formattedStart, // 👈 use formatted date
|
|
|
|
endDate: endDate // Add endDate
|
|
|
|
endDate: formattedEnd // 👈 use formatted date
|
|
|
|
};
|
|
|
|
};
|
|
|
|
assignedCount++;
|
|
|
|
assignedCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|