Add citas module: scheduling, calendar, blocked schedules
This commit is contained in:
38
database/migrations/2024_01_01_000008_create_citas_table.php
Normal file
38
database/migrations/2024_01_01_000008_create_citas_table.php
Normal 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');
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user