<?php

namespace App\Models;

use CodeIgniter\Model;

class MembresiaModel extends Model
{
    protected $table            = 'membresia';
    protected $primaryKey       = 'id_membresia';
    protected $useAutoIncrement = true;
    protected $returnType       = 'App\Entities\Membresia';
    protected $useSoftDeletes   = false;
    protected $protectFields    = true;
    protected $allowedFields    = [
        'nombre',
        'descuento_pct',
        'puntos_por_sol',
        'precio_mensual'
    ];

    protected $validationRules = [
        'nombre'         => 'required|min_length[2]|max_length[80]',
        'descuento_pct'  => 'required|numeric|greater_than_equal_to[0]',
        'puntos_por_sol' => 'required|numeric|greater_than_equal_to[0]',
        'precio_mensual' => 'required|numeric|greater_than_equal_to[0]',
    ];
}
