<?php

namespace App\Models;

use CodeIgniter\Model;

class SystemSettingModel extends Model
{
    protected $table            = 'system_settings';
    protected $primaryKey       = 'id_system';
    protected $allowedFields    = ['production_limit', 'invoice_prefix', 'timezone', 'currency', 'wa_api_key', 'maintenance_mode'];

    public function getProductionLimit()
    {
        $data = $this->first(); // Mengambil baris pertama
        return $data ? (int)$data['production_limit'] : 10;
    }
}