<?php

namespace App\Models;

use CodeIgniter\Model;

class BarangModel extends Model
{
    protected $table            = 'barang';
    protected $primaryKey       = 'id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';

    protected $allowedFields = [
        'kode_barang',
        'nama_barang',
        'deskripsi_barang',
        'kategori_id',
        'satuan',
        'lokasi_barang',
        'harga_beli',
        'harga_beli_awal',
        'harga_jual',
        'stok_minimum',
        'stok_awal',
        'stok',
        'foto',
        'qrcode',
        'barcode',
    ];

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