<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CustomerPointLedger extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    protected $casts = [
        'customer_id' => 'integer',
        'source_id' => 'integer',
        'points' => 'integer',
        'amount_value' => 'float',
        'balance_after' => 'integer',
        'created_by_admin_id' => 'integer',
    ];

    public function customer()
    {
        return $this->belongsTo(User::class, 'customer_id');
    }
}
