<?php

namespace App\Models;

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

class Service extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'slug',
        'default_price',
        'billing_type',
        'is_active',
        'sort_order',
    ];

    protected $casts = [
        'default_price' => 'decimal:2',
        'is_active' => 'boolean',
    ];

    public function categoryOverrides()
    {
        return $this->hasMany(CategoryServiceOverride::class);
    }

    public function productLinks()
    {
        return $this->hasMany(ProductServiceLink::class);
    }
}
