feat: infrastructure assets management with warranty tracking and EAN lookup integration
This commit is contained in:
@@ -17,6 +17,7 @@ class Contrat extends Model
|
||||
'description',
|
||||
'fournisseur_id',
|
||||
'service_id',
|
||||
'commune_id',
|
||||
'date_debut',
|
||||
'date_echeance',
|
||||
'statut',
|
||||
@@ -47,11 +48,21 @@ class Contrat extends Model
|
||||
return $this->belongsTo(Service::class);
|
||||
}
|
||||
|
||||
public function commune(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Commune::class);
|
||||
}
|
||||
|
||||
public function piecesJointes(): HasMany
|
||||
{
|
||||
return $this->hasMany(PieceJointe::class)->orderByDesc('created_at');
|
||||
}
|
||||
|
||||
public function licences(): HasMany
|
||||
{
|
||||
return $this->hasMany(Licence::class);
|
||||
}
|
||||
|
||||
// Un contrat est considéré "proche d'expiration" si l'échéance est dans moins de 30 jours (ou selon son préavis)
|
||||
public function getEstProcheEcheanceAttribute(): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user