<?php
// app/Models/ProductStockSnapshot.php

namespace App\Models;

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

class ProductStockSnapshot extends Model
{
    protected $table = 'product_stock_snapshots';
    
    protected $fillable = [
        'product_id',
        'current_stock',
        'snapshot_date',
        'notes'
    ];
    
    protected $casts = [
        'snapshot_date' => 'date',
        'current_stock' => 'integer'
    ];
    
    public function product(): BelongsTo
    {
        return $this->belongsTo(Product::class);
    }
}