This commit is contained in:
Lizandro Guarnizo
2026-01-18 11:21:19 -05:00
parent 18c43fe06f
commit 33688d297c
21 changed files with 958 additions and 14 deletions
+2 -2
View File
@@ -22,9 +22,9 @@ class ProveedorFactory extends Factory
{
return [
'nombre' => fake()->regexify('[A-Za-z0-9]{255}'),
'contacto' => fake()->regexify('[A-Za-z0-9]{255}'),
'nit' => fake()->regexify('[A-Za-z0-9]{20}'),
'categoria' => fake()->randomElement(['talleres','tintoreria','proveedor']),
'telefono' => fake()->regexify('[A-Za-z0-9]{20}'),
'correo' => fake()->regexify('[A-Za-z0-9]{255}'),
'direccion' => fake()->text(),
];
}
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use App\Models\OrdenProduccion;
use App\Models\TrasladoPrenda;
use Illuminate\Database\Eloquent\Factories\Factory;
class TrasladoPrendaFactory extends Factory
{
protected $model = TrasladoPrenda::class;
public function definition()
{
return [
'orden_produccion_id' => OrdenProduccion::factory(),
'origen' => 'confeccion',
'destino' => 'tintoreria',
'cantidad_enviada' => $this->faker->numberBetween(1, 100),
'cantidad_recibida' => $this->faker->numberBetween(0, 100),
'prendas_defectuosas' => 0,
'reparaciones' => 0,
'saldos' => 0,
'residual' => 0,
'estado' => 'recibido',
];
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('traslados_prenda', function (Blueprint $table) {
$table->id();
$table->foreignId('orden_produccion_id')->constrained('orden_produccions')->onDelete('cascade');
$table->morphs('referencia');
$table->string('origen')->nullable();
$table->string('destino')->nullable();
$table->integer('cantidad_enviada')->default(0);
$table->integer('cantidad_recibida')->nullable();
$table->integer('prendas_defectuosas')->nullable();
$table->integer('reparaciones')->nullable();
$table->integer('saldos')->nullable();
$table->integer('residual')->nullable();
$table->timestamp('fecha_envio')->nullable();
$table->timestamp('fecha_recepcion')->nullable();
$table->string('estado')->default('pendiente');
$table->foreignId('ingresado_por')->nullable()->constrained('users');
$table->text('notas')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('traslados_prenda');
}
};