<?php

namespace App\Models;

use CodeIgniter\Model;

class MailTemplateModel extends Model
{
    protected $table            = 'm_mail_template';
    protected $primaryKey       = 'template_id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;

    protected $allowedFields    = [
        'org_id',
        'template_name',
        'subject',
        'body_html',
        'image_location',
        'created_by',
        'updated_by',
        'is_active',
        'placeholder',
    ];

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

    // Validation rules (optional)
    protected $validationRules = [
        'template_name' => 'required|max_length[45]',
    ];
}
