From 47a7def7c153805f7b9afbaa776d8537aa9970a3 Mon Sep 17 00:00:00 2001 From: brobert Date: Sun, 26 Oct 2025 00:24:42 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20usar=20resolveTaskIdFromInput=20ext?= =?UTF-8?q?erno=20y=20quitar=20m=C3=A9todo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (openrouter/openai/gpt-5) --- src/services/command.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/services/command.ts b/src/services/command.ts index 20980b8..f43648e 100644 --- a/src/services/command.ts +++ b/src/services/command.ts @@ -13,7 +13,7 @@ import { Metrics } from './metrics'; import { ResponseQueue } from './response-queue'; import { randomTokenBase64Url, sha256Hex } from '../utils/crypto'; import { route as routeCommand } from './commands'; -import { ACTION_ALIASES, SCOPE_ALIASES, todayYMD as todayYMD_TZ } from './commands/shared'; +import { ACTION_ALIASES, SCOPE_ALIASES, todayYMD as todayYMD_TZ, resolveTaskIdFromInput } from './commands/shared'; import { parseNueva } from './commands/parsers/nueva'; type CommandContext = { @@ -43,10 +43,6 @@ export class CommandService { private static readonly CTA_HELP: string = 'ℹ️ Tus tareas: `/t mias` · Todas: `/t todas` · Info: `/t info` · Web: `/t web`'; - private static resolveTaskIdFromInput(n: number): number | null { - const byCode = TaskService.getActiveTaskByDisplayCode(n); - return byCode ? byCode.id : null; - } private static async processTareaCommand( context: CommandContext @@ -357,7 +353,7 @@ export class CommandService { // Caso de 1 ID: mantener comportamiento actual if (ids.length === 1) { const idInput = ids[0]; - const resolvedId = this.resolveTaskIdFromInput(idInput); + const resolvedId = resolveTaskIdFromInput(idInput); if (!resolvedId) { return [{ recipient: context.sender, @@ -413,7 +409,7 @@ export class CommandService { } for (const idInput of ids) { - const resolvedId = this.resolveTaskIdFromInput(idInput); + const resolvedId = resolveTaskIdFromInput(idInput); if (!resolvedId) { lines.push(`⚠️ ${codeId(idInput)} no encontrada.`); cntNotFound++; @@ -486,7 +482,7 @@ export class CommandService { if (ids.length === 1) { const idInput = ids[0]; - const resolvedId = this.resolveTaskIdFromInput(idInput); + const resolvedId = resolveTaskIdFromInput(idInput); if (!resolvedId) { return [{ recipient: context.sender, @@ -552,7 +548,7 @@ export class CommandService { } for (const idInput of ids) { - const resolvedId = this.resolveTaskIdFromInput(idInput); + const resolvedId = resolveTaskIdFromInput(idInput); if (!resolvedId) { lines.push(`⚠️ ${codeId(idInput)} no encontrada.`); cntNotFound++; @@ -612,7 +608,7 @@ export class CommandService { }]; } - const resolvedId = this.resolveTaskIdFromInput(idInput); + const resolvedId = resolveTaskIdFromInput(idInput); if (!resolvedId) { return [{ recipient: context.sender,