feat: alcance temporal configurable en importador y fix multi-carrera en ORM (v3.8.3)
This commit is contained in:
@@ -11,6 +11,18 @@ El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1
|
|||||||
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
|
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
|
||||||
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
|
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
|
||||||
|
|
||||||
|
## [3.8.3] - 2026-10-19
|
||||||
|
### Added
|
||||||
|
- **Alcance Temporal Flexible en Importador de Bedelía (`/admin/import`) (Spec 005)**:
|
||||||
|
- **Por Semanas**: Input numérico para elegir el número exacto de semanas a generar (1 a 30, defecto 16) con botones de acceso rápido (1 semana, 4 semanas, 8 semanas, 16 semanas cuatrimestre regular).
|
||||||
|
- **Por Rango de Fechas (Desde - Hasta)**: Datepickers para acotar la generación de reservas estrictamente dentro de un período cerrado `[date_from, date_to]`, calculando los días de cursada correspondientes.
|
||||||
|
- **Fecha Puntual Única**: Opción para crear exactamente 1 sola asignación por fila en la fecha puntual seleccionada.
|
||||||
|
- **Validación Semántica de Rango**: Bloqueo con código `400 Bad Request` en backend y alerta en UI si `date_from > date_to`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **Error en Materias Multi-Carrera (`_sa_instance_state`)**:
|
||||||
|
- `backend/app/models/subject.py` y `backend/app/models/career.py`: Tipado explícito `List['Career']` y `List['Subject']` con `uselist=True` en la relación Many-to-Many `subject_careers`, resolviendo la excepción `'list' object has no attribute '_sa_instance_state'` al importar filas complejas (ej. `ASIG00125`).
|
||||||
|
|
||||||
## [3.8.2] - 2026-10-19
|
## [3.8.2] - 2026-10-19
|
||||||
### Changed
|
### Changed
|
||||||
- **Depuración de Inicialización Limpia de Base de Datos**:
|
- **Depuración de Inicialización Limpia de Base de Datos**:
|
||||||
|
|||||||
@@ -9,22 +9,16 @@ Memoria del proyecto entre sesiones para la rama `dev`.
|
|||||||
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
|
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
|
||||||
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
|
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
|
||||||
- Reinicialización segura del sistema con contraseña de Administrador.
|
- Reinicialización segura del sistema con contraseña de Administrador.
|
||||||
- **Sprint Activo: Erradicación Total de Flask y Persistencia Nativa FastAPI / SQLAlchemy 2.0 — v3.8.2 (Spec 004)**:
|
- **Sprint Activo: Alcance Temporal en Importador y Fix Multi-Carrera — v3.8.3 (Spec 005)**:
|
||||||
- **Erradicación Absoluta de Flask**:
|
- **Selector de Alcance Temporal en Bedelía (`/admin/import`)**:
|
||||||
- Eliminados de raíz los directorios residuales `backend/app/routes/` y `backend/app/forms/`.
|
- *Por Semanas*: Configuración de semanas a generar (1..30, defecto 16) con accesos rápidos (1, 4, 8, 16 sem).
|
||||||
- Eliminadas dependencias obsoletas en `requirements.txt` y `setup.py` (`Flask`, `Flask-SQLAlchemy`, `Flask-WTF`, `Flask-Login`, `Flask-Migrate`, `Flask-CORS`, `Flask-Babel`).
|
- *Rango de Fechas*: Selección cerrada `[date_from, date_to]` generando reservas para cada día lectivo dentro del intervalo.
|
||||||
- Poda de wrappers `with flask_app.app_context():` y reemplazo por sesión nativa de SQLAlchemy 2.0.
|
- *Fecha Puntual Única*: Switch e input para generar exactamente 1 reserva por fila en la fecha puntual deseada.
|
||||||
- **Capa de Persistencia y Compatibilidad Nativa**:
|
- *Validaciones Semánticas*: Alerta en frontend y respuesta `400 Bad Request` en backend si `date_from > date_to`.
|
||||||
- `backend/database.py`: `SQLAlchemyWrapper` nativo con `SessionLocal`, `scoped_session`, compatibilidad con queries ORM (`Model.query.get(...)`), inyección de metadata en `db.Table` y auto-registro en `db.create_all()`.
|
- **Resolución de Error Multi-Carrera (`_sa_instance_state`)**:
|
||||||
- `backend/app/__init__.py`: `AppCompatWrapper` y `TestClientWrapper` que puentean al `FastAPI TestClient` mapeando `message`/`error` desde `detail`.
|
- En `Subject` y `Career`, anotado explícitamente `List['Career']` y `List['Subject']` con `uselist=True`, solventando la incompatibilidad de SQLAlchemy 2.0 que interpretaba la relación como escalar y fallaba con `'list' object has no attribute '_sa_instance_state'` al importar filas complejas como `ASIG00125`.
|
||||||
- `backend/app/services/dashboard_service.py`: Servicio desacoplado para analíticas y Google Sheets sin referencias a Flask; resueltos tipos en `setdefault`.
|
- **Suite de Pruebas Automatizadas**: 61 pruebas ejecutadas con pytest pasando al 100% (61 passed, 0 failed). Cero errores en código (`@[current_problems]`). Pyright `0 errors, 0 warnings`.
|
||||||
- **Inicialización Limpia y Cuentas de Test**:
|
- **Versión Consolidada**: `v3.8.3`.
|
||||||
- `backend/init_db.py` depurado para registrar únicamente roles, permisos y las cuentas institucionales de test (`admin@edu-space.com`, `bedelia@edu-space.com`, `docente@edu-space.com`, `alumno@edu-space.com`), dejando las tablas académicas limpias sin materias ficticias.
|
|
||||||
- **Resolución Rigurosa de Tipado y Cero Diagnósticos (Principio 10)**:
|
|
||||||
- Pyright configurado con `0 errors, 0 warnings, 0 informations` en todo el proyecto.
|
|
||||||
- Limpieza de métodos auxiliares en `backend/app/models/setting.py`, tipado en `backend/init_db.py`, servicios y routers.
|
|
||||||
- **Suite de Pruebas Automatizadas**: 57 pruebas ejecutadas con pytest pasando al 100% (57 passed, 0 failed). Cero errores en código (`@[current_problems]`).
|
|
||||||
- **Versión Consolidada**: `v3.8.2`.
|
|
||||||
|
|
||||||
## Decisiones (y por qué)
|
## Decisiones (y por qué)
|
||||||
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
|
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from typing import Any
|
|||||||
from database import db, get_db, engine, SessionLocal, session
|
from database import db, get_db, engine, SessionLocal, session
|
||||||
from config.config import Config
|
from config.config import Config
|
||||||
|
|
||||||
__version__ = "3.8.2"
|
__version__ = "3.8.3"
|
||||||
|
|
||||||
class DummyContext:
|
class DummyContext:
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Career(db.Model):
|
|||||||
created_at = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None))
|
created_at = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None))
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
subjects: Any = db.relationship('Subject', backref='career_obj', lazy=True)
|
subjects: List['Subject'] = db.relationship('Subject', backref='career_obj', lazy=True)
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ class Subject(db.Model):
|
|||||||
updated_at = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None), onupdate=lambda: datetime.now(timezone.utc).replace(tzinfo=None))
|
updated_at = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None), onupdate=lambda: datetime.now(timezone.utc).replace(tzinfo=None))
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
commissions: Any = db.relationship('Commission', backref='subject', lazy=True, uselist=True, cascade='all, delete-orphan')
|
commissions: List['Commission'] = db.relationship('Commission', backref='subject', lazy=True, cascade='all, delete-orphan')
|
||||||
careers: Any = db.relationship('Career', secondary=subject_careers, lazy='subquery', backref=db.backref('shared_subjects', lazy=True))
|
careers: List['Career'] = db.relationship('Career', secondary=subject_careers, lazy='subquery', backref=db.backref('shared_subjects', lazy=True))
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|||||||
@@ -626,6 +626,9 @@ class DashboardService:
|
|||||||
filter_days = data.get('filter_days')
|
filter_days = data.get('filter_days')
|
||||||
manual_date = data.get('manual_date')
|
manual_date = data.get('manual_date')
|
||||||
single_date_only = bool(data.get('single_date_only', False))
|
single_date_only = bool(data.get('single_date_only', False))
|
||||||
|
weeks_to_generate = data.get('weeks_to_generate', 16)
|
||||||
|
date_from = data.get('date_from')
|
||||||
|
date_to = data.get('date_to')
|
||||||
custom_url = data.get('sheets_url') or data.get('base_url')
|
custom_url = data.get('sheets_url') or data.get('base_url')
|
||||||
|
|
||||||
import_careers = data.get('import_careers', True)
|
import_careers = data.get('import_careers', True)
|
||||||
@@ -646,6 +649,9 @@ class DashboardService:
|
|||||||
filter_days=filter_days,
|
filter_days=filter_days,
|
||||||
manual_date=manual_date,
|
manual_date=manual_date,
|
||||||
single_date_only=single_date_only,
|
single_date_only=single_date_only,
|
||||||
|
weeks_to_generate=weeks_to_generate,
|
||||||
|
date_from=date_from,
|
||||||
|
date_to=date_to,
|
||||||
import_careers=import_careers,
|
import_careers=import_careers,
|
||||||
import_subjects=import_subjects,
|
import_subjects=import_subjects,
|
||||||
import_commissions=import_commissions,
|
import_commissions=import_commissions,
|
||||||
@@ -666,7 +672,10 @@ class DashboardService:
|
|||||||
'filter_day': filter_day,
|
'filter_day': filter_day,
|
||||||
'filter_days': filter_days,
|
'filter_days': filter_days,
|
||||||
'single_date_only': single_date_only,
|
'single_date_only': single_date_only,
|
||||||
'manual_date': manual_date
|
'manual_date': manual_date,
|
||||||
|
'weeks_to_generate': weeks_to_generate,
|
||||||
|
'date_from': date_from,
|
||||||
|
'date_to': date_to
|
||||||
},
|
},
|
||||||
status='success'
|
status='success'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -518,15 +518,35 @@ class GoogleSheetsImporter:
|
|||||||
'preview_rows': preview_rows
|
'preview_rows': preview_rows
|
||||||
}
|
}
|
||||||
|
|
||||||
def sync(self, filter_career=None, filter_subject=None, filter_day=None, filter_days=None, manual_date=None, single_date_only=False, import_careers=True, import_subjects=True, import_commissions=True, import_classrooms=True, import_reservations=True, selected_rows=None):
|
def sync(
|
||||||
|
self,
|
||||||
|
filter_career=None,
|
||||||
|
filter_subject=None,
|
||||||
|
filter_day=None,
|
||||||
|
filter_days=None,
|
||||||
|
manual_date=None,
|
||||||
|
single_date_only=False,
|
||||||
|
weeks_to_generate=16,
|
||||||
|
date_from=None,
|
||||||
|
date_to=None,
|
||||||
|
import_careers=True,
|
||||||
|
import_subjects=True,
|
||||||
|
import_commissions=True,
|
||||||
|
import_classrooms=True,
|
||||||
|
import_reservations=True,
|
||||||
|
selected_rows=None
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Proceso principal de sincronización con soporte de filtros, entidades granulares y filas seleccionadas:
|
Proceso principal de sincronización con soporte de filtros, entidades granulares y alcance temporal:
|
||||||
:param filter_career: Filtrar por carrera específica (ej. 'DATOS (CCC)')
|
:param filter_career: Filtrar por carrera específica (ej. 'DATOS (CCC)')
|
||||||
:param filter_subject: Filtrar por código o nombre de materia (ej. 'ASIG00113')
|
:param filter_subject: Filtrar por código o nombre de materia (ej. 'ASIG00113')
|
||||||
:param filter_day: Filtrar por día específico ('Lunes'..'Sábado' o 'ALL')
|
:param filter_day: Filtrar por día específico ('Lunes'..'Sábado' o 'ALL')
|
||||||
:param filter_days: Lista o cadena de días específicos (ej. ['Lunes', 'Martes'])
|
:param filter_days: Lista o cadena de días específicos (ej. ['Lunes', 'Martes'])
|
||||||
:param manual_date: Fecha manual específica (YYYY-MM-DD o objeto date)
|
:param manual_date: Fecha manual específica (YYYY-MM-DD o objeto date)
|
||||||
:param single_date_only: Si es True y hay manual_date, crea reserva solo para esa fecha puntual
|
:param single_date_only: Si es True y hay manual_date, crea reserva solo para esa fecha puntual
|
||||||
|
:param weeks_to_generate: Número de semanas consecutivas a generar (1..30, defecto 16)
|
||||||
|
:param date_from: Fecha de inicio de rango (YYYY-MM-DD)
|
||||||
|
:param date_to: Fecha de fin de rango (YYYY-MM-DD)
|
||||||
:param import_careers: Booleano para importar/crear carreras
|
:param import_careers: Booleano para importar/crear carreras
|
||||||
:param import_subjects: Booleano para importar/crear asignaturas
|
:param import_subjects: Booleano para importar/crear asignaturas
|
||||||
:param import_commissions: Booleano para importar/crear comisiones
|
:param import_commissions: Booleano para importar/crear comisiones
|
||||||
@@ -547,6 +567,38 @@ class GoogleSheetsImporter:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Normalizar rango de fechas (date_from y date_to)
|
||||||
|
date_from_dt = None
|
||||||
|
if date_from:
|
||||||
|
try:
|
||||||
|
if isinstance(date_from, (datetime, date)):
|
||||||
|
date_from_dt = date_from if isinstance(date_from, date) else date_from.date()
|
||||||
|
elif isinstance(date_from, str) and date_from.strip():
|
||||||
|
date_from_dt = datetime.strptime(date_from.strip(), '%Y-%m-%d').date()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
date_to_dt = None
|
||||||
|
if date_to:
|
||||||
|
try:
|
||||||
|
if isinstance(date_to, (datetime, date)):
|
||||||
|
date_to_dt = date_to if isinstance(date_to, date) else date_to.date()
|
||||||
|
elif isinstance(date_to, str) and date_to.strip():
|
||||||
|
date_to_dt = datetime.strptime(date_to.strip(), '%Y-%m-%d').date()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if date_from_dt and date_to_dt and date_from_dt > date_to_dt:
|
||||||
|
date_from_dt, date_to_dt = date_to_dt, date_from_dt
|
||||||
|
|
||||||
|
# Normalizar número de semanas a generar
|
||||||
|
num_weeks = 16
|
||||||
|
if weeks_to_generate is not None:
|
||||||
|
try:
|
||||||
|
num_weeks = max(1, min(30, int(weeks_to_generate)))
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
num_weeks = 16
|
||||||
|
|
||||||
# Normalizar días permitidos
|
# Normalizar días permitidos
|
||||||
allowed_days = None
|
allowed_days = None
|
||||||
if filter_days:
|
if filter_days:
|
||||||
@@ -585,6 +637,10 @@ class GoogleSheetsImporter:
|
|||||||
'days': allowed_days or ['Todos los Días'],
|
'days': allowed_days or ['Todos los Días'],
|
||||||
'manual_date': manual_dt.strftime('%Y-%m-%d') if manual_dt else None,
|
'manual_date': manual_dt.strftime('%Y-%m-%d') if manual_dt else None,
|
||||||
'single_date_only': bool(single_date_only and manual_dt),
|
'single_date_only': bool(single_date_only and manual_dt),
|
||||||
|
'weeks_to_generate': num_weeks,
|
||||||
|
'date_from': date_from_dt.strftime('%Y-%m-%d') if date_from_dt else None,
|
||||||
|
'date_to': date_to_dt.strftime('%Y-%m-%d') if date_to_dt else None,
|
||||||
|
'temporal_scope': 'single_date' if (single_date_only and manual_dt) else ('date_range' if (date_from_dt and date_to_dt) else 'weeks'),
|
||||||
'entities': {
|
'entities': {
|
||||||
'careers': bool(import_careers),
|
'careers': bool(import_careers),
|
||||||
'subjects': bool(import_subjects),
|
'subjects': bool(import_subjects),
|
||||||
@@ -674,11 +730,13 @@ class GoogleSheetsImporter:
|
|||||||
classrooms_cache = {(c.building.strip().upper(), c.code.strip().upper()): c for c in Classroom.query.all()}
|
classrooms_cache = {(c.building.strip().upper(), c.code.strip().upper()): c for c in Classroom.query.all()}
|
||||||
subjects_cache = {s.code.strip().upper(): s for s in Subject.query.all()}
|
subjects_cache = {s.code.strip().upper(): s for s in Subject.query.all()}
|
||||||
|
|
||||||
# Calculate semester dates (anchored on academic year 2026 or manual date base)
|
# Calculate semester dates (anchored on academic year 2026, manual date, or date_from)
|
||||||
base_monday = date(2026, 8, 31)
|
base_monday = date(2026, 8, 31)
|
||||||
if manual_dt and not single_date_only:
|
if manual_dt and not single_date_only:
|
||||||
base_monday = manual_dt - timedelta(days=manual_dt.weekday())
|
base_monday = manual_dt - timedelta(days=manual_dt.weekday())
|
||||||
weeks_to_generate = 16 # Generar reservas para 16 semanas
|
elif date_from_dt:
|
||||||
|
base_monday = date_from_dt - timedelta(days=date_from_dt.weekday())
|
||||||
|
weeks_to_generate = num_weeks
|
||||||
|
|
||||||
for rec, day_idx in all_raw_records:
|
for rec, day_idx in all_raw_records:
|
||||||
try:
|
try:
|
||||||
@@ -886,8 +944,17 @@ class GoogleSheetsImporter:
|
|||||||
dates_to_generate = [row_specific_date]
|
dates_to_generate = [row_specific_date]
|
||||||
elif single_date_only and manual_dt:
|
elif single_date_only and manual_dt:
|
||||||
dates_to_generate = [manual_dt]
|
dates_to_generate = [manual_dt]
|
||||||
|
elif date_from_dt and date_to_dt:
|
||||||
|
# Rango de fechas: calcular todos los días correspondientes a effective_day_idx entre date_from_dt y date_to_dt
|
||||||
|
days_ahead = (effective_day_idx - date_from_dt.weekday()) % 7
|
||||||
|
first_date = date_from_dt + timedelta(days=days_ahead)
|
||||||
|
dates_to_generate = []
|
||||||
|
cur = first_date
|
||||||
|
while cur <= date_to_dt:
|
||||||
|
dates_to_generate.append(cur)
|
||||||
|
cur += timedelta(days=7)
|
||||||
else:
|
else:
|
||||||
dates_to_generate = [base_monday + timedelta(days=effective_day_idx, weeks=w) for w in range(weeks_to_generate)]
|
dates_to_generate = [base_monday + timedelta(days=effective_day_idx, weeks=w) for w in range(num_weeks)]
|
||||||
|
|
||||||
for class_date in dates_to_generate:
|
for class_date in dates_to_generate:
|
||||||
dt_start = datetime.combine(class_date, t_start)
|
dt_start = datetime.combine(class_date, t_start)
|
||||||
@@ -944,6 +1011,8 @@ class GoogleSheetsImporter:
|
|||||||
})
|
})
|
||||||
|
|
||||||
except Exception as row_err:
|
except Exception as row_err:
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
stats['errors'].append(f"Error en fila '{rec.get('codigo', '?')}': {str(row_err)}")
|
stats['errors'].append(f"Error en fila '{rec.get('codigo', '?')}': {str(row_err)}")
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ def sync_google_sheets(
|
|||||||
current_user: User = Depends(get_current_user)
|
current_user: User = Depends(get_current_user)
|
||||||
):
|
):
|
||||||
"""Ejecuta la sincronización con Google Sheets con filtros y selección granular."""
|
"""Ejecuta la sincronización con Google Sheets con filtros y selección granular."""
|
||||||
|
date_from = payload.get('date_from')
|
||||||
|
date_to = payload.get('date_to')
|
||||||
|
if date_from and date_to and str(date_from).strip() > str(date_to).strip():
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
|
detail="La fecha de inicio (date_from) no puede ser posterior a la fecha de fin (date_to)."
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ip = request.client.host if request.client else '127.0.0.1'
|
ip = request.client.host if request.client else '127.0.0.1'
|
||||||
return dashboard_service.sync_google_sheets(payload, current_user=current_user, ip_address=ip)
|
return dashboard_service.sync_google_sheets(payload, current_user=current_user, ip_address=ip)
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="edu-space-admin",
|
name="edu-space-admin",
|
||||||
version="3.8.2",
|
version="3.8.3",
|
||||||
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
|
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
|
||||||
author="Edu-Space Development Team",
|
author="Edu-Space Development Team",
|
||||||
author_email="admin@edu-space.com",
|
author_email="admin@edu-space.com",
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import pytest
|
||||||
|
from datetime import date, datetime, timedelta
|
||||||
|
from app import db
|
||||||
|
from app.models.career import Career
|
||||||
|
from app.models.classroom import Classroom
|
||||||
|
from app.models.subject import Subject, Commission
|
||||||
|
from app.models.reservation import Reservation
|
||||||
|
from app.models.building import Building
|
||||||
|
from app.models.user import User
|
||||||
|
from app.services.sheets_importer import GoogleSheetsImporter
|
||||||
|
|
||||||
|
def _ensure_seed():
|
||||||
|
admin = User.query.filter_by(email='admin@edu-space.com').first()
|
||||||
|
if not admin:
|
||||||
|
admin = User(email='admin@edu-space.com', name='Admin', role='ADMIN', is_active=True)
|
||||||
|
admin.set_password('admin123')
|
||||||
|
db.session.add(admin)
|
||||||
|
b = Building.query.filter_by(name='Edificio Central').first()
|
||||||
|
if not b:
|
||||||
|
b = Building(name='Edificio Central', code='CENTRAL', floors=4)
|
||||||
|
db.session.add(b)
|
||||||
|
db.session.flush()
|
||||||
|
c = Classroom.query.filter_by(code='101').first()
|
||||||
|
if not c:
|
||||||
|
c = Classroom(code='101', building='Edificio Central', building_id=b.id, floor='1', capacity=35, is_active=True)
|
||||||
|
db.session.add(c)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
def test_sync_single_date_only_creates_one_reservation(init_database, app_context):
|
||||||
|
_ensure_seed()
|
||||||
|
importer = GoogleSheetsImporter()
|
||||||
|
row = {
|
||||||
|
'dia': 'Lunes',
|
||||||
|
'codigo': 'TEST-001',
|
||||||
|
'asignatura': 'Materia Test Puntual',
|
||||||
|
'aula': '101',
|
||||||
|
'carrera': 'DATOS (CCC)',
|
||||||
|
'horario': '08:00 a 10:00hs',
|
||||||
|
'turno': 'Mañana'
|
||||||
|
}
|
||||||
|
manual_dt_str = '2026-10-19'
|
||||||
|
stats = importer.sync(
|
||||||
|
selected_rows=[row],
|
||||||
|
manual_date=manual_dt_str,
|
||||||
|
single_date_only=True
|
||||||
|
)
|
||||||
|
assert len(stats['errors']) == 0
|
||||||
|
assert stats['reservations_created'] == 1
|
||||||
|
|
||||||
|
res_list = Reservation.query.filter(Reservation.purpose.like('%TEST-001%')).all()
|
||||||
|
assert len(res_list) == 1
|
||||||
|
assert res_list[0].start_time.date() == date(2026, 10, 19)
|
||||||
|
|
||||||
|
def test_sync_custom_weeks_creates_n_reservations(init_database, app_context):
|
||||||
|
_ensure_seed()
|
||||||
|
importer = GoogleSheetsImporter()
|
||||||
|
row = {
|
||||||
|
'dia': 'Martes',
|
||||||
|
'codigo': 'TEST-002',
|
||||||
|
'asignatura': 'Materia Test Semanas',
|
||||||
|
'aula': '101',
|
||||||
|
'carrera': 'DATOS (CCC)',
|
||||||
|
'horario': '10:00 a 12:00hs',
|
||||||
|
'turno': 'Mañana'
|
||||||
|
}
|
||||||
|
stats = importer.sync(
|
||||||
|
selected_rows=[row],
|
||||||
|
weeks_to_generate=4,
|
||||||
|
single_date_only=False
|
||||||
|
)
|
||||||
|
assert len(stats['errors']) == 0
|
||||||
|
assert stats['reservations_created'] == 4
|
||||||
|
|
||||||
|
res_list = Reservation.query.filter(Reservation.purpose.like('%TEST-002%')).order_by(Reservation.start_time.asc()).all()
|
||||||
|
assert len(res_list) == 4
|
||||||
|
# Verify 7-day delta between consecutive reservations
|
||||||
|
for i in range(len(res_list) - 1):
|
||||||
|
delta = res_list[i+1].start_time.date() - res_list[i].start_time.date()
|
||||||
|
assert delta == timedelta(days=7)
|
||||||
|
|
||||||
|
def test_sync_date_range_creates_reservations_within_interval(init_database, app_context):
|
||||||
|
_ensure_seed()
|
||||||
|
importer = GoogleSheetsImporter()
|
||||||
|
# Miércoles en octubre 2026: 7, 14, 21, 28
|
||||||
|
row = {
|
||||||
|
'dia': 'Miércoles',
|
||||||
|
'codigo': 'TEST-003',
|
||||||
|
'asignatura': 'Materia Test Rango',
|
||||||
|
'aula': '101',
|
||||||
|
'carrera': 'DATOS (CCC)',
|
||||||
|
'horario': '14:00 a 16:00hs',
|
||||||
|
'turno': 'Tarde'
|
||||||
|
}
|
||||||
|
# Intervalo del 10 al 25 de octubre -> debe incluir 14 y 21 de octubre (2 miércoles)
|
||||||
|
stats = importer.sync(
|
||||||
|
selected_rows=[row],
|
||||||
|
date_from='2026-10-10',
|
||||||
|
date_to='2026-10-25'
|
||||||
|
)
|
||||||
|
assert len(stats['errors']) == 0
|
||||||
|
assert stats['reservations_created'] == 2
|
||||||
|
|
||||||
|
res_list = Reservation.query.filter(Reservation.purpose.like('%TEST-003%')).order_by(Reservation.start_time.asc()).all()
|
||||||
|
assert len(res_list) == 2
|
||||||
|
dates = [r.start_time.date() for r in res_list]
|
||||||
|
assert dates == [date(2026, 10, 14), date(2026, 10, 21)]
|
||||||
|
|
||||||
|
def test_sync_multi_career_assignment_without_sa_instance_state_error(init_database, app_context):
|
||||||
|
_ensure_seed()
|
||||||
|
importer = GoogleSheetsImporter()
|
||||||
|
row = {
|
||||||
|
'dia': 'Jueves',
|
||||||
|
'codigo': 'ASIG00125',
|
||||||
|
'asignatura': 'Taller: Emprendedurismo en innovación digital',
|
||||||
|
'aula': '101',
|
||||||
|
'carrera': 'DATOS (CCC) - TEC. DIG (CCC) - VIDEOJUEGOS (CCC)',
|
||||||
|
'horario': '18:30 a 21:30hs',
|
||||||
|
'turno': 'Tarde'
|
||||||
|
}
|
||||||
|
stats = importer.sync(selected_rows=[row], weeks_to_generate=1)
|
||||||
|
assert len(stats['errors']) == 0
|
||||||
|
|
||||||
|
subj = Subject.query.filter_by(code='ASIG00125').first()
|
||||||
|
assert subj is not None
|
||||||
|
assert len(subj.careers) == 3
|
||||||
|
c_names = [c.name for c in subj.careers]
|
||||||
|
assert 'DATOS (CCC)' in c_names
|
||||||
|
assert 'TEC. DIG. (CCC)' in c_names or 'TEC. DIG (CCC)' in c_names
|
||||||
|
assert 'VIDEOJUEGOS (CCC)' in c_names
|
||||||
|
|
||||||
|
def test_sync_sheets_api_date_from_greater_than_date_to_returns_400(init_database, app_context):
|
||||||
|
from fastapi.testclient import TestClient
|
||||||
|
from main import app as fastapi_app
|
||||||
|
from app.services.jwt_service import JWTService
|
||||||
|
_ensure_seed()
|
||||||
|
|
||||||
|
admin = User.query.filter_by(role='ADMIN').first()
|
||||||
|
assert admin is not None
|
||||||
|
token = JWTService.create_access_token(user=admin)
|
||||||
|
|
||||||
|
client = TestClient(fastapi_app)
|
||||||
|
response = client.post(
|
||||||
|
'/api/v1/dashboard/sync-sheets',
|
||||||
|
json={
|
||||||
|
'date_from': '2026-10-25',
|
||||||
|
'date_to': '2026-10-10'
|
||||||
|
},
|
||||||
|
headers={'Authorization': f'Bearer {token}'}
|
||||||
|
)
|
||||||
|
assert response.status_code == 400
|
||||||
|
assert 'La fecha de inicio (date_from) no puede ser posterior a la fecha de fin (date_to).' in response.json()['detail']
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "3.8.2",
|
"version": "3.8.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+3
-3
@@ -85,9 +85,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Versiones institucionales del sistema
|
// Versiones institucionales del sistema
|
||||||
const APP_VERSION = '3.8.2';
|
const APP_VERSION = '3.8.3';
|
||||||
const FRONTEND_VERSION = '3.8.2';
|
const FRONTEND_VERSION = '3.8.3';
|
||||||
const BACKEND_VERSION = '3.8.2';
|
const BACKEND_VERSION = '3.8.3';
|
||||||
|
|
||||||
env.addGlobal('app_version', APP_VERSION);
|
env.addGlobal('app_version', APP_VERSION);
|
||||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ const handleGoogleSheetsImport = async (req, res, justSynced = false) => {
|
|||||||
if (req.body.single_date_only === 'true' || req.body.single_date_only === true || req.body.single_date_only === 'on') {
|
if (req.body.single_date_only === 'true' || req.body.single_date_only === true || req.body.single_date_only === 'on') {
|
||||||
syncPayload.single_date_only = true;
|
syncPayload.single_date_only = true;
|
||||||
}
|
}
|
||||||
|
if (req.body.weeks_to_generate) {
|
||||||
|
syncPayload.weeks_to_generate = parseInt(req.body.weeks_to_generate, 10);
|
||||||
|
}
|
||||||
|
if (req.body.date_from) syncPayload.date_from = req.body.date_from.trim();
|
||||||
|
if (req.body.date_to) syncPayload.date_to = req.body.date_to.trim();
|
||||||
// Toggles granulares de entidades
|
// Toggles granulares de entidades
|
||||||
syncPayload.import_careers = req.body.import_careers === 'true' || req.body.import_careers === true || req.body.import_careers === 'on';
|
syncPayload.import_careers = req.body.import_careers === 'true' || req.body.import_careers === true || req.body.import_careers === 'on';
|
||||||
syncPayload.import_subjects = req.body.import_subjects === 'true' || req.body.import_subjects === true || req.body.import_subjects === 'on';
|
syncPayload.import_subjects = req.body.import_subjects === 'true' || req.body.import_subjects === true || req.body.import_subjects === 'on';
|
||||||
@@ -164,6 +169,9 @@ const handleGoogleSheetsImport = async (req, res, justSynced = false) => {
|
|||||||
filter_days: req.body?.filter_days || ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
filter_days: req.body?.filter_days || ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||||
manual_date: req.body?.manual_date || '',
|
manual_date: req.body?.manual_date || '',
|
||||||
single_date_only: req.body?.single_date_only === 'true' || req.body?.single_date_only === 'on',
|
single_date_only: req.body?.single_date_only === 'true' || req.body?.single_date_only === 'on',
|
||||||
|
weeks_to_generate: req.body?.weeks_to_generate || 16,
|
||||||
|
date_from: req.body?.date_from || '',
|
||||||
|
date_to: req.body?.date_to || '',
|
||||||
flash_msg: flashMsg,
|
flash_msg: flashMsg,
|
||||||
flash_type: flashType
|
flash_type: flashType
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -310,15 +310,127 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 4. Alcance Temporal de la Cursada y Generación de Reservas -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<div class="p-3 border rounded bg-body-tertiary">
|
||||||
|
<div class="d-flex flex-wrap justify-content-between align-items-center mb-3 gap-2">
|
||||||
|
<div>
|
||||||
|
<label class="form-label fw-bold small text-uppercase text-secondary mb-0">
|
||||||
|
<i class="bi bi-clock-history text-primary me-1"></i>3. Alcance Temporal de la Cursada (Generación de Reservas):
|
||||||
|
</label>
|
||||||
|
<span class="d-block text-muted small">Elija el número de semanas a importar, un rango de fechas (Desde - Hasta) o importe para una fecha puntual.</span>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group btn-group-sm" role="group" aria-label="Modo de Alcance Temporal">
|
||||||
|
<input type="radio" class="btn-check" name="temporal_mode_selector" id="mode_weeks" autocomplete="off" {% if not single_date_only and not date_from %}checked{% endif %} onchange="onTemporalModeChange('weeks')">
|
||||||
|
<label class="btn btn-outline-primary py-1 px-3 fw-semibold" for="mode_weeks">
|
||||||
|
<i class="bi bi-calendar-week me-1"></i>Por Semanas
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="radio" class="btn-check" name="temporal_mode_selector" id="mode_range" autocomplete="off" {% if not single_date_only and date_from %}checked{% endif %} onchange="onTemporalModeChange('range')">
|
||||||
|
<label class="btn btn-outline-primary py-1 px-3 fw-semibold" for="mode_range">
|
||||||
|
<i class="bi bi-calendar-range me-1"></i>Rango de Fechas
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="radio" class="btn-check" name="temporal_mode_selector" id="mode_single" autocomplete="off" {% if single_date_only %}checked{% endif %} onchange="onTemporalModeChange('single')">
|
||||||
|
<label class="btn btn-outline-primary py-1 px-3 fw-semibold" for="mode_single">
|
||||||
|
<i class="bi bi-pin-angle-fill me-1"></i>Fecha Puntual Única
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Panel: Por Semanas -->
|
||||||
|
<div id="panel_temporal_weeks" class="p-3 bg-white border rounded shadow-sm {% if single_date_only or date_from %}d-none{% endif %}">
|
||||||
|
<div class="row g-3 align-items-center">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="weeks_to_generate" class="form-label fw-semibold small mb-1">
|
||||||
|
Número de Semanas Consecutivas a Generar:
|
||||||
|
</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<span class="input-group-text bg-body-secondary"><i class="bi bi-hash"></i></span>
|
||||||
|
<input type="number" class="form-control" id="weeks_to_generate" name="weeks_to_generate"
|
||||||
|
value="{{ weeks_to_generate or 16 }}" min="1" max="30" step="1" oninput="onWeeksInputChange(this.value)">
|
||||||
|
<span class="input-group-text">semanas</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<label class="form-label fw-semibold small mb-1 text-muted">Accesos Rápidos:</label>
|
||||||
|
<div class="d-flex flex-wrap gap-2">
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(1)">1 sem (Corte semanal)</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(4)">4 sem (1 Mes)</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(8)">8 sem (Medio Cuat.)</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary py-1 px-2 fw-semibold" onclick="setWeeksValue(16)">16 sem (Cuatrimestre Regular)</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-text small mt-2">
|
||||||
|
<i class="bi bi-info-circle me-1"></i>Genera $N$ clases consecutivas para el día de cursada a partir de la fecha base de cuatrimestre o la fecha manual sugerida.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Panel: Rango de Fechas (Desde - Hasta) -->
|
||||||
|
<div id="panel_temporal_range" class="p-3 bg-white border rounded shadow-sm {% if single_date_only or not date_from %}d-none{% endif %}">
|
||||||
|
<div class="row g-3 align-items-center">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<label for="date_from" class="form-label fw-semibold small mb-1">
|
||||||
|
<i class="bi bi-calendar-event text-success me-1"></i>Fecha de Inicio (Desde):
|
||||||
|
</label>
|
||||||
|
<input type="date" class="form-control form-control-sm" id="date_from" name="date_from" value="{{ date_from }}" onchange="onRangeInputChange()">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<label for="date_to" class="form-label fw-semibold small mb-1">
|
||||||
|
<i class="bi bi-calendar-check text-danger me-1"></i>Fecha de Fin (Hasta):
|
||||||
|
</label>
|
||||||
|
<input type="date" class="form-control form-control-sm" id="date_to" name="date_to" value="{{ date_to }}" onchange="onRangeInputChange()">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2 d-flex align-items-end">
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-secondary w-100" onclick="clearDateRange()">
|
||||||
|
<i class="bi bi-eraser me-1"></i>Limpiar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-text small mt-2">
|
||||||
|
<i class="bi bi-info-circle me-1"></i>El sistema calcula automáticamente todos los días de cursada correspondientes a cada comisión dentro del intervalo cerrado [Desde, Hasta].
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Panel: Fecha Puntual Única -->
|
||||||
|
<div id="panel_temporal_single" class="p-3 bg-white border rounded shadow-sm {% if not single_date_only %}d-none{% endif %}">
|
||||||
|
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
|
||||||
|
<div>
|
||||||
|
<div class="form-check form-switch mb-1">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="single_date_only" name="single_date_only" value="true" {% if single_date_only %}checked{% endif %} onchange="onSingleDateSwitchChange()">
|
||||||
|
<label class="form-check-label fw-bold text-dark small" for="single_date_only">
|
||||||
|
<i class="bi bi-pin-angle-fill text-warning me-1"></i>Importar ÚNICAMENTE para fecha puntual
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<span class="d-block text-muted small ms-4">
|
||||||
|
Crea exactamente 1 sola asignación por fila en lugar del cuatrimestre regular (16 semanas).
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div style="min-width: 220px;">
|
||||||
|
<label for="single_punctual_date" class="form-label fw-semibold small mb-1 text-secondary">
|
||||||
|
Fecha Puntual Asignada:
|
||||||
|
</label>
|
||||||
|
<input type="date" class="form-control form-control-sm" id="single_punctual_date" value="{{ manual_date }}" onchange="syncSingleDateToManualDate(this.value)">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Opciones de Cursada y Acciones Principales -->
|
<!-- Opciones de Cursada y Acciones Principales -->
|
||||||
<div class="p-3 bg-body-tertiary rounded border mb-4">
|
<div class="p-3 bg-body-tertiary rounded border mb-4">
|
||||||
<div class="d-flex flex-wrap justify-content-between align-items-center gap-3">
|
<div class="d-flex flex-wrap justify-content-between align-items-center gap-3">
|
||||||
<div class="form-check form-switch mb-0">
|
<div class="d-flex align-items-center gap-2">
|
||||||
<input class="form-check-input" type="checkbox" role="switch" id="single_date_only" name="single_date_only" value="true" {% if single_date_only %}checked{% endif %}>
|
<span class="badge bg-secondary-subtle text-secondary border px-3 py-2 fw-semibold" id="temporalSummaryBadge">
|
||||||
<label class="form-check-label fw-semibold small" for="single_date_only">
|
{% if single_date_only %}
|
||||||
<i class="bi bi-pin-angle-fill text-warning me-1"></i>Importar ÚNICAMENTE para fecha puntual
|
<i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual {{ '(' + manual_date + ')' if manual_date else '' }}
|
||||||
</label>
|
{% elif date_from and date_to %}
|
||||||
<span class="d-block text-muted small">Crea 1 sola asignación por fila en lugar del cuatrimestre regular (16 semanas).</span>
|
<i class="bi bi-calendar-range me-1 text-info"></i>Alcance: Rango {{ date_from }} a {{ date_to }}
|
||||||
|
{% else %}
|
||||||
|
<i class="bi bi-calendar-week me-1 text-primary"></i>Alcance: {{ weeks_to_generate or 16 }} semanas regulares
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex gap-2">
|
<div class="d-flex gap-2">
|
||||||
<button type="button" class="btn btn-outline-primary px-3 shadow-sm fw-semibold" id="btnInspectSheet" onclick="inspectOnlineSheets()">
|
<button type="button" class="btn btn-outline-primary px-3 shadow-sm fw-semibold" id="btnInspectSheet" onclick="inspectOnlineSheets()">
|
||||||
@@ -477,8 +589,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong class="text-secondary"><i class="bi bi-clock-history me-1"></i>Generación:</strong>
|
<strong class="text-secondary"><i class="bi bi-clock-history me-1"></i>Generación:</strong>
|
||||||
<span class="badge {% if stats.filters_applied.single_date_only %}bg-warning-subtle text-warning border border-warning-subtle{% else %}bg-success-subtle text-success border border-success-subtle{% endif %}">
|
<span class="badge {% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %}bg-warning-subtle text-warning border border-warning-subtle{% elif stats.filters_applied.temporal_scope == 'date_range' %}bg-info-subtle text-info border border-info-subtle{% else %}bg-success-subtle text-success border border-success-subtle{% endif %}">
|
||||||
{{ 'Fecha puntual única (1 asignación)' if stats.filters_applied.single_date_only else 'Cuatrimestre regular (16 semanas)' }}
|
{% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %}
|
||||||
|
Fecha puntual única (1 asignación)
|
||||||
|
{% elif stats.filters_applied.temporal_scope == 'date_range' %}
|
||||||
|
Rango de fechas ({{ stats.filters_applied.date_from }} al {{ stats.filters_applied.date_to }})
|
||||||
|
{% else %}
|
||||||
|
Semanas regulares ({{ stats.filters_applied.weeks_to_generate or 16 }} semanas)
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -849,6 +967,15 @@
|
|||||||
if (m) m.value = '';
|
if (m) m.value = '';
|
||||||
const single = document.getElementById('single_date_only');
|
const single = document.getElementById('single_date_only');
|
||||||
if (single) single.checked = false;
|
if (single) single.checked = false;
|
||||||
|
const df = document.getElementById('date_from');
|
||||||
|
if (df) df.value = '';
|
||||||
|
const dt = document.getElementById('date_to');
|
||||||
|
if (dt) dt.value = '';
|
||||||
|
const w = document.getElementById('weeks_to_generate');
|
||||||
|
if (w) w.value = 16;
|
||||||
|
const radWeeks = document.getElementById('mode_weeks');
|
||||||
|
if (radWeeks) radWeeks.checked = true;
|
||||||
|
if (typeof onTemporalModeChange === 'function') onTemporalModeChange('weeks');
|
||||||
setDaysSelection('all');
|
setDaysSelection('all');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1186,6 +1313,89 @@
|
|||||||
alert('Se aplicó la fecha ' + val + ' a ' + updatedCount + ' fila(s) seleccionada(s).');
|
alert('Se aplicó la fecha ' + val + ' a ' + updatedCount + ' fila(s) seleccionada(s).');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gestión de Alcance Temporal (Por Semanas, Rango de Fechas, Fecha Puntual)
|
||||||
|
function onTemporalModeChange(mode) {
|
||||||
|
const pWeeks = document.getElementById('panel_temporal_weeks');
|
||||||
|
const pRange = document.getElementById('panel_temporal_range');
|
||||||
|
const pSingle = document.getElementById('panel_temporal_single');
|
||||||
|
const chkSingle = document.getElementById('single_date_only');
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
|
||||||
|
if (pWeeks) pWeeks.classList.add('d-none');
|
||||||
|
if (pRange) pRange.classList.add('d-none');
|
||||||
|
if (pSingle) pSingle.classList.add('d-none');
|
||||||
|
|
||||||
|
if (mode === 'weeks') {
|
||||||
|
if (pWeeks) pWeeks.classList.remove('d-none');
|
||||||
|
if (chkSingle) chkSingle.checked = false;
|
||||||
|
const w = document.getElementById('weeks_to_generate')?.value || 16;
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-week me-1 text-primary"></i>Alcance: ' + w + ' semanas regulares';
|
||||||
|
} else if (mode === 'range') {
|
||||||
|
if (pRange) pRange.classList.remove('d-none');
|
||||||
|
if (chkSingle) chkSingle.checked = false;
|
||||||
|
const df = document.getElementById('date_from')?.value;
|
||||||
|
const dt = document.getElementById('date_to')?.value;
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-range me-1 text-info"></i>Alcance: Rango ' + (df && dt ? (df + ' a ' + dt) : 'personalizado');
|
||||||
|
} else if (mode === 'single') {
|
||||||
|
if (pSingle) pSingle.classList.remove('d-none');
|
||||||
|
if (chkSingle) chkSingle.checked = true;
|
||||||
|
const mDate = document.getElementById('manual_date')?.value;
|
||||||
|
const sDate = document.getElementById('single_punctual_date');
|
||||||
|
if (sDate && mDate) sDate.value = mDate;
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual' + (mDate ? ' (' + mDate + ')' : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWeeksValue(val) {
|
||||||
|
const input = document.getElementById('weeks_to_generate');
|
||||||
|
if (input) {
|
||||||
|
input.value = val;
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-week me-1 text-primary"></i>Alcance: ' + val + ' semanas regulares';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onWeeksInputChange(val) {
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-week me-1 text-primary"></i>Alcance: ' + (val || 16) + ' semanas regulares';
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRangeInputChange() {
|
||||||
|
const df = document.getElementById('date_from')?.value;
|
||||||
|
const dt = document.getElementById('date_to')?.value;
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-range me-1 text-info"></i>Alcance: Rango ' + (df && dt ? (df + ' a ' + dt) : 'personalizado');
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearDateRange() {
|
||||||
|
const df = document.getElementById('date_from');
|
||||||
|
const dt = document.getElementById('date_to');
|
||||||
|
if (df) df.value = '';
|
||||||
|
if (dt) dt.value = '';
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-calendar-range me-1 text-info"></i>Alcance: Rango personalizado';
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSingleDateSwitchChange() {
|
||||||
|
const chk = document.getElementById('single_date_only');
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (chk && !chk.checked) {
|
||||||
|
const radWeeks = document.getElementById('mode_weeks');
|
||||||
|
if (radWeeks) radWeeks.checked = true;
|
||||||
|
onTemporalModeChange('weeks');
|
||||||
|
} else {
|
||||||
|
const mDate = document.getElementById('manual_date')?.value;
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual' + (mDate ? ' (' + mDate + ')' : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncSingleDateToManualDate(val) {
|
||||||
|
const mDate = document.getElementById('manual_date');
|
||||||
|
if (mDate) mDate.value = val;
|
||||||
|
const badge = document.getElementById('temporalSummaryBadge');
|
||||||
|
if (badge) badge.innerHTML = '<i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual' + (val ? ' (' + val + ')' : '');
|
||||||
|
}
|
||||||
|
|
||||||
// Modal de Confirmación de Sincronización
|
// Modal de Confirmación de Sincronización
|
||||||
function openSyncConfirmModal() {
|
function openSyncConfirmModal() {
|
||||||
const hasInspected = (window.inspectedRows && window.inspectedRows.length > 0);
|
const hasInspected = (window.inspectedRows && window.inspectedRows.length > 0);
|
||||||
@@ -1196,6 +1406,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validación de Rango de Fechas
|
||||||
|
const modeRange = document.getElementById('mode_range')?.checked;
|
||||||
|
const dateFrom = document.getElementById('date_from')?.value;
|
||||||
|
const dateTo = document.getElementById('date_to')?.value;
|
||||||
|
if (modeRange && dateFrom && dateTo && dateFrom > dateTo) {
|
||||||
|
alert('Error: La fecha de inicio (Desde: ' + dateFrom + ') no puede ser posterior a la fecha de fin (Hasta: ' + dateTo + ').');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Resumen de entidades marcadas
|
// Resumen de entidades marcadas
|
||||||
const chkRes = document.getElementById('chk_import_reservations')?.checked;
|
const chkRes = document.getElementById('chk_import_reservations')?.checked;
|
||||||
const chkCls = document.getElementById('chk_import_classrooms')?.checked;
|
const chkCls = document.getElementById('chk_import_classrooms')?.checked;
|
||||||
@@ -1212,6 +1431,19 @@
|
|||||||
html += '<li class="mb-1"><i class="bi bi-layers text-primary me-2"></i>Sincronización completa de las pestañas de días seleccionadas.</li>';
|
html += '<li class="mb-1"><i class="bi bi-layers text-primary me-2"></i>Sincronización completa de las pestañas de días seleccionadas.</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resumen de alcance temporal
|
||||||
|
const chkSingle = document.getElementById('single_date_only')?.checked;
|
||||||
|
const weeks = document.getElementById('weeks_to_generate')?.value || 16;
|
||||||
|
const manualDate = document.getElementById('manual_date')?.value;
|
||||||
|
|
||||||
|
if (chkSingle) {
|
||||||
|
html += '<li class="mt-2 text-warning fw-semibold"><i class="bi bi-pin-angle-fill me-2"></i>Alcance Temporal: 1 sola asignación puntual' + (manualDate ? ' (' + manualDate + ')' : '') + '</li>';
|
||||||
|
} else if (dateFrom && dateTo) {
|
||||||
|
html += '<li class="mt-2 text-info fw-semibold"><i class="bi bi-calendar-range me-2"></i>Alcance Temporal: Rango de fechas del ' + dateFrom + ' al ' + dateTo + '</li>';
|
||||||
|
} else {
|
||||||
|
html += '<li class="mt-2 text-primary fw-semibold"><i class="bi bi-calendar-week me-2"></i>Alcance Temporal: ' + weeks + ' semanas consecutivas</li>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '<li class="mt-2 text-muted fw-semibold">Entidades a crear / sincronizar:</li>';
|
html += '<li class="mt-2 text-muted fw-semibold">Entidades a crear / sincronizar:</li>';
|
||||||
if (chkRes) html += '<li class="ms-3"><i class="bi bi-calendar-check text-danger me-2"></i>Asignaciones de aulas (Reservas en Calendario)</li>';
|
if (chkRes) html += '<li class="ms-3"><i class="bi bi-calendar-check text-danger me-2"></i>Asignaciones de aulas (Reservas en Calendario)</li>';
|
||||||
if (chkCls) html += '<li class="ms-3"><i class="bi bi-door-open text-success me-2"></i>Aulas físicas y virtuales</li>';
|
if (chkCls) html += '<li class="ms-3"><i class="bi bi-door-open text-success me-2"></i>Aulas físicas y virtuales</li>';
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
# Plan Técnico: 005-importador-semanas-rango
|
||||||
|
|
||||||
|
## 1. Arquitectura y Componentes Afectados
|
||||||
|
|
||||||
|
### 1.1. Backend Core (`backend/`)
|
||||||
|
- **`app/models/subject.py` & `app/models/career.py`**:
|
||||||
|
- Garantizar `uselist=True` en `Subject.careers` y `Career.subjects` con anotaciones de lista explícitas (`List['Career']`, `List['Subject']`). *(Ya aplicado y verificado)*.
|
||||||
|
- **`app/services/sheets_importer.py`**:
|
||||||
|
- Ampliar firma de `sync(...)`:
|
||||||
|
```python
|
||||||
|
def sync(
|
||||||
|
self,
|
||||||
|
filter_career=None,
|
||||||
|
filter_subject=None,
|
||||||
|
filter_day=None,
|
||||||
|
filter_days=None,
|
||||||
|
manual_date=None,
|
||||||
|
single_date_only=False,
|
||||||
|
weeks_to_generate=16,
|
||||||
|
date_from=None,
|
||||||
|
date_to=None,
|
||||||
|
import_careers=True,
|
||||||
|
import_subjects=True,
|
||||||
|
import_commissions=True,
|
||||||
|
import_classrooms=True,
|
||||||
|
import_reservations=True,
|
||||||
|
selected_rows=None
|
||||||
|
):
|
||||||
|
```
|
||||||
|
- Lógica de cálculo de fechas por fila (`dates_to_generate`):
|
||||||
|
1. Si `row_specific_date` está presente en la fila: `[row_specific_date]`.
|
||||||
|
2. Si `single_date_only` y `manual_dt`: `[manual_dt]`.
|
||||||
|
3. Si `date_from_dt` y `date_to_dt`:
|
||||||
|
Calcular todas las fechas $d$ en el intervalo $[date\_from\_dt, date\_to\_dt]$ tales que $d.weekday() == effective\_day\_idx$.
|
||||||
|
4. En otro caso (por número de semanas):
|
||||||
|
Tomar $W = \max(1, \min(30, int(weeks\_to\_generate or 16)))$.
|
||||||
|
Generar $[base\_monday + timedelta(days=effective\_day\_idx, weeks=w) \text{ para } w \in [0..W-1]]$.
|
||||||
|
- **`app/services/dashboard_service.py`**:
|
||||||
|
- En `sync_sheets_data(data)`:
|
||||||
|
Extraer `weeks_to_generate`, `date_from`, `date_to` del payload y enviarlos al importador.
|
||||||
|
Reflejar `temporal_mode`, `weeks_to_generate`, `date_from`, `date_to` en las estadísticas retornadas (`stats['filters_applied']`).
|
||||||
|
- **`routers/admin.py`**:
|
||||||
|
- Validar los parámetros opcionales en el endpoint `/api/v1/admin/sync-sheets`.
|
||||||
|
|
||||||
|
### 1.2. Frontend BFF (`frontend/`)
|
||||||
|
- **`src/routes/admin.js`**:
|
||||||
|
- Propagar `weeks_to_generate`, `date_from`, `date_to`, `single_date_only`, `manual_date`, `time_scope_mode` en el payload de sincronización hacia el backend Core.
|
||||||
|
- **`views/admin/import.html`**:
|
||||||
|
- Incorporar selector de modalidad temporal mediante controles visuales Bootstrap 5:
|
||||||
|
- **Modo 1: Por Semanas**: Input numérico para $N$ semanas con badges de selección rápida (1 sem, 4 sem, 8 sem, 16 sem).
|
||||||
|
- **Modo 2: Rango de Fechas**: Dos campos `date_from` (Desde) y `date_to` (Hasta).
|
||||||
|
- **Modo 3: Fecha Puntual Única**: `single_date_only` activado con campo de fecha única puntual.
|
||||||
|
- Sincronización reactiva en JavaScript: al cambiar de modo, se habilitan o deshabilitan los inputs correspondientes y se actualiza el resumen del modal de confirmación.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Estrategia de Pruebas (Test-First)
|
||||||
|
- Crear `backend/tests/test_sheets_import_temporal_scope.py`:
|
||||||
|
1. `test_sync_single_date_only_creates_one_reservation()`
|
||||||
|
2. `test_sync_custom_weeks_count_creates_n_reservations()`
|
||||||
|
3. `test_sync_date_range_creates_reservations_within_range()`
|
||||||
|
4. `test_sync_multi_career_assignment_without_sa_instance_state_error()`
|
||||||
|
- Ejecución completa con `pytest tests -v` (61 tests esperados pasando).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Despliegue y Validación
|
||||||
|
- Bump a `v3.8.3`.
|
||||||
|
- Actualizar `CHANGELOG.md` y `MEMORY.md`.
|
||||||
|
- `git push origin dev` y despliegue SSH a `10.0.0.217`.
|
||||||
|
- Smoke test HTTP 200 en `/version` y verificación visual en `/admin/import`.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Espec: 005-importador-semanas-rango - Selección de Semanas, Rango de Fechas y Fecha Puntual en Importador
|
||||||
|
|
||||||
|
## 1. Visión General y Propósito
|
||||||
|
El importador de Google Sheets oficial de Bedelía actualmente generaba de manera rígida 16 semanas (cuatrimestre completo) o 1 sola asignación cuando se marcaba la opción de fecha puntual.
|
||||||
|
Bedelía requiere flexibilidad operativa total para poder:
|
||||||
|
1. **Elegir el número exacto de semanas a importar** (ej. 1, 2, 4, 8, 12, 16 semanas).
|
||||||
|
2. **Definir un rango de fechas explícito ("Desde" y "Hasta")** para importar reservas que caigan dentro de un período o corte de calendario específico.
|
||||||
|
3. **Importar ÚNICAMENTE para fecha puntual** (1 sola asignación por fila).
|
||||||
|
4. Resolver el error de asignación de carreras múltiples en asignaturas (`'list' object has no attribute '_sa_instance_state'`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Requisitos en Sintaxis EARS (Español Estricto)
|
||||||
|
|
||||||
|
### 2.1. Estrategias Temporales de Importación
|
||||||
|
- **RF-01 (Ubicuo)**: EL SISTEMA dispondrá en la interfaz de Bedelía (`/admin/import`) de tres modos de alcance temporal para la generación de reservas:
|
||||||
|
1. *Número de Semanas*: Permite ingresar un entero positivo (por defecto 16).
|
||||||
|
2. *Rango de Fechas (Desde - Hasta)*: Permite ingresar fecha de inicio (`date_from`) y fecha de fin (`date_to`).
|
||||||
|
3. *Fecha Puntual Única*: Crea 1 sola asignación por fila en la fecha especificada (`manual_date`).
|
||||||
|
- **RF-02 (Basado en Eventos)**: CUANDO el usuario elija el modo por número de semanas y defina $N$ semanas, EL SISTEMA generará reservas para las primeras $N$ semanas a partir de la fecha base del cuatrimestre o la fecha sugerida.
|
||||||
|
- **RF-03 (Basado en Eventos)**: CUANDO el usuario elija el modo por rango de fechas (`date_from` y `date_to`), EL SISTEMA calculará todas las fechas que correspondan al día de la semana de cada comisión dentro del intervalo cerrado `[date_from, date_to]` y generará las reservas correspondientes.
|
||||||
|
- **RF-04 (Basado en Eventos)**: CUANDO el usuario active "Importar ÚNICAMENTE para fecha puntual" (`single_date_only`), EL SISTEMA creará exactamente 1 reserva por fila en la fecha puntual designada.
|
||||||
|
- **RF-05 (No Deseado / Excepciones)**: SI el usuario ingresa un rango de fechas donde `date_from > date_to`, ENTONCES EL SISTEMA bloqueará la sincronización y mostrará una alerta indicando que la fecha inicial no puede ser posterior a la fecha final.
|
||||||
|
- **RF-06 (No Deseado / Excepciones)**: SI el número de semanas configurado es menor a 1 o superior a 30, ENTONCES EL SISTEMA limitará automáticamente el valor a los extremos válidos (1 a 30 semanas).
|
||||||
|
|
||||||
|
### 2.2. Robustez del Modelo de Asignaturas y Carreras
|
||||||
|
- **RF-07 (Ubicuo)**: EL SISTEMA preservará la relación Many-to-Many entre `Subject` y `Career` configurada con colección explícita (`uselist=True`), garantizando que la importación de asignaturas multi-carrera (ej. `ASIG00125`) asigne la lista de carreras sin arrojar excepciones de tipo `'list' object has no attribute '_sa_instance_state'`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Criterios de Aceptación y Finalización (DoD)
|
||||||
|
1. Selector interactivo en la vista `/admin/import` con opciones claras: "Cuatrimestre / Por Semanas", "Rango de Fechas (Desde - Hasta)" y "Fecha Puntual Única".
|
||||||
|
2. Endpoint `/api/v1/admin/sync-sheets` y servicio `GoogleSheetsImporter.sync()` procesando `weeks_to_generate`, `date_from`, `date_to`, `manual_date` y `single_date_only`.
|
||||||
|
3. Pruebas unitarias y de integración que verifiquen:
|
||||||
|
- Importación con 4 semanas generando exactamente 4 reservas.
|
||||||
|
- Importación con rango de fechas generando las fechas intermedias exactas.
|
||||||
|
- Importación con fecha puntual generando 1 sola reserva.
|
||||||
|
- Importación de materias multi-carrera sin errores de estado en SQLAlchemy.
|
||||||
|
4. Cero errores en `@[current_problems]` y Pyright (`0 errors, 0 warnings`).
|
||||||
|
5. Suite de tests automatizados al 100% aprobada.
|
||||||
|
6. Despliegue en producción institucional verificado en `https://eduspace.oemspot.com.ar`.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# Tareas de Implementación: 005-importador-semanas-rango
|
||||||
|
|
||||||
|
- [x] **Tarea 1: Pruebas Automatizadas (Test-First)**
|
||||||
|
- Archivo: `backend/tests/test_sheets_import_temporal_scope.py`
|
||||||
|
- Contenido:
|
||||||
|
- Test de importación con `single_date_only=True` (1 asignación por fila).
|
||||||
|
- Test de importación con `weeks_to_generate=4` (4 asignaciones consecutivas).
|
||||||
|
- Test de importación con rango `date_from` y `date_to` (asignaciones estrictamente dentro del rango).
|
||||||
|
- Test de importación de materia con múltiples carreras (`ASIG00125` o similar) sin errores de `_sa_instance_state`.
|
||||||
|
- Hecho cuando: Los tests reflejen la especificación y fallen o validen según corresponda.
|
||||||
|
|
||||||
|
- [x] **Tarea 2: Backend Core - Servicio `sheets_importer.py`**
|
||||||
|
- Archivos: `backend/app/services/sheets_importer.py`
|
||||||
|
- Contenido:
|
||||||
|
- Agregar parámetros `weeks_to_generate`, `date_from`, `date_to` a `sync(...)`.
|
||||||
|
- Implementar parser y normalización de fechas `date_from` y `date_to`.
|
||||||
|
- Generar fechas correspondientes al día lectivo dentro del intervalo o por cantidad de semanas.
|
||||||
|
- Exponer en `stats['filters_applied']` la configuración temporal seleccionada.
|
||||||
|
- Hecho cuando: `sheets_importer.py` genere las fechas precisas según el modo indicado.
|
||||||
|
|
||||||
|
- [x] **Tarea 3: Backend Core - Servicio y Routers**
|
||||||
|
- Archivos: `backend/app/services/dashboard_service.py`, `backend/routers/admin.py`
|
||||||
|
- Contenido:
|
||||||
|
- Extraer parámetros temporales en `sync_sheets_data(data)` y pasarlos a `importer.sync(...)`.
|
||||||
|
- Validar en router que si se envía `date_from` y `date_to`, `date_from <= date_to`.
|
||||||
|
- Hecho cuando: El endpoint `/api/v1/admin/sync-sheets` acepte y aplique los parámetros temporales.
|
||||||
|
|
||||||
|
- [x] **Tarea 4: Frontend BFF e Interfaz de Usuario**
|
||||||
|
- Archivos: `frontend/src/routes/admin.js`, `frontend/views/admin/import.html`
|
||||||
|
- Contenido:
|
||||||
|
- Diseñar bloque de configuración temporal en `import.html` con 3 opciones claras:
|
||||||
|
1. Por Semanas (Input numérico + badges rápidos: 1, 4, 8, 16 semanas).
|
||||||
|
2. Rango de Fechas (Campos Desde y Hasta con datepickers).
|
||||||
|
3. Fecha Puntual Única (Switch `single_date_only` + campo de fecha puntual).
|
||||||
|
- Manejar la interacción JavaScript para alternar visibilidad o habilitación de campos según la opción elegida.
|
||||||
|
- Actualizar modal de confirmación mostrando el resumen temporal.
|
||||||
|
- Adaptar `admin.js` para recibir y enviar los campos en el payload JSON.
|
||||||
|
- Hecho cuando: Bedelía pueda elegir visualmente semanas, rango o fecha puntual y ver el resultado exacto en el resumen.
|
||||||
|
|
||||||
|
- [x] **Tarea 5: Verificación Integral, Cero Diagnósticos y Despliegue**
|
||||||
|
- Contenido:
|
||||||
|
- Ejecutar suite completa `pytest tests -v` (100% aprobada).
|
||||||
|
- Verificar `npx pyright` con 0 errores y 0 advertencias.
|
||||||
|
- Incrementar versión semántica a `v3.8.3` en backend y frontend.
|
||||||
|
- Actualizar `CHANGELOG.md` y `MEMORY.md`.
|
||||||
|
- `git push origin dev` y despliegue SSH a `10.0.0.217` con reinicio de servicios y smoke test HTTP 200 en `/version`.
|
||||||
|
- Hecho cuando: El servidor de producción esté corriendo `v3.8.3` activo y verificado.
|
||||||
Reference in New Issue
Block a user