Added time entry api endpoints; Increased phpstan level; renamed to solidtime

This commit is contained in:
Constantin Graf
2024-02-26 14:27:12 +01:00
parent e60e502612
commit 9c5a238dda
36 changed files with 1716 additions and 461 deletions

View File

@@ -3,7 +3,9 @@
declare(strict_types=1);
use App\Http\Controllers\Api\V1\ProjectController;
use App\Http\Controllers\Api\V1\TimeEntryController;
use Illuminate\Support\Facades\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/*
|--------------------------------------------------------------------------
@@ -25,4 +27,21 @@ Route::middleware('auth:api')->prefix('v1')->name('v1.')->group(static function
Route::delete('/organization/{organization}/projects/{project}', [ProjectController::class, 'destroy'])->name('destroy');
});
Route::name('time-entries.')->group(static function () {
Route::get('/organization/{organization}/time-entries', [TimeEntryController::class, 'index'])->name('index');
Route::post('/organization/{organization}/time-entries', [TimeEntryController::class, 'store'])->name('store');
Route::put('/organization/{organization}/time-entries/{timeEntry}', [TimeEntryController::class, 'update'])->name('update');
Route::delete('/organization/{organization}/time-entries/{timeEntry}', [TimeEntryController::class, 'destroy'])->name('destroy');
});
});
/**
* Fallback routes, to prevent a rendered HTML page in /api/* routes
* The / route is also included since the fallback is not triggered on the root route
*/
Route::get('/', function (): void {
throw new NotFoundHttpException('API resource not found');
});
Route::fallback(function (): void {
throw new NotFoundHttpException('API resource not found');
});