<?php

namespace App\Models;

use Database\Factories\AdoptionApplicationNoteFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;

/**
 * @property int $id
 * @property int $adoption_application_id
 * @property string $note
 * @property int|null $created_by
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @property-read AdoptionApplication $adoptionApplication
 * @property-read User|null $createdBy
 *
 * @method static \Database\Factories\AdoptionApplicationNoteFactory factory($count = null, $state = [])
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereAdoptionApplicationId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereCreatedBy($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereNote($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|AdoptionApplicationNote whereUpdatedAt($value)
 *
 * @mixin \Eloquent
 */
class AdoptionApplicationNote extends Model
{
    /** @use HasFactory<AdoptionApplicationNoteFactory> */
    use HasFactory;

    protected $fillable = [
        'adoption_application_id',
        'note',
        'created_by',
    ];

    /**
     * @return BelongsTo<AdoptionApplication, $this>
     */
    public function adoptionApplication(): BelongsTo
    {
        return $this->belongsTo(AdoptionApplication::class);
    }

    /**
     * @return BelongsTo<User, $this>
     */
    public function createdBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'created_by');
    }
}
