feat: Actualizacion sistema SIO Backend

- Nuevo modulo de historial de cambios (ServicioHistorial)
- Observer para tracking automatico de cambios en servicios
- Correccion de variables auxiliar en ServiciosController
- Actualizacion de configuraciones y migraciones
- Endpoint para consultar historial de cambios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
SIO Admin
2026-01-17 23:01:55 +00:00
parent 51880798ca
commit de656b70a2
362 changed files with 286 additions and 11 deletions

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@@ -14,7 +14,7 @@ class AlterTableServiciosProgresoAddEncuestaContestada extends Migration
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->boolean('encuesta_contestada')->default(false)->after('servicio_negativo');
$table->boolean('encuesta_contestada')->default(false);
});
}

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateServiciosHistorialTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_historial', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('servicio_det_id');
$table->unsignedInteger('usuario_id');
$table->string('campo', 100);
$table->text('valor_anterior')->nullable();
$table->text('valor_nuevo')->nullable();
$table->enum('accion', ['crear', 'actualizar', 'eliminar'])->default('actualizar');
$table->string('ip_address', 45)->nullable();
$table->timestamps();
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det')
->onDelete('cascade');
$table->foreign('usuario_id')
->references('id')
->on('users')
->onDelete('cascade');
$table->index(['servicio_det_id', 'created_at']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_historial');
}
}