<?php

namespace Modules\Activity\Entities;

use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Auth\Entities\User;

class ActivityReport extends Model
{
    use HasUuids;

    protected $table = 'activity_reports';

    protected $fillable = [
        'activity_id',
        'report_text',
        'prepared_by',
    ];

    protected function casts(): array
    {
        return [
            'report_text' => 'string',
        ];
    }

    public function activity(): BelongsTo
    {
        return $this->belongsTo(Activity::class);
    }

    public function preparedBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'prepared_by');
    }
}
