Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| GetAumHistoryAction | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __invoke | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Action\Admin; |
| 6 | |
| 7 | use App\Domain\Admin\Service\AdminService; |
| 8 | use App\Renderer\JsonRenderer; |
| 9 | use Psr\Http\Message\ResponseInterface; |
| 10 | use Psr\Http\Message\ServerRequestInterface; |
| 11 | |
| 12 | /** |
| 13 | * Get platform-wide AUM balance history for admin dashboard chart. |
| 14 | * |
| 15 | * GET /api/admin/aum-history |
| 16 | */ |
| 17 | final readonly class GetAumHistoryAction |
| 18 | { |
| 19 | public function __construct( |
| 20 | private AdminService $service, |
| 21 | private JsonRenderer $renderer, |
| 22 | ) {} |
| 23 | |
| 24 | public function __invoke( |
| 25 | ServerRequestInterface $request, |
| 26 | ResponseInterface $response, |
| 27 | ): ResponseInterface { |
| 28 | $history = $this->service->getAumHistory(); |
| 29 | |
| 30 | return $this->renderer->json($response, [ |
| 31 | 'success' => true, |
| 32 | 'data' => $history, |
| 33 | ]); |
| 34 | } |
| 35 | } |