<?php

namespace App\Modules\Face\Models;

use CodeIgniter\Model;

class StudentFaceModel extends Model
{
    protected $table            = 'student_faces';
    protected $primaryKey       = 'id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $protectFields    = true;
    protected $allowedFields    = [
        'student_id',
        'embedding',
        'source',
        'quality_score',
    ];

    protected $useTimestamps = true;
    protected $createdField  = 'created_at';
    protected $updatedField  = 'updated_at';

    protected $validationRules = [
        'student_id'    => 'required|integer|is_not_unique[students.id]',
        'embedding'     => 'required',
        'source'        => 'required|in_list[formal,live,live_avg]',
        'quality_score' => 'permit_empty|numeric',
    ];
}

