<?php

namespace App\Models;

use CodeIgniter\Model;

class PurchaseOrderItemModel extends Model
{
    protected $table          = 'purchase_order_items';
    protected $primaryKey     = 'id';
    protected $allowedFields  = ['purchase_order_id','supply_id','description','quantity','received_qty','unit_cost'];
    protected $useTimestamps  = true;

    protected $validationRules = [
        'purchase_order_id' => 'required|is_natural_no_zero',
        'supply_id'         => 'required|is_natural_no_zero',
        'quantity'          => 'required|is_natural_no_zero',
        'unit_cost'         => 'required|decimal',
    ];
}
