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

@@ -7,6 +7,7 @@ use App\Models\Categories;
use App\Models\Suppliers;
use App\Models\Coupon;
use App\Models\Status;
use App\Models\Technician;
use Illuminate\Database\Eloquent\Model;
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
@@ -30,6 +31,7 @@ class CurrentContracts extends Model
'coupon_id',
'transaction_id',
'status_id',
'technical_id',
];
protected $casts = [
@@ -61,4 +63,9 @@ class CurrentContracts extends Model
return $this->belongsTo(Status::class);
}
public function technician()
{
return $this->belongsTo(Technician::class, 'technical_id');
}
}

View File

@@ -10,6 +10,7 @@ use App\Models\Status;
use App\Models\Report;
use App\Models\Payments;
use App\Models\NoHome;
use App\Models\Technician;
use Illuminate\Database\Eloquent\Model;
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
@@ -34,6 +35,7 @@ class FinishedContracts extends Model
'transaction_id',
'score',
'status_id',
'technical_id',
];
protected $casts = [
@@ -80,4 +82,9 @@ class FinishedContracts extends Model
return $this->hasOne(NoHome::class);
}
public function technician()
{
return $this->belongsTo(Technician::class, 'technical_id');
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class PaymentBatch extends Model
{
protected $fillable = [
'file_name',
'file_path',
'generated_by',
'date_from',
'date_to',
];
public function user()
{
return $this->belongsTo(User::class, 'generated_by');
}
}

View File

@@ -10,6 +10,7 @@ use App\Models\Postulations;
use App\Models\FinishedContracts;
use App\Models\CurrentContracts;
use App\Models\Payments;
use App\Models\Technician;
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
use Illuminate\Database\Eloquent\Model;
@@ -73,6 +74,11 @@ class Suppliers extends Model
return $this->hasMany(FinishedContracts::class);
}
public function technicians()
{
return $this->hasMany(Technician::class, 'supplier_id');
}
public function ichambaparameters()
{
return $this->belongsTo(iChambaParameter::class);

11
app/Models/Cards.php → app/Models/Technician.php Executable file → Normal file
View File

@@ -3,16 +3,23 @@
namespace App\Models;
use App\Models\User;
use App\Models\Suppliers;
use Illuminate\Database\Eloquent\Model;
class Cards extends Model
class Technician extends Model
{
protected $fillable = [
'user_id',
'token',
'supplier_id',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function supplier()
{
return $this->belongsTo(Suppliers::class, 'supplier_id');
}
}

View File

@@ -4,7 +4,6 @@ namespace App\Models;
use App\Models\Role;
use App\Models\LinkedSocialAccount;
use App\Models\Cards;
use App\Models\Suppliers;
use App\Models\Postulations;
use App\Models\Report;
@@ -27,10 +26,9 @@ class User extends Authenticatable
'profile_photo',
'role_id',
'social_id',
'openpay_id',
'stripe_customer_id',
'password',
'phone',
'openpay_id',
'phone_verified_at'
];
protected $hidden = [
@@ -54,11 +52,6 @@ class User extends Authenticatable
return $this->hasMany(LinkedSocialAccount::class);
}
public function cards()
{
return $this->hasMany(Cards::class);
}
public function suppliers()
{
return $this->hasOne(Suppliers::class);