<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class WeightedAveragePriceHistory extends Model
{
    protected $fillable = [
        'account_id',
        'weighted_average_price',
    ];

    protected $casts = [
        'weighted_average_price' => 'decimal:4',
    ];

    /**
     * Get the account that owns the weighted average price history.
     */
    public function account(): BelongsTo
    {
        return $this->belongsTo(Account::class);
    }
}
