From 79333b46ff37c37ab359f7e2920cf493d824fe25 Mon Sep 17 00:00:00 2001 From: nicolasarana <90768149+nicolasarana@users.noreply.github.com> Date: Wed, 8 Jul 2026 12:55:51 -0300 Subject: [PATCH 1/2] CIT : Agendas con bloques sin horario libre en el medio --- .../planificar-agenda.component.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts index b37a1844bf..3774b174a5 100644 --- a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts +++ b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts @@ -749,6 +749,22 @@ export class PlanificarAgendaComponent implements OnInit { } }); }); + + // Verifica que los bloques sean consecutivos sin horario libre entre ellos + if (bloques.length > 1) { + const bloquesOrdenados = [...bloques].sort((a, b) => this.compararFechas(a.horaInicio, b.horaInicio)); + for (let i = 0; i < bloquesOrdenados.length - 1; i++) { + const actual = bloquesOrdenados[i]; + const siguiente = bloquesOrdenados[i + 1]; + if (actual.horaFin && siguiente.horaInicio) { + const finActual = this.combinarFechas(this.fecha, actual.horaFin); + const iniSiguiente = this.combinarFechas(this.fecha, siguiente.horaInicio); + if (this.compararFechas(finActual, iniSiguiente) !== 0) { + this.alertas.push('El bloque 2 tiene que empezar exactamente cuando termina el bloque 1'); + } + } + } + } } } @@ -766,6 +782,11 @@ export class PlanificarAgendaComponent implements OnInit { } onSave($event, clonar: Boolean) { + this.validarTodo(); + if (this.alertas.length > 0) { + this.hideGuardar = false; + return; + } this.hideGuardar = true; if (this.dinamica) { this.modelo.dinamica = true; From c3cbbd7a46542255388ab4f91263a55ee7070fd2 Mon Sep 17 00:00:00 2001 From: nicolasarana <90768149+nicolasarana@users.noreply.github.com> Date: Tue, 21 Jul 2026 09:05:07 -0300 Subject: [PATCH 2/2] =?UTF-8?q?CIT-423=20:=20"Agregar=20tipo=20de=20presta?= =?UTF-8?q?ci=C3=B3n=20al=20sidebar=20del=20bloques"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operaciones-agenda/planificar-agenda.component.ts | 8 ++++++++ .../operaciones-agenda/planificar-agenda.html | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts index 3774b174a5..f92f1750f9 100644 --- a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts +++ b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.component.ts @@ -1023,6 +1023,14 @@ export class PlanificarAgendaComponent implements OnInit { this.showModal = false; } + getPrestacionesActivas(bloque): string { + if (!bloque.tipoPrestaciones) { + return ''; + } + const activas = bloque.tipoPrestaciones.filter(p => p.activo); + return activas.map(p => p.nombre).join(', '); + } + isMobile() { return this.breakpointObserver.isMatched('(max-width: 599px)'); } diff --git a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.html b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.html index 85924a0d04..b4629ec976 100644 --- a/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.html +++ b/src/app/components/turnos/gestor-agendas/operaciones-agenda/planificar-agenda.html @@ -118,7 +118,10 @@ - +