diff --git a/app/Http/Controllers/AccionLogController.php b/app/Http/Controllers/AccionLogController.php new file mode 100644 index 0000000..f857d3c --- /dev/null +++ b/app/Http/Controllers/AccionLogController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new AccionLog())->getFillable()); + $accionLog = AccionLog::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $accionLog, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(AccionLog $accionLog): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $accionLog, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, AccionLog $accionLog): JsonResponse + { + $payload = $request->only((new AccionLog())->getFillable()); + $accionLog->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $accionLog, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(AccionLog $accionLog): JsonResponse + { + $accionLog->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/AdministradorController.php b/app/Http/Controllers/AdministradorController.php new file mode 100644 index 0000000..160d4f6 --- /dev/null +++ b/app/Http/Controllers/AdministradorController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Administrador())->getFillable()); + $administrador = Administrador::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $administrador, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Administrador $administrador): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $administrador, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Administrador $administrador): JsonResponse + { + $payload = $request->only((new Administrador())->getFillable()); + $administrador->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $administrador, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Administrador $administrador): JsonResponse + { + $administrador->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/AgendaController.php b/app/Http/Controllers/AgendaController.php new file mode 100644 index 0000000..9f15a46 --- /dev/null +++ b/app/Http/Controllers/AgendaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Agenda())->getFillable()); + $agenda = Agenda::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $agenda, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Agenda $agenda): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $agenda, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Agenda $agenda): JsonResponse + { + $payload = $request->only((new Agenda())->getFillable()); + $agenda->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $agenda, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Agenda $agenda): JsonResponse + { + $agenda->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/BajaController.php b/app/Http/Controllers/BajaController.php new file mode 100644 index 0000000..1620d3e --- /dev/null +++ b/app/Http/Controllers/BajaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Baja())->getFillable()); + $baja = Baja::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $baja, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Baja $baja): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $baja, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Baja $baja): JsonResponse + { + $payload = $request->only((new Baja())->getFillable()); + $baja->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $baja, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Baja $baja): JsonResponse + { + $baja->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/BugController.php b/app/Http/Controllers/BugController.php new file mode 100644 index 0000000..5f8a694 --- /dev/null +++ b/app/Http/Controllers/BugController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Bug())->getFillable()); + $bug = Bug::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $bug, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Bug $bug): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $bug, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Bug $bug): JsonResponse + { + $payload = $request->only((new Bug())->getFillable()); + $bug->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $bug, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Bug $bug): JsonResponse + { + $bug->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ClienteController.php b/app/Http/Controllers/ClienteController.php new file mode 100644 index 0000000..50db731 --- /dev/null +++ b/app/Http/Controllers/ClienteController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Cliente())->getFillable()); + $cliente = Cliente::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $cliente, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Cliente $cliente): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $cliente, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Cliente $cliente): JsonResponse + { + $payload = $request->only((new Cliente())->getFillable()); + $cliente->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $cliente, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Cliente $cliente): JsonResponse + { + $cliente->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ContenidoWebController.php b/app/Http/Controllers/ContenidoWebController.php new file mode 100644 index 0000000..11e1771 --- /dev/null +++ b/app/Http/Controllers/ContenidoWebController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new ContenidoWeb())->getFillable()); + $contenidoWeb = ContenidoWeb::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $contenidoWeb, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(ContenidoWeb $contenidoWeb): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $contenidoWeb, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, ContenidoWeb $contenidoWeb): JsonResponse + { + $payload = $request->only((new ContenidoWeb())->getFillable()); + $contenidoWeb->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $contenidoWeb, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(ContenidoWeb $contenidoWeb): JsonResponse + { + $contenidoWeb->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/CredencialClienteController.php b/app/Http/Controllers/CredencialClienteController.php new file mode 100644 index 0000000..82f1c2c --- /dev/null +++ b/app/Http/Controllers/CredencialClienteController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new CredencialCliente())->getFillable()); + $credencialCliente = CredencialCliente::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $credencialCliente, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(CredencialCliente $credencialCliente): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $credencialCliente, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, CredencialCliente $credencialCliente): JsonResponse + { + $payload = $request->only((new CredencialCliente())->getFillable()); + $credencialCliente->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $credencialCliente, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(CredencialCliente $credencialCliente): JsonResponse + { + $credencialCliente->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/CredencialProfesionalController.php b/app/Http/Controllers/CredencialProfesionalController.php new file mode 100644 index 0000000..acd052a --- /dev/null +++ b/app/Http/Controllers/CredencialProfesionalController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new CredencialProfesional())->getFillable()); + $credencialProfesional = CredencialProfesional::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $credencialProfesional, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(CredencialProfesional $credencialProfesional): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $credencialProfesional, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, CredencialProfesional $credencialProfesional): JsonResponse + { + $payload = $request->only((new CredencialProfesional())->getFillable()); + $credencialProfesional->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $credencialProfesional, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(CredencialProfesional $credencialProfesional): JsonResponse + { + $credencialProfesional->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DiaController.php b/app/Http/Controllers/DiaController.php new file mode 100644 index 0000000..7f1a260 --- /dev/null +++ b/app/Http/Controllers/DiaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Dia())->getFillable()); + $dia = Dia::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $dia, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Dia $dia): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $dia, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Dia $dia): JsonResponse + { + $payload = $request->only((new Dia())->getFillable()); + $dia->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $dia, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Dia $dia): JsonResponse + { + $dia->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DiaDeAtencionController.php b/app/Http/Controllers/DiaDeAtencionController.php new file mode 100644 index 0000000..cb2f3a3 --- /dev/null +++ b/app/Http/Controllers/DiaDeAtencionController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new DiaDeAtencion())->getFillable()); + $diaDeAtencion = DiaDeAtencion::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $diaDeAtencion, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(DiaDeAtencion $diaDeAtencion): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $diaDeAtencion, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, DiaDeAtencion $diaDeAtencion): JsonResponse + { + $payload = $request->only((new DiaDeAtencion())->getFillable()); + $diaDeAtencion->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $diaDeAtencion, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(DiaDeAtencion $diaDeAtencion): JsonResponse + { + $diaDeAtencion->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DiaPreferenciaController.php b/app/Http/Controllers/DiaPreferenciaController.php new file mode 100644 index 0000000..5b13255 --- /dev/null +++ b/app/Http/Controllers/DiaPreferenciaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new DiaPreferencia())->getFillable()); + $diaPreferencia = DiaPreferencia::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $diaPreferencia, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(DiaPreferencia $diaPreferencia): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $diaPreferencia, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, DiaPreferencia $diaPreferencia): JsonResponse + { + $payload = $request->only((new DiaPreferencia())->getFillable()); + $diaPreferencia->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $diaPreferencia, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(DiaPreferencia $diaPreferencia): JsonResponse + { + $diaPreferencia->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DocumentacionClienteController.php b/app/Http/Controllers/DocumentacionClienteController.php new file mode 100644 index 0000000..c8c794e --- /dev/null +++ b/app/Http/Controllers/DocumentacionClienteController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new DocumentacionCliente())->getFillable()); + $documentacionCliente = DocumentacionCliente::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $documentacionCliente, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(DocumentacionCliente $documentacionCliente): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $documentacionCliente, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, DocumentacionCliente $documentacionCliente): JsonResponse + { + $payload = $request->only((new DocumentacionCliente())->getFillable()); + $documentacionCliente->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $documentacionCliente, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(DocumentacionCliente $documentacionCliente): JsonResponse + { + $documentacionCliente->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ErrorController.php b/app/Http/Controllers/ErrorController.php new file mode 100644 index 0000000..ce78635 --- /dev/null +++ b/app/Http/Controllers/ErrorController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new ErrorModel())->getFillable()); + $error = ErrorModel::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $error, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(ErrorModel $error): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $error, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, ErrorModel $error): JsonResponse + { + $payload = $request->only((new ErrorModel())->getFillable()); + $error->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $error, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(ErrorModel $error): JsonResponse + { + $error->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/EstadoProfesionalController.php b/app/Http/Controllers/EstadoProfesionalController.php new file mode 100644 index 0000000..8c7c3e6 --- /dev/null +++ b/app/Http/Controllers/EstadoProfesionalController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new EstadoProfesional())->getFillable()); + $estadoProfesional = EstadoProfesional::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $estadoProfesional, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(EstadoProfesional $estadoProfesional): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $estadoProfesional, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, EstadoProfesional $estadoProfesional): JsonResponse + { + $payload = $request->only((new EstadoProfesional())->getFillable()); + $estadoProfesional->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $estadoProfesional, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(EstadoProfesional $estadoProfesional): JsonResponse + { + $estadoProfesional->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/EstadoTurnoController.php b/app/Http/Controllers/EstadoTurnoController.php new file mode 100644 index 0000000..6ab54e8 --- /dev/null +++ b/app/Http/Controllers/EstadoTurnoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new EstadoTurno())->getFillable()); + $estadoTurno = EstadoTurno::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $estadoTurno, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(EstadoTurno $estadoTurno): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $estadoTurno, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, EstadoTurno $estadoTurno): JsonResponse + { + $payload = $request->only((new EstadoTurno())->getFillable()); + $estadoTurno->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $estadoTurno, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(EstadoTurno $estadoTurno): JsonResponse + { + $estadoTurno->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/FeriadoController.php b/app/Http/Controllers/FeriadoController.php new file mode 100644 index 0000000..7e3c0e5 --- /dev/null +++ b/app/Http/Controllers/FeriadoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Feriado())->getFillable()); + $feriado = Feriado::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $feriado, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Feriado $feriado): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $feriado, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Feriado $feriado): JsonResponse + { + $payload = $request->only((new Feriado())->getFillable()); + $feriado->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $feriado, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Feriado $feriado): JsonResponse + { + $feriado->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/FormularioController.php b/app/Http/Controllers/FormularioController.php new file mode 100644 index 0000000..f62efaf --- /dev/null +++ b/app/Http/Controllers/FormularioController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Formulario())->getFillable()); + $formulario = Formulario::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $formulario, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Formulario $formulario): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $formulario, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Formulario $formulario): JsonResponse + { + $payload = $request->only((new Formulario())->getFillable()); + $formulario->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $formulario, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Formulario $formulario): JsonResponse + { + $formulario->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/FotoBugController.php b/app/Http/Controllers/FotoBugController.php new file mode 100644 index 0000000..2df8f14 --- /dev/null +++ b/app/Http/Controllers/FotoBugController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new FotoBug())->getFillable()); + $fotoBug = FotoBug::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $fotoBug, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(FotoBug $fotoBug): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $fotoBug, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, FotoBug $fotoBug): JsonResponse + { + $payload = $request->only((new FotoBug())->getFillable()); + $fotoBug->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $fotoBug, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(FotoBug $fotoBug): JsonResponse + { + $fotoBug->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/FotoController.php b/app/Http/Controllers/FotoController.php new file mode 100644 index 0000000..fb692e5 --- /dev/null +++ b/app/Http/Controllers/FotoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Foto())->getFillable()); + $foto = Foto::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $foto, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Foto $foto): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $foto, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Foto $foto): JsonResponse + { + $payload = $request->only((new Foto())->getFillable()); + $foto->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $foto, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Foto $foto): JsonResponse + { + $foto->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/HorarioDeAtencionController.php b/app/Http/Controllers/HorarioDeAtencionController.php new file mode 100644 index 0000000..48ffe69 --- /dev/null +++ b/app/Http/Controllers/HorarioDeAtencionController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new HorarioDeAtencion())->getFillable()); + $horarioDeAtencion = HorarioDeAtencion::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioDeAtencion, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(HorarioDeAtencion $horarioDeAtencion): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $horarioDeAtencion, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, HorarioDeAtencion $horarioDeAtencion): JsonResponse + { + $payload = $request->only((new HorarioDeAtencion())->getFillable()); + $horarioDeAtencion->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioDeAtencion, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(HorarioDeAtencion $horarioDeAtencion): JsonResponse + { + $horarioDeAtencion->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/HorarioPreferenciaController.php b/app/Http/Controllers/HorarioPreferenciaController.php new file mode 100644 index 0000000..866a107 --- /dev/null +++ b/app/Http/Controllers/HorarioPreferenciaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new HorarioPreferencia())->getFillable()); + $horarioPreferencia = HorarioPreferencia::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioPreferencia, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(HorarioPreferencia $horarioPreferencia): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $horarioPreferencia, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, HorarioPreferencia $horarioPreferencia): JsonResponse + { + $payload = $request->only((new HorarioPreferencia())->getFillable()); + $horarioPreferencia->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioPreferencia, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(HorarioPreferencia $horarioPreferencia): JsonResponse + { + $horarioPreferencia->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/HorarioRecesoController.php b/app/Http/Controllers/HorarioRecesoController.php new file mode 100644 index 0000000..7f4a339 --- /dev/null +++ b/app/Http/Controllers/HorarioRecesoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new HorarioReceso())->getFillable()); + $horarioReceso = HorarioReceso::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioReceso, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(HorarioReceso $horarioReceso): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $horarioReceso, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, HorarioReceso $horarioReceso): JsonResponse + { + $payload = $request->only((new HorarioReceso())->getFillable()); + $horarioReceso->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $horarioReceso, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(HorarioReceso $horarioReceso): JsonResponse + { + $horarioReceso->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/LogSeguridadController.php b/app/Http/Controllers/LogSeguridadController.php new file mode 100644 index 0000000..fc5a2a6 --- /dev/null +++ b/app/Http/Controllers/LogSeguridadController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new LogSeguridad())->getFillable()); + $logSeguridad = LogSeguridad::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $logSeguridad, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(LogSeguridad $logSeguridad): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $logSeguridad, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, LogSeguridad $logSeguridad): JsonResponse + { + $payload = $request->only((new LogSeguridad())->getFillable()); + $logSeguridad->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $logSeguridad, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(LogSeguridad $logSeguridad): JsonResponse + { + $logSeguridad->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ModalidadController.php b/app/Http/Controllers/ModalidadController.php new file mode 100644 index 0000000..68992d6 --- /dev/null +++ b/app/Http/Controllers/ModalidadController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Modalidad())->getFillable()); + $modalidad = Modalidad::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $modalidad, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Modalidad $modalidad): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $modalidad, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Modalidad $modalidad): JsonResponse + { + $payload = $request->only((new Modalidad())->getFillable()); + $modalidad->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $modalidad, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Modalidad $modalidad): JsonResponse + { + $modalidad->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ModoVacacionesController.php b/app/Http/Controllers/ModoVacacionesController.php new file mode 100644 index 0000000..a1a6e5d --- /dev/null +++ b/app/Http/Controllers/ModoVacacionesController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new ModoVacaciones())->getFillable()); + $modoVacaciones = ModoVacaciones::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $modoVacaciones, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(ModoVacaciones $modoVacaciones): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $modoVacaciones, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, ModoVacaciones $modoVacaciones): JsonResponse + { + $payload = $request->only((new ModoVacaciones())->getFillable()); + $modoVacaciones->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $modoVacaciones, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(ModoVacaciones $modoVacaciones): JsonResponse + { + $modoVacaciones->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/PersonaController.php b/app/Http/Controllers/PersonaController.php new file mode 100644 index 0000000..1f0ea6c --- /dev/null +++ b/app/Http/Controllers/PersonaController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Persona())->getFillable()); + $persona = Persona::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $persona, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Persona $persona): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $persona, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Persona $persona): JsonResponse + { + $payload = $request->only((new Persona())->getFillable()); + $persona->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $persona, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Persona $persona): JsonResponse + { + $persona->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ProfesionController.php b/app/Http/Controllers/ProfesionController.php new file mode 100644 index 0000000..ec5a132 --- /dev/null +++ b/app/Http/Controllers/ProfesionController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Profesion())->getFillable()); + $profesion = Profesion::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $profesion, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Profesion $profesion): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $profesion, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Profesion $profesion): JsonResponse + { + $payload = $request->only((new Profesion())->getFillable()); + $profesion->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $profesion, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Profesion $profesion): JsonResponse + { + $profesion->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ProfesionalController.php b/app/Http/Controllers/ProfesionalController.php new file mode 100644 index 0000000..7e68931 --- /dev/null +++ b/app/Http/Controllers/ProfesionalController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Profesional())->getFillable()); + $profesional = Profesional::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $profesional, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Profesional $profesional): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $profesional, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Profesional $profesional): JsonResponse + { + $payload = $request->only((new Profesional())->getFillable()); + $profesional->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $profesional, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Profesional $profesional): JsonResponse + { + $profesional->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ServicioController.php b/app/Http/Controllers/ServicioController.php index 689956b..36d6f30 100644 --- a/app/Http/Controllers/ServicioController.php +++ b/app/Http/Controllers/ServicioController.php @@ -2,9 +2,78 @@ namespace App\Http\Controllers; +use App\Models\Servicio; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; class ServicioController extends Controller { - // -} + /** + * Display a listing of the resource. + */ + public function index(): JsonResponse + { + $items = Servicio::all(); + + return response()->json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Servicio())->getFillable()); + $servicio = Servicio::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $servicio, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Servicio $servicio): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $servicio, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Servicio $servicio): JsonResponse + { + $payload = $request->only((new Servicio())->getFillable()); + $servicio->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $servicio, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Servicio $servicio): JsonResponse + { + $servicio->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/TelefonoController.php b/app/Http/Controllers/TelefonoController.php new file mode 100644 index 0000000..49df94b --- /dev/null +++ b/app/Http/Controllers/TelefonoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Telefono())->getFillable()); + $telefono = Telefono::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $telefono, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Telefono $telefono): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $telefono, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Telefono $telefono): JsonResponse + { + $payload = $request->only((new Telefono())->getFillable()); + $telefono->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $telefono, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Telefono $telefono): JsonResponse + { + $telefono->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/TurnoController.php b/app/Http/Controllers/TurnoController.php new file mode 100644 index 0000000..2211f92 --- /dev/null +++ b/app/Http/Controllers/TurnoController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Turno())->getFillable()); + $turno = Turno::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $turno, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Turno $turno): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $turno, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Turno $turno): JsonResponse + { + $payload = $request->only((new Turno())->getFillable()); + $turno->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $turno, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Turno $turno): JsonResponse + { + $turno->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/UbicacionController.php b/app/Http/Controllers/UbicacionController.php new file mode 100644 index 0000000..226a079 --- /dev/null +++ b/app/Http/Controllers/UbicacionController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new Ubicacion())->getFillable()); + $ubicacion = Ubicacion::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $ubicacion, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(Ubicacion $ubicacion): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $ubicacion, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, Ubicacion $ubicacion): JsonResponse + { + $payload = $request->only((new Ubicacion())->getFillable()); + $ubicacion->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $ubicacion, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(Ubicacion $ubicacion): JsonResponse + { + $ubicacion->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php new file mode 100644 index 0000000..8e86cc9 --- /dev/null +++ b/app/Http/Controllers/UserController.php @@ -0,0 +1,79 @@ +json([ + 'success' => true, + 'data' => $items, + 'message' => 'Registros obtenidos correctamente', + ], 200); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): JsonResponse + { + $payload = $request->only((new User())->getFillable()); + $user = User::create($payload); + + return response()->json([ + 'success' => true, + 'data' => $user, + 'message' => 'Registro creado correctamente', + ], 201); + } + + /** + * Display the specified resource. + */ + public function show(User $user): JsonResponse + { + return response()->json([ + 'success' => true, + 'data' => $user, + 'message' => 'Registro obtenido correctamente', + ], 200); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, User $user): JsonResponse + { + $payload = $request->only((new User())->getFillable()); + $user->update($payload); + + return response()->json([ + 'success' => true, + 'data' => $user, + 'message' => 'Registro actualizado correctamente', + ], 200); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(User $user): JsonResponse + { + $user->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Registro eliminado correctamente', + ], 200); + } +} \ No newline at end of file diff --git a/app/Models/Bug.php b/app/Models/Bug.php new file mode 100644 index 0000000..571f1c7 --- /dev/null +++ b/app/Models/Bug.php @@ -0,0 +1,27 @@ +belongsTo(FotoBug::class, 'fotobug_id', 'id'); + } +} diff --git a/app/Models/DiaPreferencia.php b/app/Models/DiaPreferencia.php index b3273f8..7e2b4ba 100644 --- a/app/Models/DiaPreferencia.php +++ b/app/Models/DiaPreferencia.php @@ -16,8 +16,8 @@ use HasFactory; 'formulario_id', ]; - public function formulario() + public function formularios() { - return $this->belongsToMany(Formulario::class, 'formulario_diapreferencia','diapreferencia_id','formulario_id'); + return $this->belongsToMany(Formulario::class, 'formularios_diaspreferidos', 'diapreferencia_id', 'formulario_id'); } } diff --git a/app/Models/DocumentacionCliente.php b/app/Models/DocumentacionCliente.php index 1a22fe4..2ac195c 100644 --- a/app/Models/DocumentacionCliente.php +++ b/app/Models/DocumentacionCliente.php @@ -25,7 +25,7 @@ class DocumentacionCliente extends Model } public function profesional() { - return $this->belongsTo(Cliente::class, 'profesional_id','id'); + return $this->belongsTo(Profesional::class, 'profesional_id','id'); } } diff --git a/app/Models/Error.php b/app/Models/Error.php new file mode 100644 index 0000000..ab5d5cb --- /dev/null +++ b/app/Models/Error.php @@ -0,0 +1,21 @@ +belongTo(Agenda::class, 'agenda_id', 'id'); + return $this->belongsTo(Agenda::class, 'agenda_id', 'id'); } } diff --git a/app/Models/Formulario.php b/app/Models/Formulario.php index 96ce772..c4757a8 100644 --- a/app/Models/Formulario.php +++ b/app/Models/Formulario.php @@ -22,42 +22,43 @@ class Formulario extends Model 'profesional_id', 'cliente_id', 'fechaenvio', - 'horariopreferido_id', - 'diapreferido_id', ]; public function modalidad() { - return $this->belongTo(Modalidad::class, 'modalidad_id', 'id'); + return $this->belongsTo(Modalidad::class, 'modalidad_id', 'id'); } + public function profesion() { - return $this->belongTo(Profesion::class, 'profesion_id', 'id'); + return $this->belongsTo(Profesion::class, 'profesion_id', 'id'); } + public function servicio() { - return $this->belongTo(Servicio::class, 'modalidad_id', 'id'); + return $this->belongsTo(Servicio::class, 'servicio_id', 'id'); } + public function cliente() { - return $this->belongTo(Cliente::class, 'cliente_id', 'id'); + return $this->belongsTo(Cliente::class, 'cliente_id', 'id'); } public function profesional() { - return $this->belongToMany(Profesional::class, 'profesional_formulario', 'formulario_id', 'profesional_id') + return $this->belongsToMany(Profesional::class, 'profesionales_formularios', 'formulario_id', 'profesional_id') ->withPivot('estadoformulario') - ->withTimesTamps(); + ->withTimestamps(); } - public function diapreferido() + public function diasPreferidos() { - return $this->belongToMany(DiaPreferencia::class, 'formulario_diapreferido', 'formulario_id', 'diapreferido_id'); + return $this->belongsToMany(DiaPreferencia::class, 'formularios_diaspreferidos', 'formulario_id', 'diapreferencia_id'); } public function horariopreferido() { - return $this->belongToMany(HorarioPreferencia::class, 'formulario_horariopreferido', 'formulario_id', 'horariopreferido_id'); + return $this->belongsToMany(HorarioPreferencia::class, 'formularios_horariospreferidos', 'formulario_id', 'horariopreferencia_id'); } } diff --git a/app/Models/FotoBug.php b/app/Models/FotoBug.php new file mode 100644 index 0000000..91dde37 --- /dev/null +++ b/app/Models/FotoBug.php @@ -0,0 +1,25 @@ +hasOne(Bug::class, 'fotobug_id', 'id'); + } +} diff --git a/app/Models/HorarioDeAtencion.php b/app/Models/HorarioDeAtencion.php index 5a8def1..1727540 100644 --- a/app/Models/HorarioDeAtencion.php +++ b/app/Models/HorarioDeAtencion.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; class HorarioDeAtencion extends Model { use HasFactory; - protected $table = 'horarioatenciones'; + protected $table = 'horariosatenciones'; protected $fillable = [ 'horariocomienzo', @@ -18,7 +18,7 @@ class HorarioDeAtencion extends Model public function diaatencion() { - return $this->belongTo(DiaDeAtencion::class, 'diadeatencion_id', 'id'); + return $this->belongsTo(DiaDeAtencion::class, 'diadeatencion_id', 'id'); } } diff --git a/app/Models/HorarioPreferencia.php b/app/Models/HorarioPreferencia.php index 4e5dd57..3c8c32c 100644 --- a/app/Models/HorarioPreferencia.php +++ b/app/Models/HorarioPreferencia.php @@ -8,16 +8,15 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; class HorarioPreferencia extends Model { use HasFactory; - protected $table = ''; + protected $table = 'horariospreferencias'; protected $fillable = [ 'descripcion', - 'formulario_id', ]; - public function formulario() + public function formularios() { - return $this->belongToMany(Formulario::class, 'formulario_horariopreferencia', 'horariopreferencia_id', 'formulario_id'); + return $this->belongsToMany(Formulario::class, 'formularios_horariospreferidos', 'horariopreferencia_id', 'formulario_id'); } } diff --git a/app/Models/HorarioReceso.php b/app/Models/HorarioReceso.php index 8c86dff..bef682c 100644 --- a/app/Models/HorarioReceso.php +++ b/app/Models/HorarioReceso.php @@ -18,7 +18,7 @@ class HorarioReceso extends Model public function diaDeAtencion() { - return $this->belongTo(DiaDeAtencion::class, 'diadeatencion_id', 'id'); + return $this->belongsTo(DiaDeAtencion::class, 'diadeatencion_id', 'id'); } } diff --git a/app/Models/LogSeguridad.php b/app/Models/LogSeguridad.php index 4f2980c..033cbaa 100644 --- a/app/Models/LogSeguridad.php +++ b/app/Models/LogSeguridad.php @@ -9,7 +9,7 @@ class LogSeguridad extends Model { use HasFactory; - protected $table = 'logsseguridades'; + protected $table = 'logseguridades'; protected $fillable = [ 'descripcion', diff --git a/app/Models/ModoVacaciones.php b/app/Models/ModoVacaciones.php index 468b316..38eacab 100644 --- a/app/Models/ModoVacaciones.php +++ b/app/Models/ModoVacaciones.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; class ModoVacaciones extends Model { use HasFactory; - protected $table = 'modovacaciones'; + protected $table = 'modosvacaciones'; protected $fillable = [ 'inicio', @@ -19,7 +19,7 @@ class ModoVacaciones extends Model public function agenda() { - return $this->belongTo(Agenda::class, 'agenda_id', 'id'); + return $this->belongsTo(Agenda::class, 'agenda_id', 'id'); } } diff --git a/app/Models/Persona.php b/app/Models/Persona.php index d1ce747..26c71f1 100644 --- a/app/Models/Persona.php +++ b/app/Models/Persona.php @@ -17,8 +17,7 @@ class Persona extends Model 'apellido', 'cuil', 'fechanac', - 'foto_id', - 'telefono_id' + 'foto_id' ]; public function Foto() @@ -38,6 +37,6 @@ class Persona extends Model public function telefonos() { - return $this->belongsToMany(Telefono::class, 'persona_telefono', 'persona_id', 'telefono_id'); + return $this->belongsToMany(Telefono::class, 'personas_telefonos', 'persona_id', 'telefono_id'); } } diff --git a/app/Models/Profesional.php b/app/Models/Profesional.php index 615e3a3..d22f8a7 100644 --- a/app/Models/Profesional.php +++ b/app/Models/Profesional.php @@ -14,6 +14,7 @@ class Profesional extends Model protected $fillable = [ 'matricula', 'correo', + 'dni', 'credencialprofesional_id', 'estadoprofesional_id', 'persona_id', @@ -31,7 +32,7 @@ class Profesional extends Model public function credencialProfesional() { - return $this->belongsTo(CredencialeProfesionale::class, 'credencialprofesional_id', 'id'); + return $this->belongsTo(CredencialProfesional::class, 'credencialprofesional_id', 'id'); } public function estadoProfesional() @@ -73,7 +74,7 @@ class Profesional extends Model public function formularios() { - return $this->belongsToMany(Formulario::class, 'profesional_formulario', 'profesional_id', 'formulario_id') + return $this->belongsToMany(Formulario::class, 'profesionales_formularios', 'profesional_id', 'formulario_id') ->withPivot('estadoformulario') ->withTimestamps(); } diff --git a/app/Models/Servicio.php b/app/Models/Servicio.php index b066b78..a92cf6e 100644 --- a/app/Models/Servicio.php +++ b/app/Models/Servicio.php @@ -15,6 +15,7 @@ class Servicio extends Model 'titulo', 'estado', 'descripcion', + 'contenidoweb_id', 'profesion_id', 'foto_id', ]; @@ -50,7 +51,7 @@ class Servicio extends Model public function profesional() { - return $this->belongsToMany(Profesional::class, 'profesional_servicio', 'servicio_id', 'profesional_id'); + return $this->belongsToMany(Profesional::class, 'profesionales_servicios', 'servicio_id', 'profesional_id'); } diff --git a/app/Models/Telefono.php b/app/Models/Telefono.php index 2349768..b8ae585 100644 --- a/app/Models/Telefono.php +++ b/app/Models/Telefono.php @@ -16,6 +16,6 @@ class Telefono extends Model public function persona() { - return $this->belongToMany(Persona::class, 'persona_telefono', 'telefono_id', 'persona_id'); + return $this->belongsToMany(Persona::class, 'personas_telefonos', 'telefono_id', 'persona_id'); } } diff --git a/app/Models/Turno.php b/app/Models/Turno.php index b33f5d5..6f693b4 100644 --- a/app/Models/Turno.php +++ b/app/Models/Turno.php @@ -38,11 +38,11 @@ class Turno extends Model public function profesional() { - return $this->belongTo(Profesional::class, 'profesional_id', 'id'); + return $this->belongsTo(Profesional::class, 'profesional_id', 'id'); } public function servicio() { - return $this->belongTo(Servicio::class, 'servicio_id', 'id'); + return $this->belongsTo(Servicio::class, 'servicio_id', 'id'); } } diff --git a/app/Models/Ubicacion.php b/app/Models/Ubicacion.php index ae1a7b6..2a8bac5 100644 --- a/app/Models/Ubicacion.php +++ b/app/Models/Ubicacion.php @@ -16,6 +16,6 @@ class Ubicacion extends Model public function contenidoweb() { - return $this->belongsTo(ContenidoWeb::class, 'contenido_id','id'); + return $this->belongsTo(ContenidoWeb::class, 'contenidoweb_id','id'); } } diff --git a/database/factories/AccionLogFactory.php b/database/factories/AccionLogFactory.php new file mode 100644 index 0000000..8617cdb --- /dev/null +++ b/database/factories/AccionLogFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->sentence(), + ]; + } +} diff --git a/database/factories/AdministradorFactory.php b/database/factories/AdministradorFactory.php new file mode 100644 index 0000000..31fa2b9 --- /dev/null +++ b/database/factories/AdministradorFactory.php @@ -0,0 +1,36 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/AgendaFactory.php b/database/factories/AgendaFactory.php new file mode 100644 index 0000000..922d38a --- /dev/null +++ b/database/factories/AgendaFactory.php @@ -0,0 +1,34 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'estado' => $this->faker->randomElement(['Activa', 'Inactiva']), + 'duracionturno' => $this->faker->randomElement([15, 30, 45, 60]), + 'profesional_id' => Profesional::factory(), + ]; + } +} diff --git a/database/factories/BajaFactory.php b/database/factories/BajaFactory.php new file mode 100644 index 0000000..a8558fc --- /dev/null +++ b/database/factories/BajaFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'motivo' => $this->faker->optional()->sentence(), + ]; + } +} diff --git a/database/factories/BugFactory.php b/database/factories/BugFactory.php new file mode 100644 index 0000000..6b1cd94 --- /dev/null +++ b/database/factories/BugFactory.php @@ -0,0 +1,37 @@ + + */ +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 + */ + 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()), + ]; + } +} diff --git a/database/factories/ClienteFactory.php b/database/factories/ClienteFactory.php new file mode 100644 index 0000000..4a0f475 --- /dev/null +++ b/database/factories/ClienteFactory.php @@ -0,0 +1,37 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/ContenidoWebFactory.php b/database/factories/ContenidoWebFactory.php new file mode 100644 index 0000000..00f8d7f --- /dev/null +++ b/database/factories/ContenidoWebFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'quienessomos' => $this->faker->paragraph(3), + ]; + } +} diff --git a/database/factories/CredencialClienteFactory.php b/database/factories/CredencialClienteFactory.php new file mode 100644 index 0000000..21855d2 --- /dev/null +++ b/database/factories/CredencialClienteFactory.php @@ -0,0 +1,35 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'contra' => Hash::make('password'), + 'correo' => $this->faker->unique()->safeEmail(), + 'token' => null, + 'fecha_hora' => null, + ]; + } +} diff --git a/database/factories/CredencialProfesionalFactory.php b/database/factories/CredencialProfesionalFactory.php new file mode 100644 index 0000000..d0b0f57 --- /dev/null +++ b/database/factories/CredencialProfesionalFactory.php @@ -0,0 +1,36 @@ + + */ +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 + */ + 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, + ]; + } +} diff --git a/database/factories/DiaDeAtencionFactory.php b/database/factories/DiaDeAtencionFactory.php new file mode 100644 index 0000000..988530b --- /dev/null +++ b/database/factories/DiaDeAtencionFactory.php @@ -0,0 +1,35 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->sentence(3), + 'agenda_id' => Agenda::factory(), + 'dia_id' => Dia::factory(), + ]; + } +} diff --git a/database/factories/DiaFactory.php b/database/factories/DiaFactory.php new file mode 100644 index 0000000..2848d79 --- /dev/null +++ b/database/factories/DiaFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->randomElement(['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo']), + ]; + } +} diff --git a/database/factories/DiaPreferenciaFactory.php b/database/factories/DiaPreferenciaFactory.php new file mode 100644 index 0000000..3dd168b --- /dev/null +++ b/database/factories/DiaPreferenciaFactory.php @@ -0,0 +1,33 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->sentence(3), + 'formulario_id' => Formulario::factory(), + ]; + } +} diff --git a/database/factories/DocumentacionClienteFactory.php b/database/factories/DocumentacionClienteFactory.php new file mode 100644 index 0000000..317bbaf --- /dev/null +++ b/database/factories/DocumentacionClienteFactory.php @@ -0,0 +1,41 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/EstadoProfesionalFactory.php b/database/factories/EstadoProfesionalFactory.php new file mode 100644 index 0000000..71d4a44 --- /dev/null +++ b/database/factories/EstadoProfesionalFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->randomElement(['Activo', 'Baja']), + ]; + } +} diff --git a/database/factories/EstadoTurnoFactory.php b/database/factories/EstadoTurnoFactory.php new file mode 100644 index 0000000..e9b6b95 --- /dev/null +++ b/database/factories/EstadoTurnoFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->randomElement(['Pendiente', 'Confirmado', 'Cancelado', 'Finalizado']), + ]; + } +} diff --git a/database/factories/FeriadoFactory.php b/database/factories/FeriadoFactory.php new file mode 100644 index 0000000..9702c69 --- /dev/null +++ b/database/factories/FeriadoFactory.php @@ -0,0 +1,34 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/FormularioFactory.php b/database/factories/FormularioFactory.php new file mode 100644 index 0000000..6cf71af --- /dev/null +++ b/database/factories/FormularioFactory.php @@ -0,0 +1,32 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'nombre' => $this->faker->sentence(3), + 'descripcion' => $this->faker->paragraph(2), + ]; + } +} diff --git a/database/factories/FotoBugFactory.php b/database/factories/FotoBugFactory.php new file mode 100644 index 0000000..eb02c18 --- /dev/null +++ b/database/factories/FotoBugFactory.php @@ -0,0 +1,37 @@ + + */ +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 + */ + 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}", + ]; + } +} diff --git a/database/factories/FotoFactory.php b/database/factories/FotoFactory.php new file mode 100644 index 0000000..59609d8 --- /dev/null +++ b/database/factories/FotoFactory.php @@ -0,0 +1,38 @@ + + */ +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 + */ + 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}", + ]; + } +} diff --git a/database/factories/HorarioDeAtencionFactory.php b/database/factories/HorarioDeAtencionFactory.php new file mode 100644 index 0000000..2592476 --- /dev/null +++ b/database/factories/HorarioDeAtencionFactory.php @@ -0,0 +1,37 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/HorarioPreferenciaFactory.php b/database/factories/HorarioPreferenciaFactory.php new file mode 100644 index 0000000..3cbb427 --- /dev/null +++ b/database/factories/HorarioPreferenciaFactory.php @@ -0,0 +1,33 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->sentence(3), + 'formulario_id' => Formulario::factory(), + ]; + } +} diff --git a/database/factories/HorarioRecesoFactory.php b/database/factories/HorarioRecesoFactory.php new file mode 100644 index 0000000..32c8c02 --- /dev/null +++ b/database/factories/HorarioRecesoFactory.php @@ -0,0 +1,37 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/LogSeguridadFactory.php b/database/factories/LogSeguridadFactory.php new file mode 100644 index 0000000..d6651d5 --- /dev/null +++ b/database/factories/LogSeguridadFactory.php @@ -0,0 +1,38 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/ModalidadFactory.php b/database/factories/ModalidadFactory.php new file mode 100644 index 0000000..0e6c502 --- /dev/null +++ b/database/factories/ModalidadFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'descripcion' => $this->faker->randomElement(['Presencial', 'Virtual']), + ]; + } +} diff --git a/database/factories/PersonaFactory.php b/database/factories/PersonaFactory.php new file mode 100644 index 0000000..59c3167 --- /dev/null +++ b/database/factories/PersonaFactory.php @@ -0,0 +1,41 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/ProfesionFactory.php b/database/factories/ProfesionFactory.php new file mode 100644 index 0000000..b097d22 --- /dev/null +++ b/database/factories/ProfesionFactory.php @@ -0,0 +1,32 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'titulo' => $this->faker->unique()->jobTitle(), + 'visible_en_formulario' => $this->faker->boolean(80), + ]; + } +} diff --git a/database/factories/ProfesionalFactory.php b/database/factories/ProfesionalFactory.php new file mode 100644 index 0000000..7bfaba1 --- /dev/null +++ b/database/factories/ProfesionalFactory.php @@ -0,0 +1,42 @@ + + */ +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 + */ + 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, + ]; + } +} diff --git a/database/factories/ServicioFactory.php b/database/factories/ServicioFactory.php new file mode 100644 index 0000000..aa256b6 --- /dev/null +++ b/database/factories/ServicioFactory.php @@ -0,0 +1,32 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'nombre' => $this->faker->words(3, true), + 'descripcion' => $this->faker->sentence(12), + ]; + } +} diff --git a/database/factories/TelefonoFactory.php b/database/factories/TelefonoFactory.php new file mode 100644 index 0000000..e668fe2 --- /dev/null +++ b/database/factories/TelefonoFactory.php @@ -0,0 +1,31 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'telefono' => $this->faker->phoneNumber(), + ]; + } +} diff --git a/database/factories/TurnoFactory.php b/database/factories/TurnoFactory.php new file mode 100644 index 0000000..96be121 --- /dev/null +++ b/database/factories/TurnoFactory.php @@ -0,0 +1,44 @@ + + */ +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 + */ + 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(), + ]; + } +} diff --git a/database/factories/UbicacionFactory.php b/database/factories/UbicacionFactory.php new file mode 100644 index 0000000..887c2af --- /dev/null +++ b/database/factories/UbicacionFactory.php @@ -0,0 +1,33 @@ + + */ +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 + */ + public function definition(): array + { + return [ + 'link' => $this->faker->url(), + 'contenidoweb_id' => ContenidoWeb::factory(), + ]; + } +} diff --git a/database/migrations/2026_03_04_122933_create_telefonos_table.php b/database/migrations/2026_03_04_122933_create_telefonos_table.php index 92ddc29..46b7519 100644 --- a/database/migrations/2026_03_04_122933_create_telefonos_table.php +++ b/database/migrations/2026_03_04_122933_create_telefonos_table.php @@ -15,10 +15,6 @@ return new class extends Migration $table->id(); $table->timestamps(); $table->string('telefono'); - - $table->foreignId('persona_id') - ->constrained('personas') - ->onDelete('cascade'); }); } diff --git a/database/migrations/2026_03_04_193941_create_personas_table.php b/database/migrations/2026_03_04_193941_create_personas_table.php index 289ea66..7656ac1 100644 --- a/database/migrations/2026_03_04_193941_create_personas_table.php +++ b/database/migrations/2026_03_04_193941_create_personas_table.php @@ -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'); }); } diff --git a/database/migrations/2026_03_05_130026_create_formularios_table.php b/database/migrations/2026_03_05_130026_create_formularios_table.php index 0a93524..615af0a 100644 --- a/database/migrations/2026_03_05_130026_create_formularios_table.php +++ b/database/migrations/2026_03_05_130026_create_formularios_table.php @@ -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'); }); } diff --git a/database/migrations/2026_03_04_121802_create_horariospreferencias_table.php b/database/migrations/2026_03_05_130027_create_horariospreferencias_table.php similarity index 100% rename from database/migrations/2026_03_04_121802_create_horariospreferencias_table.php rename to database/migrations/2026_03_05_130027_create_horariospreferencias_table.php diff --git a/database/migrations/2026_03_04_121841_create_diaspreferencias_table.php b/database/migrations/2026_03_05_130028_create_diaspreferencias_table.php similarity index 100% rename from database/migrations/2026_03_04_121841_create_diaspreferencias_table.php rename to database/migrations/2026_03_05_130028_create_diaspreferencias_table.php diff --git a/database/migrations/2026_03_05_194312_create_dias_table.php b/database/migrations/2026_03_05_194010_create_dias_table.php similarity index 100% rename from database/migrations/2026_03_05_194312_create_dias_table.php rename to database/migrations/2026_03_05_194010_create_dias_table.php diff --git a/database/migrations/2026_03_17_132353_create_errores_table.php b/database/migrations/2026_03_17_132353_create_errores_table.php new file mode 100644 index 0000000..f332ede --- /dev/null +++ b/database/migrations/2026_03_17_132353_create_errores_table.php @@ -0,0 +1,32 @@ +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'); + } +}; diff --git a/database/migrations/2026_03_17_132419_create_fotosbugs_table.php b/database/migrations/2026_03_17_132419_create_fotosbugs_table.php new file mode 100644 index 0000000..1f4eacf --- /dev/null +++ b/database/migrations/2026_03_17_132419_create_fotosbugs_table.php @@ -0,0 +1,31 @@ +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'); + } +}; diff --git a/database/migrations/2026_03_17_132519_create_bugs_table.php b/database/migrations/2026_03_17_132519_create_bugs_table.php new file mode 100644 index 0000000..9b64dd9 --- /dev/null +++ b/database/migrations/2026_03_17_132519_create_bugs_table.php @@ -0,0 +1,36 @@ +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'); + } +}; diff --git a/database/seeders/BajaSeeder.php b/database/seeders/BajaSeeder.php index 6959290..f285340 100644 --- a/database/seeders/BajaSeeder.php +++ b/database/seeders/BajaSeeder.php @@ -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(), + ]); + } } } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index ee5c2ad..489e79e 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -26,6 +26,7 @@ class DatabaseSeeder extends Seeder ProfesionSeeder::class, EstadoTurnoSeeder::class, ModalidadSeeder::class, + HorarioPreferenciaSeeder::class, AccionLogSeeder::class, FotoSeeder::class, PersonaSeeder::class, diff --git a/database/seeders/HorarioPreferenciaSeeder.php b/database/seeders/HorarioPreferenciaSeeder.php new file mode 100644 index 0000000..eb20e3b --- /dev/null +++ b/database/seeders/HorarioPreferenciaSeeder.php @@ -0,0 +1,28 @@ + 'AM'], + ['descripcion' => 'PM'], + ]; + + foreach ($horarios as $horario) { + \Illuminate\Support\Facades\DB::table('horariospreferencias')->insert([ + 'descripcion' => $horario['descripcion'], + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } +}