<?php

namespace App\Models;

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

class LaundrySaleProductServicePrice extends Model
{
    protected $table = 'laundry_sale_product_prices';

    protected $fillable = [
        'laundry_sale_product_id',
        'etapa_id',
        'amount',
    ];

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

    public function product(): BelongsTo
    {
        return $this->belongsTo(LaundrySaleProduct::class, 'laundry_sale_product_id');
    }

    public function etapa(): BelongsTo
    {
        return $this->belongsTo(Etapa::class, 'etapa_id');
    }
}
