Se terminó de crear los controladores con los métodos CRUD básicos. Lo siguiente es empezar a programar los métodos especificos de cada controlador

This commit is contained in:
Lucho
2026-03-21 09:53:45 -03:00
parent 7b7d81d5d0
commit 6c2c300d6e
95 changed files with 4010 additions and 61 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\AccionLog;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\AccionLog>
*/
class AccionLogFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = AccionLog::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->sentence(),
];
}
}
@@ -0,0 +1,36 @@
<?php
namespace Database\Factories;
use App\Models\Administrador;
use App\Models\CredencialProfesional;
use App\Models\Persona;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Administrador>
*/
class AdministradorFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Administrador::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'persona_id' => Persona::factory(),
'dni' => (string) $this->faker->unique()->numberBetween(20000000, 45000000),
'correo' => $this->faker->unique()->safeEmail(),
'credencialprofesional_id' => CredencialProfesional::factory(),
];
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use App\Models\Agenda;
use App\Models\Profesional;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Agenda>
*/
class AgendaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Agenda::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'estado' => $this->faker->randomElement(['Activa', 'Inactiva']),
'duracionturno' => $this->faker->randomElement([15, 30, 45, 60]),
'profesional_id' => Profesional::factory(),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\Baja;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Baja>
*/
class BajaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Baja::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'motivo' => $this->faker->optional()->sentence(),
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Models\Bug;
use App\Models\FotoBug;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Bug>
*/
class BugFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Bug::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'titulo' => $this->faker->sentence(4),
'descripcion' => $this->faker->paragraph(),
'prioridad' => $this->faker->randomElement(['baja', 'media', 'alta']),
'estado' => $this->faker->randomElement(['abierto', 'en progreso', 'cerrado']),
'version' => $this->faker->regexify('[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}'),
'fotobug_id' => $this->faker->optional()->then(fn () => FotoBug::factory()),
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Models\Cliente;
use App\Models\CredencialCliente;
use App\Models\Persona;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\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.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'dni' => (string) $this->faker->unique()->numberBetween(20000000, 45000000),
'correo' => $this->faker->unique()->safeEmail(),
'persona_id' => Persona::factory(),
'baja_id' => null,
'credencialcliente_id' => CredencialCliente::factory(),
];
}
}
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\ContenidoWeb;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ContenidoWeb>
*/
class ContenidoWebFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ContenidoWeb::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'quienessomos' => $this->faker->paragraph(3),
];
}
}
@@ -0,0 +1,35 @@
<?php
namespace Database\Factories;
use App\Models\CredencialCliente;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CredencialCliente>
*/
class CredencialClienteFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = CredencialCliente::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'contra' => Hash::make('password'),
'correo' => $this->faker->unique()->safeEmail(),
'token' => null,
'fecha_hora' => null,
];
}
}
@@ -0,0 +1,36 @@
<?php
namespace Database\Factories;
use App\Models\CredencialProfesional;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CredencialProfesional>
*/
class CredencialProfesionalFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = CredencialProfesional::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'usuario' => $this->faker->unique()->userName(),
'contra' => Hash::make('password'),
'rol' => $this->faker->randomElement(['Administrador', 'Profesional']),
'token' => null,
'fecha_hora' => null,
];
}
}
@@ -0,0 +1,35 @@
<?php
namespace Database\Factories;
use App\Models\Agenda;
use App\Models\Dia;
use App\Models\DiaDeAtencion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DiaDeAtencion>
*/
class DiaDeAtencionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = DiaDeAtencion::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->sentence(3),
'agenda_id' => Agenda::factory(),
'dia_id' => Dia::factory(),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\Dia;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Dia>
*/
class DiaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Dia::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->randomElement(['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo']),
];
}
}
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use App\Models\DiaPreferencia;
use App\Models\Formulario;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DiaPreferencia>
*/
class DiaPreferenciaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = DiaPreferencia::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->sentence(3),
'formulario_id' => Formulario::factory(),
];
}
}
@@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use App\Models\Cliente;
use App\Models\DocumentacionCliente;
use App\Models\Profesional;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentacionCliente>
*/
class DocumentacionClienteFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = DocumentacionCliente::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$extension = $this->faker->randomElement(['pdf', 'jpg', 'png']);
$nombre = $this->faker->word();
return [
'nombre' => $nombre,
'mime_type' => $this->faker->mimeType(),
'tamanio_bytes' => $this->faker->numberBetween(1024, 10_485_760),
'extension' => $extension,
'cliente_id' => Cliente::factory(),
'profesional_id' => Profesional::factory(),
];
}
}
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\EstadoProfesional;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\EstadoProfesional>
*/
class EstadoProfesionalFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = EstadoProfesional::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->randomElement(['Activo', 'Baja']),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\EstadoTurno;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\EstadoTurno>
*/
class EstadoTurnoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = EstadoTurno::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->randomElement(['Pendiente', 'Confirmado', 'Cancelado', 'Finalizado']),
];
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use App\Models\Agenda;
use App\Models\Feriado;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Feriado>
*/
class FeriadoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Feriado::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'fecha' => $this->faker->dateTimeBetween('-1 year', '+1 year')->format('Y-m-d'),
'descripcion' => $this->faker->sentence(3),
'agenda_id' => Agenda::factory(),
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Formulario;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Formulario>
*/
class FormularioFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Formulario::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'nombre' => $this->faker->sentence(3),
'descripcion' => $this->faker->paragraph(2),
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Models\FotoBug;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\FotoBug>
*/
class FotoBugFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = FotoBug::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$extension = $this->faker->randomElement(['png', 'jpg', 'jpeg']);
$nombre = $this->faker->word();
return [
'extension' => $extension,
'tamanio_bytes' => $this->faker->numberBetween(1024, 512000),
'nombre' => $nombre,
'mime_type' => "image/{$extension}",
];
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Database\Factories;
use App\Models\Foto;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Foto>
*/
class FotoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Foto::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$extension = $this->faker->randomElement(['png', 'jpg', 'jpeg']);
$nombre = $this->faker->word();
return [
'extension' => $extension,
'tamanio_bytes' => $this->faker->numberBetween(1024, 512000),
'nombre' => $nombre,
'mime_type' => "image/{$extension}",
'ruta' => "fotos/{$nombre}.{$extension}",
];
}
}
@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Models\DiaDeAtencion;
use App\Models\HorarioDeAtencion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\HorarioDeAtencion>
*/
class HorarioDeAtencionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = HorarioDeAtencion::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$start = $this->faker->time('H:i:s', '09:00:00');
$end = $this->faker->time('H:i:s', '18:00:00');
return [
'horariocomienzo' => $start,
'horariofin' => $end,
'diadeatencion_id' => DiaDeAtencion::factory(),
];
}
}
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use App\Models\Formulario;
use App\Models\HorarioPreferencia;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\HorarioPreferencia>
*/
class HorarioPreferenciaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = HorarioPreferencia::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->sentence(3),
'formulario_id' => Formulario::factory(),
];
}
}
@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Models\DiaDeAtencion;
use App\Models\HorarioReceso;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\HorarioReceso>
*/
class HorarioRecesoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = HorarioReceso::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$start = $this->faker->time('H:i:s', '12:00:00');
$end = $this->faker->time('H:i:s', '14:00:00');
return [
'comienzo' => $start,
'fin' => $end,
'diadeatencion_id' => DiaDeAtencion::factory(),
];
}
}
@@ -0,0 +1,38 @@
<?php
namespace Database\Factories;
use App\Models\AccionLog;
use App\Models\LogSeguridad;
use App\Models\Persona;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\LogSeguridad>
*/
class LogSeguridadFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = LogSeguridad::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->sentence(),
'fechahora' => $this->faker->dateTimeBetween('-1 month', 'now'),
'IPorigen' => $this->faker->ipv4(),
'rol' => $this->faker->randomElement(['Cliente', 'Profesional', 'Administrador']),
'accion_id' => AccionLog::factory(),
'persona_id' => Persona::factory(),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\Modalidad;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Modalidad>
*/
class ModalidadFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Modalidad::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'descripcion' => $this->faker->randomElement(['Presencial', 'Virtual']),
];
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use App\Models\Foto;
use App\Models\Persona;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Persona>
*/
class PersonaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Persona::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$dni = $this->faker->unique()->numberBetween(20000000, 45000000);
$cuilPrefix = $this->faker->randomElement(['20', '27']);
$cuilSuffix = $this->faker->numberBetween(0, 9);
return [
'dni' => (string) $dni,
'nombre' => $this->faker->firstName(),
'apellido' => $this->faker->lastName(),
'cuil' => "{$cuilPrefix}{$dni}{$cuilSuffix}",
'fechanac' => $this->faker->dateTimeBetween('-60 years', '-18 years')->format('Y-m-d'),
'foto_id' => Foto::factory(),
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Profesion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Profesion>
*/
class ProfesionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Profesion::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'titulo' => $this->faker->unique()->jobTitle(),
'visible_en_formulario' => $this->faker->boolean(80),
];
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace Database\Factories;
use App\Models\CredencialProfesional;
use App\Models\EstadoProfesional;
use App\Models\Persona;
use App\Models\Profesional;
use App\Models\Profesion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Profesional>
*/
class ProfesionalFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Profesional::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'matricula' => $this->faker->unique()->numerify('#####'),
'correo' => $this->faker->unique()->safeEmail(),
'dni' => (string) $this->faker->unique()->numberBetween(20000000, 45000000),
'persona_id' => Persona::factory(),
'profesion_id' => Profesion::factory(),
'credencialprofesional_id' => CredencialProfesional::factory(),
'estadoprofesional_id' => EstadoProfesional::factory(),
'baja_id' => null,
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Servicio;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Servicio>
*/
class ServicioFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Servicio::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'nombre' => $this->faker->words(3, true),
'descripcion' => $this->faker->sentence(12),
];
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use App\Models\Telefono;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Telefono>
*/
class TelefonoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Telefono::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'telefono' => $this->faker->phoneNumber(),
];
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use App\Models\Agenda;
use App\Models\Cliente;
use App\Models\EstadoTurno;
use App\Models\Profesional;
use App\Models\Servicio;
use App\Models\Turno;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Turno>
*/
class TurnoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Turno::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'inicio' => $this->faker->dateTimeBetween('-1 month', '+1 month'),
'correo' => $this->faker->unique()->safeEmail(),
'nombrecompleto' => $this->faker->name(),
'descripcion' => $this->faker->paragraph(),
'cliente_id' => Cliente::factory(),
'estadoturno_id' => EstadoTurno::factory(),
'agenda_id' => Agenda::factory(),
'profesional_id' => Profesional::factory(),
'servicio_id' => Servicio::factory(),
];
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use App\Models\ContenidoWeb;
use App\Models\Ubicacion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Ubicacion>
*/
class UbicacionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Ubicacion::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'link' => $this->faker->url(),
'contenidoweb_id' => ContenidoWeb::factory(),
];
}
}
@@ -15,10 +15,6 @@ return new class extends Migration
$table->id();
$table->timestamps();
$table->string('telefono');
$table->foreignId('persona_id')
->constrained('personas')
->onDelete('cascade');
});
}
@@ -23,10 +23,6 @@ return new class extends Migration
$table->foreignId('foto_id')
->constrained('fotos')
->onDelete('cascade');
$table->foreignId('telefono_id')
->constrained('telefonos')
->onDelete('cascade');
});
}
@@ -18,7 +18,7 @@ return new class extends Migration
$table->string('nombrecompleto');
$table->string('correo');
$table->string('celular');
$table->string('estado')->defalut('Pendiente');
$table->string('estado')->default('Pendiente');
$table->foreignId('profesion_id')
->constrained('profesiones');
@@ -37,16 +37,6 @@ return new class extends Migration
->constrained('clientes')
->onDelete('set null');
$table->foreignId('diapreferido_id')
->constrained('diaspreferencias')
->onDelete('cascade');
$table->foreignId('horariopreferido_id')
->constrained('horariospreferencias')
->onDelete('cascade');
$table->date('fechaenvio');
});
}
@@ -0,0 +1,32 @@
<?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('errores', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('codigo');
$table->text('mensaje');
$table->text('track_trace');
$table->string('url');
$table->datetime('fecha_hora');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('errores');
}
};
@@ -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('fotosbugs', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('extension')->nullable();
$table->bigInteger('tamanio_bytes')->nullable();
$table->string('nombre')->nullable();
$table->string('mime_type')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('fotosbugs');
}
};
@@ -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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('bugs', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('titulo');
$table->text('descripcion');
$table->string('prioridad');
$table->string('estado');
$table->string('version');
$table->foreignId('fotobug_id')->nullable()
->constrained('fotosbugs')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bugs');
}
};
+12 -5
View File
@@ -12,10 +12,17 @@ class BajaSeeder extends Seeder
*/
public function run(): void
{
$credencial = [
'dni' => '40987654',
'correo' => 'ficticio@gmail.com',
'persona_id' =>
]
$bajas = [
['motivo' => 'Cliente no responde'],
['motivo' => 'Servicio cancelado'],
];
foreach ($bajas as $baja) {
DB::table('bajas')->insert([
'motivo' => $baja['motivo'],
'created_at' => now(),
'updated_at' => now(),
]);
}
}
}
+1
View File
@@ -26,6 +26,7 @@ class DatabaseSeeder extends Seeder
ProfesionSeeder::class,
EstadoTurnoSeeder::class,
ModalidadSeeder::class,
HorarioPreferenciaSeeder::class,
AccionLogSeeder::class,
FotoSeeder::class,
PersonaSeeder::class,
@@ -0,0 +1,28 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class HorarioPreferenciaSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$horarios = [
['descripcion' => 'AM'],
['descripcion' => 'PM'],
];
foreach ($horarios as $horario) {
\Illuminate\Support\Facades\DB::table('horariospreferencias')->insert([
'descripcion' => $horario['descripcion'],
'created_at' => now(),
'updated_at' => now(),
]);
}
}
}