<?php

namespace App\Models\Mitigation;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Prunable;

/**
 * We track any events relating to mitigated attacks that need to be sent using this.
 * 
 * Types and statuses live in MitigationNotificationType / MitigationNotificationStatus.
 */
class MitigationNotification extends Model
{
    use Prunable;

    protected $table = 'mitigation_notification';

    protected $fillable = [
        'attack_id',
        'organisation_id',
        'type',
        'status'
    ];

    public function prunable() {
        return static::where('created_at', '<=', now()->subDays(90));
    }
}
