<?php

namespace App\Modules\Tenant\Controllers;

use App\Http\Controllers\Controller;
use App\Http\Responses\ApiResponse;
use App\Modules\Tenant\Resources\CompanyResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class TenantContextController extends Controller
{
    public function current(Request $request): JsonResponse
    {
        return ApiResponse::success([
            'company' => new CompanyResource(
                $request->attributes->get('currentCompany')->load(['activeSubscription.plan.features'])
            ),
        ]);
    }
}
