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

@@ -160,17 +160,17 @@ class PostulationController extends Controller
}
}
$minutes = intval(substr(substr($request->setdate, 14), 0, 2) + 15);
$hours = intval(substr(substr($request->setdate, 11), 0, 2) + 1);
$minutes = intval(substr(substr($request->sethour, 14), 0, 2) + 15);
$hours = intval(substr(substr($request->sethour, 11), 0, 2) + 1);
if ($minutes > 59) {
if ($hours > 23){
$delay_msg = Carbon::now()->addDays(1)->toDateString() . ' ' . ($hours - 24) . ':' . ($minutes - 60) . substr(substr($request->setdate, 16), 0, 3);
$delay_msg = Carbon::now()->addDays(1)->toDateString() . ' ' . ($hours - 24) . ':' . ($minutes - 60) . substr(substr($request->sethour, 16), 0, 3);
} else {
$delay_msg = substr($request->sethour, 0, 10) . ' ' . $hours . ':' . ($minutes - 60) . substr(substr($request->setdate, 16), 0, 3);
$delay_msg = substr($request->sethour, 0, 10) . ' ' . $hours . ':' . ($minutes - 60) . substr(substr($request->sethour, 16), 0, 3);
}
} else {
$delay_msg = substr($request->sethour, 0, 10) . ' ' . $hours . ':' . $minutes . substr(substr($request->setdate, 16), 0, 3);
$delay_msg = substr($request->sethour, 0, 10) . ' ' . $hours . ':' . $minutes . substr(substr($request->sethour, 16), 0, 3);
}
$delay_UTC = Carbon::now()->addMinutes(15)->toString();
@@ -290,19 +290,24 @@ class PostulationController extends Controller
], 400);
}
$postulations = FinishedContracts::where('supplier_id', $user->suppliers->id)->orderBy('created_at', 'DESC')->get();
$supplier = $user->suppliers;
$postulations = FinishedContracts::with(['technician.user'])
->where('supplier_id', $supplier->id)->orderBy('created_at', 'DESC')->get();
$finishedpostulations = array();
foreach($postulations as $postulation) {
$time_limit = Carbon::parse($postulation->appointment);
$category = Categories::where('id', $postulation->category_id)->first();
$technician = $postulation->technical_id
? ($postulation->technician->user->name ?? null)
: ($supplier->user->name ?? null);
$finishedpostulationinfo = array(
'id' => $postulation->id,
'category' => $category->name,
'en_category' => $category->en_name,
'address' => $postulation->address,
'date' => $postulation->appointment,
'amount' => $postulation->amount
'amount' => $postulation->amount,
'technician' => $technician
);
$finishedpostulations[] = $finishedpostulationinfo;
}