<?php

namespace App\Models;

use CodeIgniter\Model;

class ClientPolicyModel extends Model
{
    protected $table            = 'client_policy';
    protected $primaryKey       = 'id';

    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;

    protected $allowedFields    = [
        'client_id',
        'client_branch_id',
        'policy_id',
        'policy_type_id',
        'insurer_id',
        'insurer_branch_id',
        'tpa_id',
        'tpa_branch_id',
        'policy_start_date',
        'policy_end_date',
        'policy_no',
        'cd_ac_no',
        'insured',
        'no_of_employees',
        'no_of_lives',
        'no_lives_at_inception',
        'policy_status',
        'premium_paid_at_inception',
        'earned_premium_date',
        'claims_incurred_date',
        'earned_premium_amount',
        'claims_incurred_amount',
        'incurred_claims_ratio',
        'claims_experience_for_last_3_years',
        'policy_terms',
        'is_addon',
        'base_policy',
        'inception_type',
        'created_by',
        'created_at',
        'updated_by',
        'updated_at',
        'is_active',
        'open_for_enrollment',
        'gst',
        'enrolment_visibility',
        'open_date',
        'close_date',
        'reminder_date',
        'disclaimer',
        'is_member_modify_allowed',
        'cd_ac_pk',
        'is_lgbtq',
        'placement_json',
    ];

    // Auto timestamps
    protected $useTimestamps = true;
    protected $createdField  = 'created_at';
    protected $updatedField  = 'updated_at';

    // Optional validation rules
    protected $validationRules    = [];
    protected $validationMessages = [];
    protected $skipValidation     = true;
}
