<?php

namespace App\Models;

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

class TailorRating extends Model
{
    use HasFactory;

    protected $fillable = [
        'booking_id',
        'customer_id',
        'tailor_id',
        'rating',
        'review'
    ];

    protected $casts = [
        'rating' => 'decimal:1'
    ];

    public function booking()
    {
        return $this->belongsTo(Booking::class);
    }

    public function customer()
    {
        return $this->belongsTo(User::class, 'customer_id');
    }

    public function tailor()
    {
        return $this->belongsTo(User::class, 'tailor_id');
    }
} 