<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class ClientAccount extends Model
{
    use HasFactory;
    use HasUuids;

    protected $fillable = [
        'name',
        'email',
        'domains',
        'status',
        'metadata',
    ];

    protected function casts(): array
    {
        return [
            'domains' => 'array',
            'metadata' => 'array',
        ];
    }

    public function licenses(): HasMany
    {
        return $this->hasMany(License::class, 'client_account_id');
    }
}
