<?php

namespace App\Models;

use App\Traits\AbstractModel;
use App\Traits\Auditable;
use App\Traits\DeleteGuarded;
use App\Traits\HasDynamicSchema;
use App\Traits\ModelFinder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class KpiRating extends Model
{
    use HasFactory, SoftDeletes, Auditable, DeleteGuarded, HasDynamicSchema, AbstractModel, ModelFinder;

    protected $with = ['createdBy', 'lastUpdatedBy'];
    protected $fillable = ['name', 'percentage', 'description',  'created_by', 'last_updated_by', 'deleted_by'];

    public const DELETE_PREVENTING_RELATIONSHIPS = [];
    public const DELETE_AFFECTED_RELATIONSHIPS = [];
    public const NON_STANDALONE_CHILDREN = [];

    /**
     * Get the audit descriptions for different actions.
     *
     * @return array An array containing descriptions for different audit actions
     */
    protected function getAuditDescriptions(): array
    {
        return [
            'create' => "Created new Kpi Rating: $this->name",
            'update' => "Updated Kpi Rating: $this->name",
            'delete' => "Deleted Kpi Rating: $this->name",
        ];
    }
}
