Update controllers and services for allocation fidelity: - AllocationController: variance data in responses, bulk operations - ProjectController: include plan data in responses - ProjectMonthPlanController: planning grid API - AllocationMatrixService: support untracked allocations - ProjectResource/TeamMemberResource: include reconciliation data Improved test coverage for allocation flows.
42 lines
912 B
PHP
42 lines
912 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\RoleResource;
|
|
use App\Models\Role;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* @group Roles
|
|
*
|
|
* Endpoints for managing roles.
|
|
*/
|
|
class RolesController extends Controller
|
|
{
|
|
/**
|
|
* List all roles
|
|
*
|
|
* Get a list of all available roles for team members.
|
|
*
|
|
* @authenticated
|
|
*
|
|
* @response 200 {
|
|
* "data": [
|
|
* {
|
|
* "id": 1,
|
|
* "name": "Frontend Dev",
|
|
* "description": "Frontend Developer - specializes in UI/UX and client-side development"
|
|
* }
|
|
* ]
|
|
* }
|
|
*/
|
|
public function index(Request $request): JsonResponse
|
|
{
|
|
$roles = Role::orderBy('name')->get(['id', 'name', 'description']);
|
|
|
|
return $this->wrapResource(RoleResource::collection($roles));
|
|
}
|
|
}
|