<?php

namespace App\Http\Resources\Api\V1;

use App\Support\ModuleRegistry;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class TenantResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id'                  => $this->id,
            'name'                => $this->name,
            'slug'                => $this->slug,
            'business_type'       => $this->business_type,
            'business_type_label' => $this->getBusinessTypeLabel(),
            'enabled_modules'     => $this->enabled_modules ?? [],
            'settings'            => $this->settings ?? [],
            'subscription_plan'   => $this->subscription_plan,
            'is_active'           => $this->is_active,
            'owner_id'            => $this->owner_id,
            'created_at'          => $this->created_at,
        ];
    }
}
