ashok 3 months ago
commit dcec276b77

@ -8883,6 +8883,7 @@ exports.assignCategorizeIssue = async (request, reply) => {
}
const assignedAt = moment().format("DD-MM-YYYY HH:mm:ss");
const assignmentCode = Math.floor(100000 + Math.random() * 900000).toString(); // random 6-digit code
let assignedCount = 0;
support.categorizedIssues.forEach(issue => {
@ -8895,7 +8896,8 @@ exports.assignCategorizeIssue = async (request, reply) => {
support_teamMemberId: teamMember.support_teamMemberId,
phone: teamMember.phone,
email: teamMember.email,
assignedAt: assignedAt
assignedAt: assignedAt,
assignmentCode: assignmentCode // ← Add this field
};
assignedCount++;
}
@ -8909,12 +8911,13 @@ exports.assignCategorizeIssue = async (request, reply) => {
return reply.send({
message: `Assigned ${assignedCount} categorized issue(s) to ${teamMember.name}`,
assignmentCode: assignmentCode, // ← Return the code in response
assignedTo: {
support_teamMemberId: teamMember.support_teamMemberId,
name: teamMember.name,
phone: teamMember.phone,
email: teamMember.email,
assignedAt: assignedAt
assignedAt: assignedAt,
}
});
};

@ -283,7 +283,8 @@ const installationschema = new mongoose.Schema({
email: String,
startDate: String,
endDate: String,
assignedAt: String
assignedAt: String,
assignmentCode: String
}
});

Loading…
Cancel
Save