UPDATE: Se actualizó el método de actualizar inscripción

This commit is contained in:
Juan Felipe Zapata Moreno 2025-10-29 12:36:12 -06:00
parent 3a25257dc5
commit 41c85a8ade
13 changed files with 196 additions and 182 deletions

View File

@ -1,7 +1,7 @@
server { server {
listen 80; listen 80;
server_name _; server_name _;
root /var/www/repuve-v1/public; root /var/www/repuve-backend-v1/public;
index index.php index.html; index index.php index.html;
# Logging # Logging
@ -45,17 +45,17 @@ server {
# Handle storage files (Laravel storage link) # Handle storage files (Laravel storage link)
location /storage { location /storage {
alias /var/www/repuve-v1/storage/app; alias /var/www/repuve-backend-v1/storage/app;
try_files $uri =404; try_files $uri =404;
} }
location /profile { location /profile {
alias /var/www/repuve-v1/storage/app/profile; alias /var/www/repuve-backend-v1/storage/app/profile;
try_files $uri =404; try_files $uri =404;
} }
location /images { location /images {
alias /var/www/repuve-v1/storage/app/images; alias /var/www/repuve-backend-v1/storage/app/images;
try_files $uri =404; try_files $uri =404;
} }

View File

@ -41,9 +41,13 @@ public function index()
*/ */
public function store(RoleStoreRequest $request) public function store(RoleStoreRequest $request)
{ {
Role::create($request->all()); $model = Role::create($request->all());
return ApiResponse::OK->response(); return ApiResponse::OK->response([
'message' => 'Rol creado exitosamente',
'id' => $model->id,
'name' => $model->name,
]);
} }
/** /**
@ -97,23 +101,4 @@ public function updatePermissions(Role $role, Request $request)
return ApiResponse::OK->response(); return ApiResponse::OK->response();
} }
/**
* Obtener todos los roles
*/
public function listAll()
{
try {
$roles = Role::orderBy('name')->get(['id', 'name']);
return ApiResponse::OK->response([
'roles' => $roles,
]);
} catch (\Exception $e) {
return ApiResponse::INTERNAL_ERROR->response([
'message' => 'Error al obtener roles',
]);
}
}
} }

View File

@ -133,7 +133,7 @@ public function vehicleInscription(VehicleStoreRequest $request)
$customName = str_replace(' ', '_', $customName); $customName = str_replace(' ', '_', $customName);
$extension = $file->getClientOriginalExtension(); $extension = $file->getClientOriginalExtension();
$fileName = $customName . '_' . time() . '.' . $extension; $fileName = $customName . '_' . time() . '.' . $extension;
$path = $file->storeAs('/', $fileName, 'records'); $path = $file->storeAs('records', $fileName, 'public');
$md5 = md5_file($file->getRealPath()); $md5 = md5_file($file->getRealPath());
$fileRecord = File::create([ $fileRecord = File::create([

View File

@ -224,31 +224,4 @@ public function toggleStatus(int $id)
]); ]);
} }
} }
public function getAvailableUsers()
{
try {
$users = User::select('id', 'name', 'paternal', 'maternal', 'email')
->orderBy('name')
->get();
return ApiResponse::OK->response([
'users' => $users->map(function ($user) {
return [
'id' => $user->id,
'name' => $user->full_name,
'email' => $user->email,
];
}),
]);
} catch (\Exception $e) {
Log::error('Error al obtener usuarios: ' . $e->getMessage());
return ApiResponse::INTERNAL_ERROR->response([
'message' => 'Error al obtener lista de usuarios',
'error' => $e->getMessage(),
]);
}
}
} }

View File

