Merge branch 'giane' of https://github.com/BryamE/ProyectoLauck into giane
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->enum('role', ['admin', 'employee'])->default('employee')->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('role');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('clients', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('phone')->nullable(); // Clave para WhatsApp
|
||||
$table->string('email')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('clients');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('appointments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// Si se borra cliente, se borran sus turnos
|
||||
$table->foreignId('client_id')->constrained()->onDelete('cascade');
|
||||
|
||||
$table->dateTime('scheduled_at'); // Fecha y hora del turno
|
||||
$table->string('bike_model');
|
||||
$table->text('problem_description'); // Ej: "Hace ruido la caja"
|
||||
|
||||
$table->enum('status', ['pending', 'confirmed', 'in_progress', 'ready', 'delivered'])
|
||||
->default('pending');
|
||||
|
||||
$table->text('notes')->nullable(); // Notas internas del mecánico
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('appointments');
|
||||
}
|
||||
};
|
||||
@@ -13,14 +13,19 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('codigo')->unique();
|
||||
$table->string('nombre');
|
||||
$table->decimal('costo', 12, 2);
|
||||
$table->decimal('precio', 12, 2);
|
||||
$table->integer('stock');
|
||||
$table->integer('min_stock')->default(5);
|
||||
$table->string('categoria');
|
||||
$table->text('descripcion');
|
||||
$table->string('name');
|
||||
$table->string('sku')->unique()->nullable(); // Código de barras o interno
|
||||
$table->text('description')->nullable();
|
||||
|
||||
$table->decimal('price', 10, 2); // Precio venta
|
||||
$table->decimal('cost', 10, 2)->nullable(); // Costo (solo admin)
|
||||
|
||||
$table->integer('stock_quantity')->default(0);
|
||||
$table->integer('min_stock_alert')->default(5); // Alerta
|
||||
|
||||
$table->enum('type', ['bike', 'accessory', 'service']);
|
||||
$table->string('serial_number')->nullable(); // Solo para bicis
|
||||
|
||||
$table->foreignId('suppliers_id')->constrained();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user