Implement full CRUD operations for team members with TDD approach: Backend: - TeamMemberController with REST API endpoints - TeamMemberService for business logic extraction - TeamMemberPolicy for authorization (superuser/manager access) - 14 tests passing (8 API, 6 unit tests) Frontend: - Team member list with search and status filter - Create/Edit modal with form validation - Delete confirmation with constraint checking - Currency formatting for hourly rates - Real API integration with teamMemberService Tests: - E2E tests fixed with seed data helper - All 157 tests passing (backend + frontend + E2E) Closes #22
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\AuthController;
|
|
use App\Http\Controllers\Api\TeamMemberController;
|
|
use App\Http\Middleware\JwtAuth;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| These routes are loaded by the RouteServiceProvider within a group which
|
|
| is assigned the "api" middleware group.
|
|
|
|
|
*/
|
|
|
|
Route::post('/auth/login', [AuthController::class, 'login']);
|
|
Route::post('/auth/refresh', [AuthController::class, 'refresh']);
|
|
|
|
Route::middleware(JwtAuth::class)->group(function () {
|
|
Route::post('/auth/logout', [AuthController::class, 'logout']);
|
|
|
|
Route::get('/user', function (\Illuminate\Http\Request $request) {
|
|
return response()->json([
|
|
'id' => $request->user()->id,
|
|
'name' => $request->user()->name,
|
|
'email' => $request->user()->email,
|
|
'role' => $request->user()->role,
|
|
]);
|
|
});
|
|
|
|
// Team Members
|
|
Route::apiResource('team-members', TeamMemberController::class);
|
|
});
|