<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Http\Resources\GuideCardResource;
use App\Repositories\Contracts\GuideCardRepositoryInterface;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use OpenApi\Attributes as OA;

class GuideCardController extends Controller
{
    public function __construct(private GuideCardRepositoryInterface $repository) {}

    #[OA\Get(
        path: '/api/v1/guide-cards',
        summary: 'Rehber kartlarını listele',
        tags: ['Guide Cards'],
        responses: [new OA\Response(response: 200, description: 'Rehber kart listesi')],
    )]
    public function index(): AnonymousResourceCollection
    {
        return GuideCardResource::collection($this->repository->active());
    }
}
