<?php
namespace App\Models;

class CommissionRule
{
    public $id;
    public $salesperson_user_id;
    public $product_id;
    public $base_rate_percent;
    public $valid_from;
    public $valid_to;
    public $is_active;
    public $created_by_user_id;
    public $created_at;
    public $updated_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);
    }
}
