<?php

namespace App\Http\Controllers\Api\V1\Design;

use App\Helpers\ApiResponse;
use App\Http\Controllers\Controller;
use App\Http\Requests\Audit\AuditLogIndexRequest;
use App\Services\Audit\AuditLogService;

class AuditLogController extends Controller
{
    public function __construct(
        protected AuditLogService $service
    ) {}

    public function index(AuditLogIndexRequest $request)
    {
        return ApiResponse::handle(function () use ($request) {
            $filters = $request->validated();

            return $this->service->paginate($filters);
        }, __('message.fetched'));
    }
}
