Files
Jobhero_back/app/Models/FinishedContracts.php
Carlos 0ed98c96ee 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>
2026-06-23 17:17:14 -06:00

91 lines
1.7 KiB
PHP
Executable File

<?php
namespace App\Models;
use App\Models\User;
use App\Models\Categories;
use App\Models\Suppliers;
use App\Models\Coupon;
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;
class FinishedContracts extends Model
{
//
use HasSpatial;
protected $fillable = [
'user_id',
'supplier_id',
'category_id',
'address',
'int_number',
'references',
'appointment',
'amount',
'details',
'code',
'coupon_id',
'transaction_id',
'score',
'status_id',
'technical_id',
];
protected $casts = [
'location' => LocationCast::class
];
public function user()
{
return $this->belongsTo(User::class);
}
public function categories()
{
return $this->belongsTo('App\Models\Categories', 'category_id');
}
public function suppliers()
{
return $this->belongsTo('App\Models\Suppliers', 'supplier_id');
}
public function coupon()
{
return $this->belongsTo(Coupon::class);
}
public function status()
{
return $this->belongsTo(Status::class);
}
public function payments()
{
return $this->hasOne(Payments::class);
}
public function reports()
{
return $this->hasOne(Report::class);
}
public function nohome()
{
return $this->hasOne(NoHome::class);
}
public function technician()
{
return $this->belongsTo(Technician::class, 'technical_id');
}
}