<?php
namespace App\Models;

class CommissionLedger
{
    public $id;
    public $user_id;
    public $rule_id;
    public $kpi_score_recorded;
    public $calculated_amount;
    public $calculation_date;
    public $created_at;

    public function __construct(array $data = [])
    {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }

    public function toArray(): array
    {
        return get_object_vars($this);
    }
}
