diff --git a/src/services/command.ts b/src/services/command.ts index f628c55..f7382d8 100644 --- a/src/services/command.ts +++ b/src/services/command.ts @@ -206,14 +206,14 @@ export class CommandService { if (items.length === 0) { return [{ recipient: context.sender, - message: `No hay tareas sin dueño en ${groupName}.` + message: `No hay tareas sin responsable en ${groupName}.` }]; } const rendered = items.map((t) => { const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${ICONS.unassigned} sin dueño`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${ICONS.unassigned} sin responsable`; }); const total = TaskService.countGroupUnassigned(context.groupId); @@ -223,7 +223,7 @@ export class CommandService { return [{ recipient: context.sender, - message: [`${groupName} — Sin dueño`, ...rendered].join('\n') + message: [`${groupName} — Sin responsable`, ...rendered].join('\n') }]; } @@ -258,11 +258,11 @@ export class CommandService { ); const owner = (t.assignees?.length || 0) === 0 - ? `${ICONS.unassigned} sin dueño` + ? `${ICONS.unassigned} sin responsable` : `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`; const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${owner}`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${owner}`; })); sections.push(...rendered); } @@ -283,11 +283,11 @@ export class CommandService { const groupName = GroupSyncService.activeGroupsCache.get(context.groupId) || context.groupId; const unassigned = TaskService.listGroupUnassigned(context.groupId, LIMIT); if (unassigned.length > 0) { - sections.push(`${groupName} — Sin dueño`); + sections.push(`${groupName} — Sin responsable`); const renderedUnassigned = unassigned.map((t) => { const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${ICONS.unassigned} sin dueño`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${ICONS.unassigned} sin responsable`; }); sections.push(...renderedUnassigned); @@ -296,12 +296,12 @@ export class CommandService { sections.push(`… y ${totalUnassigned - unassigned.length} más`); } } else { - sections.push(`${groupName} — Sin dueño\n(no hay tareas sin dueño)`); + sections.push(`${groupName} — Sin responsable\n(no hay tareas sin responsable)`); } } } else { // En DM: nota instructiva - sections.push('ℹ️ Para ver tareas sin dueño de un grupo, usa “/t ver sin” desde ese grupo.'); + sections.push('ℹ️ Para ver tareas sin responsable de un grupo, usa “/t ver sin” desde ese grupo.'); } return [{ @@ -340,11 +340,11 @@ export class CommandService { ); const owner = (t.assignees?.length || 0) === 0 - ? `${ICONS.unassigned} sin dueño` + ? `${ICONS.unassigned} sin responsable` : `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`; const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${owner}`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${owner}`; })); const total = TaskService.countGroupPending(context.groupId); @@ -391,11 +391,11 @@ export class CommandService { ); const owner = (t.assignees?.length || 0) === 0 - ? `${ICONS.unassigned} sin dueño` + ? `${ICONS.unassigned} sin responsable` : `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`; const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${owner}`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${owner}`; })); sections.push(...rendered); } @@ -434,14 +434,14 @@ export class CommandService { const due = res.task?.due_date ? ` — 📅 ${formatDDMM(res.task?.due_date)}` : ''; return [{ recipient: context.sender, - message: `ℹ️ ${id} ya estaba completada — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `ℹ️ ${id} ya estaba completada — _${res.task?.description || '(sin descripción)'}_${due}` }]; } const due = res.task?.due_date ? ` — 📅 ${formatDDMM(res.task?.due_date)}` : ''; return [{ recipient: context.sender, - message: `${ICONS.complete} ${id} completada — “*${res.task?.description || '(sin descripción)'}*”${due}\nGracias, ${who}.` + message: `${ICONS.complete} ${id} completada — _${res.task?.description || '(sin descripción)'}_${due}\nGracias, ${who}.` }]; } @@ -468,19 +468,19 @@ export class CommandService { if (res.status === 'completed') { return [{ recipient: context.sender, - message: `ℹ️ ${id} ya estaba completada — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `ℹ️ ${id} ya estaba completada — _${res.task?.description || '(sin descripción)'}_${due}` }]; } if (res.status === 'already') { return [{ recipient: context.sender, - message: `ℹ️ ${id} ya la tenías — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `ℹ️ ${id} ya la tenías — _${res.task?.description || '(sin descripción)'}_${due}` }]; } return [{ recipient: context.sender, - message: `${ICONS.take} Has tomado ${id} — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `${ICONS.take} Has tomado ${id} — _${res.task?.description || '(sin descripción)'}_${due}` }]; } @@ -513,20 +513,20 @@ export class CommandService { if (res.status === 'not_assigned') { return [{ recipient: context.sender, - message: `ℹ️ ${id} no la tenías asignada — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `ℹ️ ${id} no la tenías asignada — _${res.task?.description || '(sin descripción)'}_${due}` }]; } if (res.now_unassigned) { return [{ recipient: context.sender, - message: `${ICONS.unassigned} ${id} queda sin dueño — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `${ICONS.unassigned} ${id} queda sin responsable — _${res.task?.description || '(sin descripción)'}_${due}` }]; } return [{ recipient: context.sender, - message: `${ICONS.unassign} Has soltado ${id} — “*${res.task?.description || '(sin descripción)'}*”${due}` + message: `${ICONS.unassign} Has soltado ${id} — _${res.task?.description || '(sin descripción)'}_${due}` }]; } @@ -661,12 +661,12 @@ export class CommandService { const responses: CommandResponse[] = []; // 1) Ack al creador con formato compacto - const ackHeader = `${ICONS.create} ${taskId} “*${description || '(sin descripción)'}*”`; + const ackHeader = `${ICONS.create} ${taskId} _${description || '(sin descripción)'}_`; const ackLines: string[] = [ackHeader]; const dueFmt = formatDDMM(dueDate); if (dueFmt) ackLines.push(`${ICONS.date} ${dueFmt}`); if (assignmentUserIds.length === 0) { - ackLines.push(`${ICONS.unassigned} sin dueño${groupName ? ` (${groupName})` : ''}`); + ackLines.push(`${ICONS.unassigned} sin responsable${groupName ? ` (${groupName})` : ''}`); } else { const assigneesList = assignedDisplayNames.join(', '); ackLines.push(`${assignmentUserIds.length > 1 ? '👥' : '👤'} ${assigneesList}`); @@ -684,7 +684,7 @@ export class CommandService { recipient: uid, message: [ `${ICONS.assignNotice} Tarea ${taskId}${formatDDMM(dueDate) ? ` — ${ICONS.date} ${formatDDMM(dueDate)}` : ''}`, - `“*${description || '(sin descripción)'}*”`, + `_${description || '(sin descripción)'}_`, groupName ? `Grupo: ${groupName}` : null, `Completar: /t x ${taskId}` ].filter(Boolean).join('\n'), diff --git a/src/services/reminders.ts b/src/services/reminders.ts index d063851..03cf01c 100644 --- a/src/services/reminders.ts +++ b/src/services/reminders.ts @@ -139,11 +139,11 @@ export class RemindersService { ); const owner = (t.assignees?.length || 0) === 0 - ? `${ICONS.unassigned} sin dueño` + ? `${ICONS.unassigned} sin responsable` : `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`; const isOverdue = t.due_date ? t.due_date < todayYMD : false; const datePart = t.due_date ? ` — ${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : ''; - return `- ${t.id}) “*${t.description || '(sin descripción)'}*”${datePart} — ${owner}`; + return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart} — ${owner}`; })); sections.push(...rendered); } diff --git a/tests/unit/server.test.ts b/tests/unit/server.test.ts index c87a450..e437e20 100644 --- a/tests/unit/server.test.ts +++ b/tests/unit/server.test.ts @@ -834,7 +834,7 @@ describe('WebhookServer', () => { expect(r.recipient.endsWith('@g.us')).toBe(false); } const msg = out.map(x => x.message).join('\n'); - expect(msg).toContain('sin dueño'); + expect(msg).toContain('sin responsable'); expect(msg).toContain('… y 2 más'); }); @@ -903,7 +903,7 @@ describe('WebhookServer', () => { expect(out.length).toBeGreaterThan(0); const msg = out.map(x => x.message).join('\n'); expect(msg).toContain('Tus tareas'); - expect(msg).toContain('sin dueño'); + expect(msg).toContain('sin responsable'); expect(msg).toContain('… y 2 más'); }); @@ -933,7 +933,7 @@ describe('WebhookServer', () => { expect(out.length).toBeGreaterThan(0); const msg = out.map(x => x.message).join('\n'); expect(msg).toContain('Tus tareas'); - expect(msg).toContain('ℹ️ Para ver tareas sin dueño'); + expect(msg).toContain('ℹ️ Para ver tareas sin responsable'); }); }); }); diff --git a/tests/unit/services/command.claim-unassign.test.ts b/tests/unit/services/command.claim-unassign.test.ts index 88cad2f..c95eb8e 100644 --- a/tests/unit/services/command.claim-unassign.test.ts +++ b/tests/unit/services/command.claim-unassign.test.ts @@ -89,7 +89,7 @@ describe('CommandService - /t tomar y /t soltar', () => { it('soltar: si queda sin dueño, mensaje adecuado', async () => { const taskId = createTask('Desc soltar', '999', '2025-09-12', ['111']); const res = await CommandService.handle(ctx('111', `/t soltar ${taskId}`)); - expect(res[0].message).toContain('queda sin dueño'); + expect(res[0].message).toContain('queda sin responsable'); expect(res[0].message).toContain(String(taskId)); });