@ -3,66 +3,198 @@
namespace App\Http\Controllers\Repuve; namespace App\Http\Controllers\Repuve;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Requests\Repuve\VehicleUpdateRequest; use App\Http\Requests\Repuve\VehicleUpdateRequest;
use Notsoweb\ApiResponse\Enums\ApiResponse; use Notsoweb\ApiResponse\Enums\ApiResponse;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use App\Models\Record; use App\Models\Record;
use App\Models\File; use App\Models\File;
use App\Models\Owner; use App\Models\Owner;
use App\Models\Tag; use App\Models\Tag;
use App\Models\Error; use App\Models\Error;
use Exception;
use PhpParser\Node\Stmt\Foreach_;
class UpdateController extends Controller class UpdateController extends Controller
{ {
public function vehicleUpdate(VehicleUpdateRequest $request) public function vehicleData(Request $request)
{ {
try { try {
$recordId = $request->input('record_id'); $request->validate([
'folio' => 'required',
'string',
'exists:records,folio',
'tag_number' => 'required',
'string',
'exists:tags,tag_number',
'vin' => 'required',
'string',
'exists:vehicles,vin'
]);
// Buscar vehículo por folio y tag $folio = $request->input('folio');
$record = Record::with(['vehicle.owner', 'vehicle.tag', 'files', 'error'])->find($recordId); $tagNumber = $request->input('tag_number');
$vin = $request->input('vin');
$isStolen = $this->checkIfStolen($vin);
if ($isStolen) {
return ApiResponse::FORBIDDEN->response([
'vin' => $vin,
'stolen' => true,
'message' => 'El vehículo reporta robo. No se puede continuar con la actualización.',
]);
}
$record = Record::with(['vehicle.owner', 'vehicle.tag', 'files', 'error'])
->where('folio', $folio)
->first();
// Validar que el tag
if (!$record) { if (!$record) {
return ApiResponse::BAD_REQUEST->response([ return ApiResponse::BAD_REQUEST->response([
'message' => 'No se encontró el expediente', 'message' => 'No se encontró el expediente',
'record_id' => $recordId, 'folio' => $folio,
]); ]);
} }
$vehicle = $record->vehicle; $vehicle = $record->vehicle;
$tag = $vehicle->tag; $tag = $vehicle->tag;
if (!$tag) { if (!$tag || $tag->tag_number !== $tagNumber) {
return ApiResponse::NOT_FOUND->response([ return ApiResponse::BAD_REQUEST->response([
'message' => 'El vehículo no tiene tag asociado', 'message' => 'El tag_number no coincide con el registrado en el expediente',
'vehicle_id' => $vehicle->placa,
]); ]);
} }
// Consultar API Repuve Nacional (verificar robo) if ($vehicle->numero_serie !== $vin) {
$isStolen = $this->checkIfStolen($record->folio); return ApiResponse::BAD_REQUEST->response([
'message' => 'El VIN no coincide con el registrado en el expediente',
]);
}
$owner = $vehicle->owner;
return ApiResponse::OK->response([
'message' => 'Datos del vehículo obtenidos exitosamente',
'record' => [
'id' => $record->id,
'folio' => $record->folio,
'created_at' => $record->created_at->toDateTimeString(),
'updated_at' => $record->updated_at->toDateTimeString(),
],
'vehicle' => [
'id' => $vehicle->id,
'placa' => $vehicle->placa,
'anio_placa' => $vehicle->anio_placa,
'numero_serie' => $vehicle->numero_serie,
'vigencia' => $vehicle->vigencia,
'fecha_impresion' => $vehicle->fecha_impresion,
'qr_hash' => $vehicle->qr_hash,
'valido' => $vehicle->valido,
'nombre' => $vehicle->nombre,
'nombre2' => $vehicle->nombre2,
'marca' => $vehicle->marca,
'linea' => $vehicle->linea,
'sublinea' => $vehicle->sublinea,
'modelo' => $vehicle->modelo,
'color' => $vehicle->color,
'tipo' => $vehicle->tipo,
'tipo_servicio' => $vehicle->tipo_servicio,
'numero_motor' => $vehicle->numero_motor,
'descripcion_origen' => $vehicle->descripcion_origen,
'municipio' => $vehicle->municipio,
'localidad' => $vehicle->localidad,
'calle' => $vehicle->calle,
'calle2' => $vehicle->calle2,
'codigo_postal' => $vehicle->codigo_postal,
'serie_folio' => $vehicle->serie_folio,
'nrpv' => $vehicle->nrpv,
],
'owner' => [
'id' => $owner->id,
'name' => $owner->name,
'paternal' => $owner->paternal,
'maternal' => $owner->maternal,
'full_name' => $owner->full_name,
'rfc' => $owner->rfc,
'curp' => $owner->curp,
'address' => $owner->address,
],
'tag' => [
'id' => $tag->id,
'folio' => $tag->folio,
'tag_number' => $tag->tag_number,
'status' => $tag->status,
'package_id' => $tag->package_id,
],
'existing_files' => $record->files->map(function ($file) {
return [
'id' => $file->id,
'name' => $file->name,
'path' => $file->path,
'url' => $file->url,
'created_at' => $file->created_at->toDateTimeString(),
];
}),
'total_files' => $record->files->count(),
]);
} catch (Exception $e) {
return ApiResponse::BAD_REQUEST->response([
'message' => 'Error de validación',
'error' => $e->getMessage(),
]);
}
}
public function vehicleUpdate(VehicleUpdateRequest $request)
{
try {
$folio = $request->input('folio');
$tagNumber = $request->input('tag_number');
$vin = $request->input('vin');
$isStolen = $this->checkIfStolen($vin);
if ($isStolen) { if ($isStolen) {
return ApiResponse::FORBIDDEN->response([ return ApiResponse::FORBIDDEN->response([
'record_id' => $recordId, 'vin' => $vin,
'tag_number' => $tag->tag_number,
'stolen' => true, 'stolen' => true,
'message' => 'El vehículo reporta robo. No se puede continuar con la actualización.', 'message' => 'El vehículo reporta robo. No se puede continuar con la actualización.',
]); ]);
} }
// Iniciar transacción $record = Record::with(['vehicle.owner', 'vehicle.tag', 'files', 'error'])
->where('folio', $folio)
->first();
if (!$record) {
return ApiResponse::NOT_FOUND->response([
'message' => 'No se encontró el expediente',
'folio' => $folio,
]);
}
$vehicle = $record->vehicle;
$tag = $vehicle->tag;
if (!$tag || $tag->tag_number !== $tagNumber) {
return ApiResponse::BAD_REQUEST->response([
'message' => 'El tag_number no coincide con el registrado en el expediente',
]);
}
if ($vehicle->numero_serie !== $vin) {
return ApiResponse::BAD_REQUEST->response([
'message' => 'El VIN no coincide con el registrado en el expediente',
]);
}
DB::beginTransaction(); DB::beginTransaction();
// Obtener datos del vehículo de API Estatal
$vehicleData = $this->getVehicle2();
$ownerData = $this->getOwner(); $ownerData = $this->getOwner();
// Actualizar propietario
$owner = Owner::updateOrCreate( $owner = Owner::updateOrCreate(
['rfc' => $ownerData['rfc']], ['rfc' => $ownerData['rfc']],
[ [
@ -74,89 +206,53 @@ public function vehicleUpdate(VehicleUpdateRequest $request)
] ]
); );
// Actualizar vehículo $uploadedFiles = [];
$vehicle->update([
'anio_placa' => $vehicleData['ANIO_PLACA'],
// NO actualizar 'placa' - es UNIQUE
// NO actualizar 'numero_serie' - es UNIQUE (NIV/VIN)
'rfc' => $vehicleData['RFC'],
// NO actualizar 'folio' => $folio,
'vigencia' => $vehicleData['VIGENCIA'],
'fecha_impresion' => $vehicleData['FECHA_IMPRESION'],
'qr_hash' => $vehicleData['QR_HASH'],
'valido' => $vehicleData['VALIDO'],
'nombre' => $vehicleData['NOMBRE'],
'nombre2' => $vehicleData['NOMBRE2'],
'municipio' => $vehicleData['MUNICIPIO'],
'localidad' => $vehicleData['LOCALIDAD'],
'calle' => $vehicleData['CALLE'],
'calle2' => $vehicleData['CALLE2'],
'tipo' => $vehicleData['TIPO'],
'tipo_servicio' => $vehicleData['TIPO_SERVICIO'],
'marca' => $vehicleData['MARCA'],
'linea' => $vehicleData['LINEA'],
'sublinea' => $vehicleData['SUBLINEA'],
'modelo' => $vehicleData['MODELO'],
'numero_motor' => $vehicleData['NUMERO_MOTOR'],
'descripcion_origen' => $vehicleData['DESCRIPCION_ORIGEN'],
'color' => $vehicleData['COLOR'],
'codigo_postal' => $vehicleData['CODIGO_POSTAL'],
// NO actualizar 'serie_folio' - es UNIQUE
// NO actualizar 'sfolio' - es UNIQUE
// NO actualizar 'nrpv' - es UNIQUE (mantener el original)
'owner_id' => $owner->id,
]);
// Procesar archivos si existen
$uploadedFiles = [];
if ($request->hasFile('files')) { if ($request->hasFile('files')) {
$files = $request->file('files'); $files = $request->file('files');
$fileNames = $request->input('names', []); $fileNames = $request->input('names', []);
foreach ($files as $index => $file) { foreach ($files as $indx => $file) {
$customName = $fileNames[$index] ?? "archivo_" . ($index + 1); $customName = $fileNames[$indx] ?? "archivo_" . ($indx + 1);
$customName = str_replace(' ', '_', $customName); $customName = str_replace(' ', '_', $customName);
$extension = $file->getClientOriginalExtension(); $extension = $file->getClientOriginalExtension();
$fileName = $customName . '_' . time() . '.' . $extension; $fileName = $customName . '_' . time() . '.' . $extension;
$path = $file->storeAs('/', $fileName, 'records'); $path = $file->storeAs('records' . $fileName, 'public');
$md5 = md5_file($file->getRealPath()); $md5 = md5_file($file->getRealPath());
$fileRecord = File::create([ $fileRecord = File::create([
'name' => $customName,
'path' => $path,
'md5' => $md5,
'record_id' => $record->id, 'record_id' => $record->id,
'name' => $fileName,
'path' => $path,
'url' => asset('storage/' . $path),
'md5' => $md5,
]); ]);
$uploadedFiles[] = [ $uploadedFiles[] = [
'id' => $fileRecord->id, 'id' => $fileRecord->id,
'name' => $fileRecord->name, 'name' => $fileRecord->name,
'path' => $fileRecord->path, 'path' => $fileRecord->path,
'url' => $fileRecord->url, 'md5' => $fileRecord->md5,
]; ];
} }
} }
// Enviar datos a API Repuve Nacional //Envio de datos
$apiResponse = $this->sendToRepuveNacional($vehicle->numero_serie); $apiResponse = $this->sendToRepuveNacional($vin);
$apiResponse["repuve_response"]["folio_ci"] = $record->folio; $apiResponse["repuve_response"]["folio_ci"] = $record->folio;
$apiResponse["repuve_response"]["identificador_ci"] = $tag->tag_number; $apiResponse["repuve_response"]["identificador_ci"] = $tag->tag_number;
// Procesar respuesta de la API
if (isset($apiResponse['has_error']) && $apiResponse['has_error']) { if (isset($apiResponse['has_error']) && $apiResponse['has_error']) {
// Si hay error, busca bd
$error = Error::where('code', $apiResponse['error_code'])->first(); $error = Error::where('code', $apiResponse['error_code'])->first();
if (!$error) { if (!$error) {
DB::rollBack(); DB::rollBack();
return ApiResponse::BAD_REQUEST->response([ return ApiResponse::INTERNAL_ERROR->response([
'message' => 'Código de error no encontrado en el catálogo', 'message' => 'Código de error no encontrado en el catálogo',
'error_code' => $apiResponse['error_code'], 'error_code' => $apiResponse['error_code'],
'error_message' => $apiResponse['error_message'], 'error_message' => $apiResponse['error_message'],
]); ]);
} }
// guarda error
$record->update([ $record->update([
'error_id' => $error->id, 'error_id' => $error->id,
'api_response' => $apiResponse, 'api_response' => $apiResponse,
@ -165,12 +261,10 @@ public function vehicleUpdate(VehicleUpdateRequest $request)
DB::commit(); DB::commit();
// Retornar datos por error para que el usuario corrija return ApiResponse::NOT_ACCEPTABLE->response([
// Al volver a llamar esta función con datos corregidos, se repetirá el ciclo 'message' => 'Datos guardados con error. Corrija y vuelva a enviar.',
return ApiResponse::OK->response([
'message' => 'Datos guardados con error. Corrija los datos y vuelva a enviar.',
'has_error' => true, 'has_error' => true,
'can_update' => true, 'can_retry' => true,
'error' => [ 'error' => [
'code' => $error->code, 'code' => $error->code,
'description' => $error->description, 'description' => $error->description,
@ -180,22 +274,9 @@ public function vehicleUpdate(VehicleUpdateRequest $request)
'id' => $record->id, 'id' => $record->id,
'folio' => $record->folio, 'folio' => $record->folio,
], ],
'vehicle' => $vehicleData,
'owner' => $ownerData,
'new_files' => $uploadedFiles,
'total_new_files' => count($uploadedFiles),
'existing_files' => $record->files->map(function ($file) {
return [
'id' => $file->id,
'name' => $file->name,
'path' => $file->path,
'url' => $file->url,
];
}),
]); ]);
} }
// Si NO hay error, guarda registro OK y quita errores previos
$record->update([ $record->update([
'error_id' => null, 'error_id' => null,
'api_response' => $apiResponse, 'api_response' => $apiResponse,
@ -210,8 +291,6 @@ public function vehicleUpdate(VehicleUpdateRequest $request)
'record' => [ 'record' => [
'id' => $record->id, 'id' => $record->id,
'folio' => $record->folio, 'folio' => $record->folio,
'vehicle_id' => $vehicle->id,
'user_id' => $record->user_id,
'updated_at' => $record->updated_at->toDateTimeString(), 'updated_at' => $record->updated_at->toDateTimeString(),
], ],
'vehicle' => [ 'vehicle' => [
@ -229,24 +308,14 @@ public function vehicleUpdate(VehicleUpdateRequest $request)
], ],
'tag' => [ 'tag' => [
'id' => $tag->id, 'id' => $tag->id,
'folio' => $tag->folio,
'tag_number' => $tag->tag_number, 'tag_number' => $tag->tag_number,
'status' => $tag->status, 'status' => $tag->status,
], ],
'new_files' => $uploadedFiles, 'new_files' => $uploadedFiles,
'total_new_files' => count($uploadedFiles),
'existing_files' => $record->files->map(function ($file) {
return [
'id' => $file->id,
'name' => $file->name,
'url' => $file->url,
];
}),
'total_files' => $record->files->count() + count($uploadedFiles), 'total_files' => $record->files->count() + count($uploadedFiles),
]); ]);
} catch (\Exception $e) { } catch (Exception $e) {
DB::rollBack(); return ApiResponse::INTERNAL_ERROR->response([
return ApiResponse::BAD_REQUEST->response([
'message' => 'Error al actualizar el vehículo', 'message' => 'Error al actualizar el vehículo',
'error' => $e->getMessage(), 'error' => $e->getMessage(),
]); ]);

View File

@ -17,7 +17,7 @@ public function rules(): array
'tag_number' => ['required', 'string', 'exists:tags,tag_number'], 'tag_number' => ['required', 'string', 'exists:tags,tag_number'],
'vin' => ['required', 'string', 'max:30'], 'vin' => ['required', 'string', 'max:30'],
'files' => ['nullable', 'array', 'min:1'], 'files' => ['nullable', 'array', 'min:1'],
'files.*' => ['file', 'mimes:jpeg,png,jpg,pdf', 'max:10240'], 'files.*' => ['file', 'mimes:jpeg,png,jpg', 'max:10240'],
'names' => ['nullable', 'array'], 'names' => ['nullable', 'array'],
'names.*' => ['string', 'max:255'], 'names.*' => ['string', 'max:255'],
]; ];

View File

@ -31,7 +31,7 @@ public function record()
public function url(): Attribute public function url(): Attribute
{ {
return Attribute::make( return Attribute::make(
get: fn () => Storage::disk('records')->url($this->path), get: fn () => Storage::disk('public')->url($this->path),
); );
} }
} }

View File

@ -52,15 +52,6 @@
'visibility' => 'public', 'visibility' => 'public',
'throw' => false, 'throw' => false,
], ],
'records' => [
'driver' => 'local',
'root' => storage_path('app/records'),
'url' => env('APP_URL').'/records',
'visibility' => 'public',
'throw' => false,
],
'images' => [ 'images' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/images'), 'root' => storage_path('app/images'),
@ -97,6 +88,5 @@
public_path('storage') => storage_path('app/public'), public_path('storage') => storage_path('app/public'),
public_path('profile') => storage_path('app/profile'), public_path('profile') => storage_path('app/profile'),
public_path('images') => storage_path('app/images'), public_path('images') => storage_path('app/images'),
public_path('records') => storage_path('app/records'),
], ],
]; ];

