<?php

namespace App\Models;

use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class ServiceVersion extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'service_id',
        'version_number',
        'effective_from',
        'effective_to',
        'status',
        'change_summary',
        'configuration_json',
        'created_by',
    ];

    protected $casts = [
        'effective_from' => 'datetime',
        'effective_to' => 'datetime',
        'configuration_json' => 'array',
    ];

    public function service()
    {
        return $this->belongsTo(Service::class);
    }
}
