<?php

namespace App\Models;

use CodeIgniter\Model;

class PerizinanModel extends Model
{
    protected $table            = 'perizinan';
    protected $primaryKey       = 'id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;
    protected $protectFields    = true;
    protected $allowedFields    = [
        'kode_izin', 'santri_id', 'pembuat_user_id', 'sumber_izin',
        'kategori_izin', 'tgl_mulai', 'tgl_kembali_rencana', 'alasan',
        'status_approval', 'disetujui_oleh', 'qr_token', 'status_gerbang',
        'waktu_keluar_riil', 'waktu_kembali_riil', 'petugas_keluar_id', 'petugas_kembali_id'
    ];

    // Dates
    protected $useTimestamps = true;
    protected $dateFormat    = 'datetime';
    protected $createdField  = 'created_at';
    protected $updatedField  = '';
    protected $deletedField  = '';
}