View File

@ -3,7 +3,7 @@ services:
build: build:
context: . context: .
dockerfile: dockerfile dockerfile: dockerfile
working_dir: /var/www/repuve-v1 working_dir: /var/www/repuve-backend-v1
environment: environment:
- DB_HOST=mysql - DB_HOST=mysql
- DB_USERNAME=${DB_USERNAME} - DB_USERNAME=${DB_USERNAME}
@ -11,8 +11,8 @@ services:
- DB_DATABASE=${DB_DATABASE} - DB_DATABASE=${DB_DATABASE}
- DB_PORT=${DB_PORT} - DB_PORT=${DB_PORT}
volumes: volumes:
- ./:/var/www/repuve-v1 - ./:/var/www/repuve-backend-v1
- /var/www/repuve-v1/vendor - /var/www/repuve-backend-v1/vendor
networks: networks:
- repuve-network - repuve-network
mem_limit: 400m mem_limit: 400m
@ -25,7 +25,7 @@ services:
ports: ports:
- "${NGINX_PORT}:80" - "${NGINX_PORT}:80"
volumes: volumes:
- ./public:/var/www/repuve-v1/public - ./public:/var/www/repuve-backend-v1/public
- ./Docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf - ./Docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
networks: networks:
- repuve-network - repuve-network

