<?php

declare(strict_types=1);

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Services\AchievementService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

final class UserAchievementsController extends Controller
{
    public function __invoke(Request $request, AchievementService $achievements): JsonResponse
    {
        return response()->json($achievements->summary($request->user()->id));
    }
}