Fixed some field job problem where field operator could still see archived contracts

This commit is contained in:
Simon Pocrnjič
2025-12-21 21:00:49 +01:00
parent 11206fb4f7
commit adc2a64687
10 changed files with 919 additions and 319 deletions
+6 -1
View File
@@ -24,6 +24,8 @@ class FieldJob extends Model
'priority',
'notes',
'address_snapshot ',
'last_activity',
'added_activity'
];
protected $casts = [
@@ -31,6 +33,8 @@ class FieldJob extends Model
'completed_at' => 'datetime',
'cancelled_at' => 'datetime',
'priority' => 'boolean',
'last_activity' => 'datetime',
'added_activity' => 'boolean',
'address_snapshot ' => 'array',
];
@@ -90,7 +94,8 @@ public function user(): BelongsTo
public function contract(): BelongsTo
{
return $this->belongsTo(Contract::class, 'contract_id');
return $this->belongsTo(Contract::class, 'contract_id')
->where('active', true);
}
/**