View File

@ -1,8 +1,8 @@
FROM php:8.3-fpm FROM php:8.3-fpm
RUN mkdir -p /var/www/repuve-v1 RUN mkdir -p /var/www/repuve-backend-v1
WORKDIR /var/www/repuve-v1 WORKDIR /var/www/repuve-backend-v1
RUN apt-get update && apt-get install -y\ RUN apt-get update && apt-get install -y\
git \ git \
@ -29,15 +29,15 @@ RUN composer install --optimize-autoloader --no-interaction --no-scripts
COPY . . COPY . .
RUN chown -R www-data:www-data /var/www/repuve-v1 RUN chown -R www-data:www-data /var/www/repuve-backend-v1
COPY entrypoint-dev.sh /usr/local/bin/entrypoint-dev.sh COPY entrypoint-dev.sh /usr/local/bin/entrypoint-dev.sh
RUN chmod +x /usr/local/bin/entrypoint-dev.sh RUN chmod +x /usr/local/bin/entrypoint-dev.sh
RUN mkdir -p storage/app/keys storage/logs bootstrap/cache RUN mkdir -p storage/app/keys storage/logs bootstrap/cache
RUN chown -R www-data:www-data /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache RUN chown -R www-data:www-data /var/www/repuve-backend-v1/storage /var/www/repuve-backend-v1/bootstrap/cache
RUN chmod -R 775 /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache RUN chmod -R 775 /var/www/repuve-backend-v1/storage /var/www/repuve-backend-v1/bootstrap/cache
EXPOSE 9000 EXPOSE 9000

