<?php

namespace App\Domains\Admin\Controllers;

use App\Scopes\CommonController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ManagedTenantPaymentGetController extends CommonController
{
    public function __invoke(string $slug, Request $request): JsonResponse
    {
        $tenant = $this->adminTenants->findBySlug($slug);

        return response()->json([
            'account_iban' => $tenant->account_iban,
            'account_bic' => $tenant->account_bic,
            'account_name' => $tenant->account_name,
            'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/payment',
        ]);
    }
}
