<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @mixin IdeHelperListingPriceHistory
 */
class ListingPriceHistory extends Model
{
    protected $fillable = [
        'listing_id',
        'old_price',
        'new_price',
        'currency',
        'active'
    ];

    protected $casts = [
        'active' => 'boolean',
        'old_price' => 'decimal:2',
        'new_price' => 'decimal:2',
    ];

    public function listing()
    {
        return $this->belongsTo(Listing::class);
    }
}
