<?php
namespace App\Models;
use CodeIgniter\Model;

class JobChecklistModel extends Model
{
    protected $table         = 'job_checklists';
    protected $primaryKey    = 'id';
    protected $allowedFields  = ['job_id','company_id','template_id','text','completed','completed_by','completed_at','photo_path','notes','sort_order','created_at','updated_at','deleted_at'];

    public function forJob(int $jobId): array
    {
        return $this->where('job_id', $jobId)->orderBy('sort_order')->findAll();
    }
}
