<?php

namespace App\Models;

use CodeIgniter\Model;

class ProfitTargetModel extends Model
{
    protected $table            = 'profit_targets';
    protected $primaryKey       = 'id_target';
    protected $allowedFields    = ['bulan', 'tahun', 'target_pendapatan', 'target_laba'];
    
    protected $useTimestamps    = true;
    protected $createdField     = 'created_at';
    protected $updatedField     = ''; // Tidak ada updated_at di SQL

    protected $validationRules  = [
        'bulan' => 'required|numeric',
        'tahun' => 'required|numeric|exact_length[4]',
    ];
}