import type { Comment, Cycle, Issue, Label, Project, User, WorkflowState } from "@/lib/types"; /** * Datos de ejemplo usados por la capa mock. * * Mientras el backend de SAM no exponga los endpoints de proyectos, la app * consume estos datos en memoria. La forma de cada objeto replica el contrato * definido en src/lib/types.ts, de modo que sustituir mock por HTTP no obliga * a tocar ningún componente. */ export const users: User[] = [ { id: "u1", name: "Juan Pérez", email: "juan@ichn.local", initials: "JP", color: "#5e6ad2" }, { id: "u2", name: "María Rojas", email: "maria@ichn.local", initials: "MR", color: "#f2994a" }, { id: "u3", name: "Diego Soto", email: "diego@ichn.local", initials: "DS", color: "#26b5ce" }, { id: "u4", name: "Carla Muñoz", email: "carla@ichn.local", initials: "CM", color: "#bb87fc" }, ]; export const labels: Label[] = [ { id: "l1", name: "frontend", color: "#5e6ad2" }, { id: "l2", name: "backend", color: "#26b5ce" }, { id: "l3", name: "diseño", color: "#bb87fc" }, { id: "l4", name: "bug", color: "#fb2c36" }, { id: "l5", name: "deuda técnica", color: "#f2994a" }, ]; /** Réplica local de proyectos.workflow_states (ver migración 003). */ export const workflowStates: WorkflowState[] = [ { key: "backlog", label: "Backlog", color: "#6c788b", icon: "bx-radio-circle", sortOrder: 10, section: "Sin iniciar", isDone: false, isActive: true }, { key: "todo", label: "Por hacer", color: "#6c788b", icon: "bx-radio-circle", sortOrder: 20, section: "Sin iniciar", isDone: false, isActive: true }, { key: "in_progress", label: "En curso", color: "#d19b3d", icon: "bx-error-circle", sortOrder: 30, section: "En curso", isDone: false, isActive: true }, { key: "in_review", label: "En revisión", color: "#8c6fd1", icon: "bx-time", sortOrder: 40, section: "En curso", isDone: false, isActive: true }, { key: "done", label: "Completado", color: "#015fc9", icon: "bx-check-circle", sortOrder: 50, section: "Completado", isDone: true, isActive: true }, { key: "canceled", label: "Cancelado", color: "#98a2b3", icon: "bx-x-circle", sortOrder: 60, section: "Completado", isDone: true, isActive: true }, ]; export const projects: Project[] = [ { id: "p1", name: "Plataforma", key: "PLAT", description: "Núcleo de la plataforma: autenticación, usuarios y permisos.", status: "in_progress", leadId: "u1", startDate: "2026-09-01", targetDate: "2026-12-15", createdAt: "2026-08-20T10:00:00Z", }, { id: "p2", name: "Portal Alumnos", key: "PORT", description: "Portal web para alumnos: matrícula, pagos y notas.", status: "planned", leadId: "u2", startDate: "2026-10-15", targetDate: "2027-02-01", createdAt: "2026-09-02T10:00:00Z", }, { id: "p3", name: "Helpdesk", key: "HELP", description: "Sistema de tickets y soporte interno.", status: "completed", leadId: "u3", startDate: "2026-05-01", targetDate: "2026-09-30", createdAt: "2026-04-10T10:00:00Z", }, ]; export const cycles: Cycle[] = [ { id: "c3", name: "Ciclo 3", number: 3, projectId: null, startsAt: "2026-10-05", endsAt: "2026-10-26", status: "active", }, { id: "c4", name: "Ciclo 4", number: 4, projectId: null, startsAt: "2026-10-27", endsAt: "2026-11-16", status: "upcoming", }, { id: "c2", name: "Ciclo 2", number: 2, projectId: null, startsAt: "2026-09-14", endsAt: "2026-10-04", status: "completed", }, ]; export const issues: Issue[] = [ { id: "i1", identifier: "PLAT-42", title: "Implementar login con JWT y refresh token", description: "El backend expone `POST /api/auth/login`. Falta integrar el guardado del token y el refresco automático antes de expirar.", status: "in_progress", priority: 3, type: "feature", assigneeId: "u1", projectId: "p1", cycleId: "c3", parentId: null, needsTriage: false, estimate: 5, labelIds: ["l2"], createdAt: "2026-10-01T09:15:00Z", updatedAt: "2026-10-12T15:40:00Z", completedAt: null, }, { id: "i2", identifier: "PLAT-43", title: "Bug: el sidebar se cierra al navegar en móvil", description: "Al pulsar un enlace del sidebar en pantallas pequeñas el menú no se colapsa.", status: "todo", priority: 4, type: "bug", assigneeId: "u2", projectId: "p1", cycleId: "c3", parentId: null, needsTriage: false, estimate: 3, labelIds: ["l1", "l4"], createdAt: "2026-10-03T11:00:00Z", updatedAt: "2026-10-10T08:20:00Z", completedAt: null, }, { id: "i3", identifier: "PLAT-44", title: "Diseñar sistema de permisos por rol", description: "Definir roles sam, portal e it y cómo se mapean a los módulos.", status: "in_review", priority: 2, type: "task", assigneeId: "u4", projectId: "p1", cycleId: "c3", parentId: null, needsTriage: false, estimate: 8, labelIds: ["l3"], createdAt: "2026-09-28T14:30:00Z", updatedAt: "2026-10-11T17:05:00Z", completedAt: null, }, { id: "i4", identifier: "PLAT-45", title: "Añadir rate limiting al endpoint de login", description: "El backend ya lo expone con `[EnableRateLimiting(\"login\")]`. Verificar el comportamiento desde el cliente.", status: "done", priority: 2, type: "task", assigneeId: "u3", projectId: "p1", cycleId: "c3", parentId: null, needsTriage: false, estimate: null, labelIds: ["l2"], createdAt: "2026-09-20T10:00:00Z", updatedAt: "2026-10-08T12:00:00Z", completedAt: "2026-10-08T12:00:00Z", }, { id: "i5", identifier: "PORT-7", title: "Pantalla de matrícula en línea", description: "Formulario multi-paso con validación RUT y selección de cursos.", status: "backlog", priority: 1, type: "feature", assigneeId: null, projectId: "p2", cycleId: null, parentId: null, needsTriage: false, estimate: null, labelIds: ["l1", "l3"], createdAt: "2026-10-06T09:00:00Z", updatedAt: "2026-10-06T09:00:00Z", completedAt: null, }, { id: "i6", identifier: "PORT-8", title: "Integrar WebPay para pagos de arancel", description: "Flujo de pago con redirección y confirmación por webhook.", status: "todo", priority: 4, type: "feature", assigneeId: "u1", projectId: "p2", cycleId: "c4", parentId: "i5", needsTriage: false, estimate: 5, labelIds: ["l2"], createdAt: "2026-10-07T16:45:00Z", updatedAt: "2026-10-09T10:10:00Z", completedAt: null, }, { id: "i7", identifier: "HELP-12", title: "Exportar tickets a CSV", description: "El módulo de helpdesk ya está entregado; queda deuda técnica en la exportación.", status: "canceled", priority: 0, type: "chore", assigneeId: "u3", projectId: "p3", cycleId: "c2", parentId: null, needsTriage: false, estimate: null, labelIds: ["l5"], createdAt: "2026-08-15T13:20:00Z", updatedAt: "2026-09-30T09:00:00Z", completedAt: null, }, { id: "i8", identifier: "PLAT-46", title: "Refactorizar el cliente HTTP compartido", description: "Unificar fetch con reintentos y manejo de errores 401.", status: "todo", priority: 1, type: "chore", assigneeId: "u2", projectId: "p1", cycleId: "c4", parentId: null, needsTriage: false, estimate: null, labelIds: ["l5"], createdAt: "2026-10-09T08:00:00Z", updatedAt: "2026-10-09T08:00:00Z", completedAt: null, }, ]; export const comments: Comment[] = [ { id: "cm1", issueId: "i1", authorId: "u2", body: "¿Vamos a usar httpOnly cookies o guardamos el token en localStorage?", createdAt: "2026-10-11T10:30:00Z", }, { id: "cm2", issueId: "i1", authorId: "u1", body: "Preferiría httpOnly + refresh cookie, pero eso lo decide el backend de SAM.", createdAt: "2026-10-11T11:05:00Z", }, ];