<?php

namespace App\Models;

use CodeIgniter\Model;

class FilesModel extends Model
{
    protected $table            = 'partner_files';
    protected $primaryKey       = 'id';

    protected $useAutoIncrement = true;

    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;

    protected $allowedFields = [
        'enquiry_id',
        'file_name',
        'is_active',
        'created_at',
        'created_by',
        'updated_at',
        'updated_by'
    ];

    // Automatically handle created_at / updated_at (if you prefer CI4 timestamps)
    protected $useTimestamps = false; // using manual timestamps in DB

    // Validation Rules (optional)
    protected $validationRules = [
        'enquiry_id' => 'required|integer',
        'file_name'  => 'required|min_length[1]|max_length[255]',
        'is_active'  => 'permit_empty|in_list[0,1]'
    ];
}
