Skip to content

Commit

Permalink
Rating evaluation scores from 1 to 5
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Oct 14, 2024
1 parent de6598d commit cf1fd91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions backend/src/services/TicketServices/UpdateTicketService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ const UpdateTicketService = async ({
setting?.value === "enabled"
) {
if (ticketTraking.ratingAt == null && !justClose) {
const ratingTxt = ratingMessage?.trim() || "";
let bodyRatingMessage = `\u200e${ratingTxt}\n\n`;
bodyRatingMessage +=
"Digite de 1 à 3 para qualificar nosso atendimento:\n*1* - _Insatisfeito_\n*2* - _Satisfeito_\n*3* - _Muito Satisfeito_\n\n";
const ratingTxt =
ratingMessage?.trim() || "Por favor avalie nosso atendimento";
const bodyRatingMessage = `\u200e${ratingTxt}\n\n*Digite uma nota de 1 a 5*\n\nEnvie *\`!\`* para retornar ao atendimento`;

if (ticket.channel === "whatsapp") {
await SendWhatsAppMessage({ body: bodyRatingMessage, ticket });
Expand Down
2 changes: 1 addition & 1 deletion backend/src/services/WbotServices/wbotMessageListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ const handleMessage = async (
`${ticketTracking.ticket.contact.number}@${ticketTracking.ticket.isGroup ? "g.us" : "s.whatsapp.net"
}`,
{
text: "\u200e\n*Por favor avalie nosso atendimento com uma nota de 1 a 3*"
text: "\u200e\n*Por favor avalie nosso atendimento com uma nota de 1 a 5*"
}
);
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Dashboard/TableAttendantsStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function RatingBox ({ rating }) {
const ratingTrunc = rating === null ? 0 : Math.trunc(rating);
return <Rating
defaultValue={ratingTrunc}
max={3}
max={5}
readOnly
/>
}
Expand All @@ -49,7 +49,7 @@ export default function TableAttendantsStatus(props) {
return attendants.map((a, k) => (
<TableRow key={k}>
<TableCell>{a.name}</TableCell>
<TableCell align="center" title="1 - Insatisfeito, 2 - Satisfeito, 3 - Muito Satisfeito" className={classes.pointer}>
<TableCell align="center" className={classes.pointer}>
<RatingBox rating={a.rating} />
</TableCell>
<TableCell align="center">{a.tickets}</TableCell>
Expand Down

0 comments on commit cf1fd91

Please sign in to comment.