Comence con las vistas. El modelo de agenda está practicamente terminado

This commit is contained in:
Lucho
2026-03-25 13:51:02 -03:00
parent 6c2c300d6e
commit 25f4b73b68
29 changed files with 3267 additions and 319 deletions
+46
View File
@@ -20,6 +20,11 @@ class Turno extends Model
'agenda_id',
'profesional_id',
'servicio_id',
'modalidad_id',
];
protected $casts = [
'inicio' => 'datetime',
];
public function estadoTurno()
@@ -45,4 +50,45 @@ class Turno extends Model
{
return $this->belongsTo(Servicio::class, 'servicio_id', 'id');
}
public function modalidad()
{
return $this->belongsTo(Modalidad::class, 'modalidad_id', 'id');
}
public function confirmar()
{
$this->estadoturno_id = 1; // ID del estado Confirmado (dato maestro)
$this->save();
return $this;
}
public function cancelar()
{
$this->estadoturno_id = 2; // ID del estado Cancelado (dato maestro)
$this->save();
return $this;
}
public function reprogramar()
{
$this->estadoturno_id = 3; // ID del estado Reprogramado (dato maestro)
$this->save();
return $this;
}
public function clienteAusente()
{
$this->estadoturno_id = 4; // ID del estado Cliente Ausente (dato maestro)
$this->save();
return $this;
}
public function clientePresente()
{
$this->estadoturno_id = 5; // ID del estado Cliente Presente (dato maestro)
$this->save();
return $this;
}
}