Creados un monton de componentes para reutilizar en las paginas, modificadas vistas, faltan agregar mas cosas

This commit is contained in:
BryamE
2025-12-06 19:52:33 -03:00
parent 7840cc79ae
commit 20e7da64de
22 changed files with 810 additions and 168 deletions
@@ -13,14 +13,19 @@ return new class extends Migration
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('nombre');
$table->string('marca');
$table->string('modelo');
$table->string('rodado');
$table->string('color');
$table->string('tipo');
$table->text('descripcion');
$table->float('precio');
$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->timestamps();
});
}
@@ -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');
}
};