This commit is contained in:
Lizandro Guarnizo
2026-01-06 15:35:59 -05:00
commit a768146f65
602 changed files with 42505 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\AuthUser;
class AuthUserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = AuthUser::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'username' => fake()->userName(),
'password' => fake()->password(),
'last_login' => fake()->dateTime(),
'is_superuser' => fake()->boolean(),
'first_name' => fake()->firstName(),
'last_name' => fake()->lastName(),
'email' => fake()->safeEmail(),
'is_staff' => fake()->boolean(),
'is_active' => fake()->boolean(),
'date_joined' => fake()->dateTime(),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Caja;
class CajaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Caja::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'monto_inicial' => fake()->randomFloat(2, 0, 99999999.99),
'monto_final' => fake()->randomFloat(2, 0, 99999999.99),
'fecha_apertura' => fake()->dateTime(),
'fecha_cierre' => fake()->dateTime(),
'estado' => fake()->randomElement(["Abierta","Cerrada"]),
];
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Categoria;
class CategoriaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Categoria::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'nombre' => fake()->regexify('[A-Za-z0-9]{255}'),
'descripcion' => fake()->text(),
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Cliente;
class ClienteFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Cliente::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'nombre' => fake()->regexify('[A-Za-z0-9]{255}'),
'correo' => fake()->regexify('[A-Za-z0-9]{255}'),
'telefono' => fake()->regexify('[A-Za-z0-9]{20}'),
'direccion' => fake()->text(),
'tipo_documento' => fake()->randomElement(["DNI","RUC","PASAPORTE"]),
'numero_documento' => fake()->regexify('[A-Za-z0-9]{20}'),
];
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Color;
class ColorFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Color::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'hex_code' => fake()->regexify('[A-Za-z0-9]{7}'),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Compra;
use App\Models\Proveedore;
class CompraFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Compra::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'fecha' => fake()->dateTime(),
'proveedor_id' => Proveedore::factory(),
'total' => fake()->randomFloat(2, 0, 99999999.99),
'estado' => fake()->randomElement(["Recibida","Pendiente","Anulada"]),
];
}
}
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Compra;
use App\Models\DetalleCompra;
use App\Models\Producto;
class DetalleCompraFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = DetalleCompra::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'compra_id' => Compra::factory(),
'producto_id' => Producto::factory(),
'cantidad' => fake()->numberBetween(-10000, 10000),
'precio_unitario' => fake()->randomFloat(2, 0, 99999999.99),
'subtotal' => fake()->randomFloat(2, 0, 99999999.99),
];
}
}
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\DetalleVenta;
use App\Models\Producto;
use App\Models\Venta;
class DetalleVentaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = DetalleVenta::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'venta_id' => Venta::factory(),
'producto_id' => Producto::factory(),
'cantidad' => fake()->numberBetween(-10000, 10000),
'precio_unitario' => fake()->randomFloat(2, 0, 99999999.99),
'subtotal' => fake()->randomFloat(2, 0, 99999999.99),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Inventario;
use App\Models\Producto;
class InventarioFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Inventario::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'producto_id' => Producto::factory(),
'stock_actual' => fake()->numberBetween(-10000, 10000),
'stock_minimo' => fake()->numberBetween(-10000, 10000),
'ubicacion' => fake()->regexify('[A-Za-z0-9]{255}'),
];
}
}
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Caja;
use App\Models\MovimientoCaja;
class MovimientoCajaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = MovimientoCaja::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'caja_id' => Caja::factory(),
'tipo' => fake()->randomElement(["Ingreso","Egreso"]),
'monto' => fake()->randomFloat(2, 0, 99999999.99),
'descripcion' => fake()->text(),
'fecha' => fake()->dateTime(),
];
}
}
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\ProductVariant;
class ProductVariantFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ProductVariant::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'producto_id' => fake()->word(),
'color_id' => fake()->word(),
'size_id' => fake()->word(),
'stock' => fake()->numberBetween(-10000, 10000),
'sku' => fake()->regexify('[A-Za-z0-9]{50}'),
];
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Producto;
class ProductoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Producto::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'nombre' => fake()->regexify('[A-Za-z0-9]{100}'),
'descripcion' => fake()->text(),
'codigo_barras' => fake()->regexify('[A-Za-z0-9]{50}'),
'precio_compra' => fake()->word(),
'precio_venta' => fake()->word(),
'stock' => fake()->numberBetween(-10000, 10000),
'categoria_id' => fake()->word(),
'estado' => fake()->boolean(),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Proveedor;
class ProveedorFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Proveedor::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'nombre' => fake()->regexify('[A-Za-z0-9]{255}'),
'contacto' => fake()->regexify('[A-Za-z0-9]{255}'),
'telefono' => fake()->regexify('[A-Za-z0-9]{20}'),
'correo' => fake()->regexify('[A-Za-z0-9]{255}'),
'direccion' => fake()->text(),
];
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Role;
class RoleFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Role::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'description' => fake()->text(),
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Setting;
class SettingFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Setting::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'logo' => fake()->word(),
'description' => fake()->text(),
'primary_color' => fake()->word(),
'secondary_color' => fake()->word(),
'created_at' => fake()->dateTime(),
'updated_at' => fake()->dateTime(),
];
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Size;
class SizeFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Size::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'name' => fake()->name(),
];
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\User;
class UserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->safeEmail(),
'password' => fake()->password(),
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Cliente;
use App\Models\Venta;
class VentaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Venta::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'fecha' => fake()->dateTime(),
'cliente_id' => Cliente::factory(),
'total' => fake()->randomFloat(2, 0, 99999999.99),
'tipo_pago' => fake()->randomElement(["Efectivo","Tarjeta","Transferencia"]),
'estado' => fake()->randomElement(["Pagado","Pendiente","Anulado"]),
];
}
}