Skip to content

Fase 1.1: Infraestructura Base

← Fase 1 MVP | Siguiente: 1.2 Dispatcher →


Crear migración background_jobs

Archivo: */backend/background-jobs-system.md

Rama: feature/background-jobs-migrations

Fase: 1.1: Infraestructura Base

Estimación: 4 horas

Dependencias: Ninguna

Deliverables

  • [ ] Crear archivo migración server/migrations/[timestamp]_create_background_jobs_table.sql
  • [ ] Tabla con columnas: id, schema, handler_class, payload, status, result, attempts, started_at, completed_at, created_at, updated_at
  • [ ] Índices en (schema, status, created_at)
  • [ ] Ejecutar migración en entorno de desarrollo
  • [ ] Validar estructura en PostgreSQL

Crear migración notifications

Archivo: */backend/background-jobs-system.md

Rama: feature/background-jobs-migrations

Fase: 1.1: Infraestructura Base

Estimación: 3 horas

Dependencias: Crear migración background_jobs

Deliverables

  • [ ] Crear archivo migración server/migrations/[timestamp]_create_notifications_table.sql
  • [ ] Tabla con columnas: id, schema, user_id, job_id, title, message, type, read_at, created_at
  • [ ] Relación FK a background_jobs
  • [ ] Índices en (schema, user_id, created_at)
  • [ ] Ejecutar migración
  • [ ] Validar estructura en PostgreSQL

Crear DTOs BackgroundJob y Notification

Archivo: */backend/background-jobs-system.md

Rama: feature/background-jobs-infrastructure

Fase: 1.1: Infraestructura Base

Estimación: 3 horas

Dependencias: Crear migración background_jobs, Crear migración notifications

Deliverables

  • [ ] Crear server/src/Resources/BackgroundJob/BackgroundJobRequestDTO.php (handler_class, payload)
  • [ ] Crear server/src/Resources/BackgroundJob/BackgroundJobResponseDTO.php (completo con status, result)
  • [ ] Crear server/src/Resources/Notification/NotificationDTO.php (completo)
  • [ ] Agregar PHPDoc con ejemplos
  • [ ] Tests unitarios para DTOs

Crear Models BackgroundJobModel y NotificationModel

Archivo: */backend/background-jobs-system.md

Rama: feature/background-jobs-infrastructure

Fase: 1.1: Infraestructura Base

Estimación: 4 horas

Dependencias: Crear DTOs BackgroundJob y Notification

Deliverables

  • [ ] Crear server/src/Models/modulo-background-jobs/BackgroundJobModel.php
    • [ ] Métodos: find, create, update, findByStatus, findPending
    • [ ] Row hydration a DTO
  • [ ] Crear server/src/Models/modulo-background-jobs/NotificationModel.php
    • [ ] Métodos: create, findByUser, markAsRead
  • [ ] Unit tests para ambos models
  • [ ] Validar operaciones en PostgreSQL

← Fase 1 MVP | Siguiente: 1.2 Dispatcher →