<?php

namespace App\Models;

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

class GasOrderItem extends Model
{
    use HasFactory;

    protected $fillable = [
        'gas_order_id',
        'gas_cylinder_id',
        'quantity',
        'unit_price',
        'total_price',
        'special_instructions',
    ];

    protected $casts = [
        'unit_price' => 'decimal:2',
        'total_price' => 'decimal:2',
    ];

    public function gasOrder(): BelongsTo
    {
        return $this->belongsTo(GasOrder::class);
    }

    public function gasCylinder(): BelongsTo
    {
        return $this->belongsTo(GasCylinder::class);
    }
}
