From 19c6fb3153516c909abe98abb210fa15e310df03 Mon Sep 17 00:00:00 2001 From: Ricardo Gonzalez Date: Fri, 29 May 2026 08:41:37 -0500 Subject: [PATCH] DashboardView: columna SP + fix priority/story_points perdidos en enrichHU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - enrichHU ahora incluye status, priority y story_points en el return - Nueva columna SP (story points) entre Título y Estado en tabla HUs - Filtro prioridad acepta valores numéricos (1/2/3) --- AGENTS.md | 33 +++++++++++++++++++++++++++++++++ src/stores/workitems.ts | 5 ++++- src/views/DashboardView.vue | 5 +++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index f6253a1..825e9bb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -152,3 +152,36 @@ Nueva vista **Transcripciones** en la barra lateral (icono upload). 5. ⬜ **Generador de reportes** (K-13) 6. ⬜ **Integración calendario Google/Outlook** (K-21) 7. ⬜ **Alertas post-reunión** (K-22) + +--- + +## Changelog — Decisiones técnicas + +### 2026-05-29: Asignación HU + Status desde KAPPA + +**Asignado (employee_id vs user_id)** +- KAPPA devuelve `asignado_a: [1135]` donde 1135 es **employee_id**, no user_id. +- Employee 1135 → user 1115 (Felipe Crespo). El mapeo está en `usersStore.employees`. +- `parseAssignedUser()` en `stores/workitems.ts` separa: + - `asignado_a` → `_assignedEmployeeId` (employee_id) + - `assigned_to` → `_assignedUserId` (user_id directo) +- `DashboardView.resolveEmployeeToUser()` busca en `usersStore.employees.find(e.id === employeeId)?.user` +- Para persistencia en Turso (un solo campo `assigned_to`): employee_id se guarda como **negativo** (`-1135`). + `parseAssignedUser()` detecta negativos y los trata como employee_id. + +**Status** +- KAPPA devuelve `status: 6` (número) + `status_name: "QA-Client"`. +- `enrichHU()` usa `hu.status_name` primero; fallback a `resolveStatusName(hu.status)`. +- `STATUS_MAP` en `services/statuses-db.ts` ahora mapea valores numéricos (`'1'`–`'7'`) y nombres KAPPA. + +**Prioridad** +- KAPPA devuelve `priority: "3"` (string numérico). `PRIORITY_MAP` mapea `"1"`/`"2"`/`"3"` y texto. + +**UI - Tabla HUs** +- Columna Asignado: texto plano (no Select). Muestra nombre real o `asignado_a_names` de KAPPA. +- Columna Estado: muestra `status_name` de KAPPA (ej: QA-Client) con badge de color. +- Filtros con placeholder "Estado"/"Prioridad"/"Asignado". Filtro Asignado solo lista desarrolladores con HUs. + +**Dexie (browser)** +- Schema v8: nueva tabla `user_stories` con `&id, initiative_id`. +- Fallback en `tauri-db.ts` para get/save user_stories (antes solo Tauri). diff --git a/src/stores/workitems.ts b/src/stores/workitems.ts index dcf573f..b5d5f5e 100644 --- a/src/stores/workitems.ts +++ b/src/stores/workitems.ts @@ -89,7 +89,7 @@ export const useWorkItemsStore = defineStore('workitems', () => { return { id: null, name: '', employeeId: null } } - function enrichHU(hu: { title?: string; id?: number; status?: string | number | null; status_name?: string | null; acceptance_criteria?: string | null; criterios_aceptacion?: string | null; assigned_to?: number | null; asignado_a?: number[] | string[] | null; asignado_a_names?: string[] | string | null; assigned_name?: string }, initiativeId: number): EnrichedUserStory { + function enrichHU(hu: { title?: string; id?: number; status?: string | number | null; status_name?: string | null; priority?: string | number | null; story_points?: number | null; acceptance_criteria?: string | null; criterios_aceptacion?: string | null; assigned_to?: number | null; asignado_a?: number[] | string[] | null; asignado_a_names?: string[] | string | null; assigned_name?: string }, initiativeId: number): EnrichedUserStory { const h = parseHierarchy(hu.title || '') const rawCriteria = hu.acceptance_criteria || hu.criterios_aceptacion || '' const criteriaList = rawCriteria ? parseQuillList(rawCriteria) : [] @@ -97,6 +97,9 @@ export const useWorkItemsStore = defineStore('workitems', () => { return { id: hu.id ?? 0, title: hu.title || '', + status: String(hu.status ?? ''), + priority: String(hu.priority ?? ''), + story_points: hu.story_points ?? undefined, acceptance_criteria: rawCriteria, criterios_aceptacion: rawCriteria, initiative: initiativeId, diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index 68e22a7..121242c 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -695,6 +695,9 @@ const statusLabel = (status: unknown) => { Baja Crítica Urgente + Alta (1) + Media (2) + Baja (3)