<?php

namespace App\Models;

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

class StockMovement extends Model
{
    protected $fillable = ['product_id', 'invoice_id', 'type', 'quantity', 'note'];
    protected function casts(): array { return ['quantity' => 'decimal:2']; }
    public function product(): BelongsTo { return $this->belongsTo(Product::class); }
    public function invoice(): BelongsTo { return $this->belongsTo(Invoice::class); }
}
