Add citas module: scheduling, calendar, blocked schedules

This commit is contained in:
2026-04-08 00:48:36 -06:00
parent e19eb205db
commit 91da97685f
21 changed files with 3406 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('citas', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('mensaje_id')->nullable();
$table->string('nombre_cliente', 255);
$table->string('email_cliente', 255);
$table->string('telefono_cliente', 50);
$table->string('servicio', 255);
$table->date('fecha');
$table->time('hora_inicio');
$table->time('hora_fin');
$table->integer('duracion')->default(60);
$table->enum('estado', ['pendiente', 'confirmada', 'completada', 'cancelada'])->default('pendiente');
$table->text('notas')->nullable();
$table->timestamps();
// Foreign key to mensajes table
$table->foreign('mensaje_id')
->references('id')
->on('mensajes')
->onDelete('set null');
});
}
public function down(): void
{
Schema::dropIfExists('citas');
}
};

View File

@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('horarios_bloqueados', function (Blueprint $table) {
$table->id();
$table->date('fecha');
$table->time('hora_inicio');
$table->time('hora_fin');
$table->string('motivo', 255)->nullable();
$table->boolean('activo')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('horarios_bloqueados');
}
};