<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Guarded;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

#[Guarded(['id'])]
class CuttingResult extends Model
{
    use HasFactory, SoftDeletes;

    protected function casts(): array
    {
        return [
            'cutting_result' => 'integer',
            'sample' => 'integer',
            'original_outside_sample' => 'integer',
        ];
    }

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

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