fix some bugs from accounting 9

This commit is contained in:
2026-07-28 21:57:29 +03:30
parent 736d0a4fd1
commit 77e0ba0bb3
4 changed files with 109 additions and 14 deletions
+13
View File
@@ -19,6 +19,7 @@ class AppNotification extends Model
'severity',
'is_active',
'created_by',
'is_system',
'audience_type',
'segment_keys',
'audience_label',
@@ -27,10 +28,22 @@ class AppNotification extends Model
protected $casts = [
'is_active' => 'boolean',
'is_system' => 'boolean',
'segment_keys' => 'array',
'recipients_count' => 'integer',
];
/** اعلان تراکنشی خودکار (نه ارسال دستی ادمین) */
public function scopeSystem($query)
{
return $query->where('is_system', true);
}
public function scopeAdminCreated($query)
{
return $query->where('is_system', false);
}
public function reads(): HasMany
{
return $this->hasMany(AppNotificationRead::class, 'notification_id');