128 lines
3.1 KiB
Markdown
128 lines
3.1 KiB
Markdown
# ✅ CHECKLIST IMPLEMENTACIÓN - Sistema de Contenido Externo
|
|
|
|
**Fecha:** 2025-01-06
|
|
**Estado:** Base Implementada
|
|
|
|
---
|
|
|
|
## ✅ COMPONENTES BASE IMPLEMENTADOS
|
|
|
|
### Frontend (App)
|
|
|
|
- [x] **ContentAdapter Interface** (`src/services/content-adapter.ts`)
|
|
- [x] Interface definida
|
|
- [x] LocalContentAdapter (fallback)
|
|
- [x] ExternalContentAdapter (pack)
|
|
- [x] ContentAdapterFactory
|
|
- [x] Hook React `useContentAdapter()`
|
|
- [x] Conversión ContentItem → Procedure/Drug
|
|
- [x] Cache en localStorage
|
|
|
|
### Backend
|
|
|
|
- [x] **Generador Content Pack** (`backend/src/services/pack-generator.js`)
|
|
- [x] Lee desde PostgreSQL
|
|
- [x] Incluye recursos multimedia
|
|
- [x] Calcula hash SHA-256
|
|
- [x] Genera JSON optimizado
|
|
|
|
- [x] **API Content Pack** (`backend/src/routes/content-pack.js`)
|
|
- [x] `GET /api/content-pack/latest.json`
|
|
- [x] `GET /api/content-pack/:version.json`
|
|
- [x] Cache headers (ETag, Cache-Control)
|
|
- [x] Generación on-the-fly
|
|
|
|
- [x] **Base de Datos**
|
|
- [x] Schema `tes_content` creado
|
|
- [x] Tablas principales creadas
|
|
- [x] 23 items migrados
|
|
|
|
- [x] **API Estadísticas** (`backend/src/routes/stats.js`)
|
|
- [x] `GET /api/stats/content`
|
|
- [x] Dashboard actualizado
|
|
|
|
---
|
|
|
|
## ⏳ PENDIENTE (Siguiente Fase)
|
|
|
|
### Panel Admin
|
|
|
|
- [ ] **Editor de Protocolos Completo**
|
|
- [ ] Tabs: Básico, Pasos, Checklist, Recursos
|
|
- [ ] Preview "Modo Escena"
|
|
- [ ] Asociación de imágenes/vídeos
|
|
|
|
- [ ] **Editor de Guías**
|
|
- [ ] 8 secciones por guía
|
|
- [ ] Markdown editor
|
|
- [ ] Asociación con protocolos
|
|
|
|
- [ ] **Editor de Manual**
|
|
- [ ] Markdown estructurado
|
|
- [ ] Asociación de infografías
|
|
- [ ] Versionado
|
|
|
|
- [ ] **Gestor de Recursos**
|
|
- [ ] Upload de imágenes/vídeos
|
|
- [ ] Metadatos
|
|
- [ ] Asociación a contenido
|
|
- [ ] Detección de recursos huérfanos
|
|
|
|
- [ ] **Generador de Pack desde UI**
|
|
- [ ] Botón "Generar Pack"
|
|
- [ ] Selección de versión
|
|
- [ ] Descarga de JSON
|
|
|
|
- [ ] **Sistema de Validación**
|
|
- [ ] Roles (admin, tes_validador, formador, medico)
|
|
- [ ] Flujo: draft → in_review → approved → published
|
|
- [ ] Registro de auditoría
|
|
|
|
- [ ] **Exportación SCORM**
|
|
- [ ] Generación desde guías
|
|
- [ ] Packaging ZIP
|
|
- [ ] Descarga
|
|
|
|
---
|
|
|
|
## 🧪 TESTING
|
|
|
|
### Verificar Content Pack
|
|
|
|
```bash
|
|
# 1. Obtener pack
|
|
curl http://localhost:3000/api/content-pack/latest.json
|
|
|
|
# 2. Verificar metadata
|
|
curl -s http://localhost:3000/api/content-pack/latest.json | \
|
|
python3 -c "import sys, json; d=json.load(sys.stdin); \
|
|
print(f\"Items: {d['metadata']['total_items']}\")"
|
|
```
|
|
|
|
### Verificar Adapter en App
|
|
|
|
```typescript
|
|
import { getProtocol, getAllProtocols } from '@/services/content-adapter';
|
|
|
|
const protocol = getProtocol('rcp-adulto-svb');
|
|
const protocols = getAllProtocols();
|
|
```
|
|
|
|
---
|
|
|
|
## ✅ RESTRICCIONES VERIFICADAS
|
|
|
|
- [x] NO modifica `src/data/procedures.ts`
|
|
- [x] NO modifica `src/data/drugs.ts`
|
|
- [x] NO modifica Service Worker
|
|
- [x] NO modifica rutas existentes
|
|
- [x] NO modifica componentes actuales
|
|
- [x] TODO es aditivo y desacoplado
|
|
- [x] Fallback total garantizado
|
|
- [x] App funciona igual si falla
|
|
|
|
---
|
|
|
|
**✅ Base del sistema implementada correctamente!**
|
|
|