View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
set -e set -e
git config --global --add safe.directory /var/www/repuve-v1 git config --global --add safe.directory /var/www/repuve-backend-v1
echo "=== Iniciando entrypoint DESARROLLO ===" echo "=== Iniciando entrypoint DESARROLLO ==="
chown -R www-data:www-data /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache chown -R www-data:www-data /var/www/repuve-backend-v1/storage /var/www/repuve-backend-v1/bootstrap/cache
chmod -R 775 /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache chmod -R 775 /var/www/repuve-backend-v1/storage /var/www/repuve-backend-v1/bootstrap/cache
# Variables desde Docker environment # Variables desde Docker environment
DB_HOST=${DB_HOST:-mysql} DB_HOST=${DB_HOST:-mysql}

View File

@ -1 +1 @@
/var/www/repuve-v1/storage/app/records /var/www/repuve-backend-v1/storage/app/records

View File

@ -37,6 +37,7 @@
Route::get('expediente/{id}/pdfImagenes', [RecordController::class, 'generatePdfImages']); Route::get('expediente/{id}/pdfImagenes', [RecordController::class, 'generatePdfImages']);
//Rutas de Actualización //Rutas de Actualización
Route::get('consulta', [UpdateController::class, 'vehicleData']);
Route::post('actualizar', [UpdateController::class, 'vehicleUpdate']); Route::post('actualizar', [UpdateController::class, 'vehicleUpdate']);
// Rutas de cancelación de constancias // Rutas de cancelación de constancias
@ -47,10 +48,6 @@
Route::post('/moduleCreate', [ModuleController::class, 'store']); Route::post('/moduleCreate', [ModuleController::class, 'store']);
Route::put('/moduleUpdate/{id}', [ModuleController::class, 'update']); Route::put('/moduleUpdate/{id}', [ModuleController::class, 'update']);
Route::patch('/moduleStatus/{id}', [ModuleController::class, 'toggleStatus']); Route::patch('/moduleStatus/{id}', [ModuleController::class, 'toggleStatus']);
Route::get('/moduleUsers', [ModuleController::class, 'getAvailableUsers']);
// Rutas de roles, mostrar roles para asignar a usuarios
Route::get('/admin/roles-all', [RoleController::class, 'listAll']);
//Rutas de dispositivos //Rutas de dispositivos
Route::get('/devices', [DeviceController::class, 'index']); Route::get('/devices', [DeviceController::class, 'index']);