feat: profile_photo en contratos activos, notificaciones bilingues en reportes y foto en panel usuarios

- API contratos activos (cliente y proveedor): agrega campo profile_photo (técnico asignado o supplier, null si no tiene)
- Notificaciones push bilingues en comentarios de reporte: "Nueva actividad en tu reporte" / "New activity on your report"
- Moderador en web panel notifica a cliente y proveedor al comentar, con prefijo Moderador/Moderator
- Panel usuarios: columna de foto de perfil entre ID y Nombre

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 17:17:14 -06:00
parent 38da1b56ce
commit 0ed98c96ee
40 changed files with 1390 additions and 651 deletions

View File

@@ -1280,12 +1280,19 @@ class SupplierController extends Controller
], 400);
}
$contracts = CurrentContracts::where('supplier_id', $supplier->id)->orderBy('created_at', 'DESC')->get();
$contracts = CurrentContracts::with(['technician.user'])
->where('supplier_id', $supplier->id)->orderBy('created_at', 'DESC')->get();
$contractsinfo = array();
foreach ($contracts as $contract) {
$category = Categories::where('id', $contract->category_id)->first();
$technician = $contract->technical_id
? ($contract->technician->user->name ?? null)
: ($supplier->user->name ?? null);
$profile_photo = $contract->technical_id
? ($contract->technician->user->profile_photo ?? null)
: ($supplier->user->profile_photo ?? null);
$contractinfo = array(
'id' => $contract->id,
'phone' => $contract->user->phone,
@@ -1297,7 +1304,9 @@ class SupplierController extends Controller
'lat' => $contract->location->getLat(),
'lng' => $contract->location->getLng(),
'amount' => $contract->amount,
'details' => $contract->details
'details' => $contract->details,
'technician' => $technician,
'profile_photo' => $profile_photo
);
$contractsinfo[] = $contractinfo;
}