<?php

namespace App\Models;

use CodeIgniter\Model;

class ApplicationStatusHistoryModel extends Model
{
    protected $table         = 'application_status_history';
    protected $useTimestamps = false;
    protected $allowedFields = ['job_application_id', 'from_status', 'to_status', 'changed_by_user_id', 'note', 'created_at'];

    public function forApplication(int $applicationId): array
    {
        return $this->where('job_application_id', $applicationId)->orderBy('created_at', 'ASC')->findAll();
    }
}
