Skip to content

Commit

Permalink
Adopt API Endpoint naming (solve #67)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatjaGlassConsulting committed Jan 18, 2025
1 parent c36e47f commit 78fed54
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions API/ApprovalBundleApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[OA\Tag(name: 'ApprovalBundleApi')]
#[OA\Tag(name: 'ApprovalBundle')]
final class ApprovalBundleApiController extends BaseApiController
{
public function __construct(
Expand All @@ -53,7 +53,7 @@ public function __construct(
#[OA\Response(response: 200, description: 'URL to submitted week')]
#[Rest\QueryParam(name: 'user', requirements: '\d+', strict: true, nullable: true, description: 'User ID to get information for')]
#[Rest\QueryParam(name: 'date', nullable: false, description: 'Date as monday of selected week: Y-m-d')]
#[Route(methods: ['POST'], path: '/add_to_approve')]
#[Route(methods: ['POST'], path: '/approval-bundle/add_to_approve')]
public function submitWeekAction(Request $request): Response
{
$selectedUserId = $request->query->get('user');
Expand Down
4 changes: 2 additions & 2 deletions API/ApprovalNextWeekApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[OA\Tag(name: 'ApprovalNextWeekApi')]
#[OA\Tag(name: 'ApprovalBundle')]
final class ApprovalNextWeekApiController extends BaseApiController
{
public function __construct(
Expand All @@ -36,7 +36,7 @@ public function __construct(

#[OA\Response(response: 200, description: 'Status of selected week')]
#[Rest\QueryParam(name: 'user', requirements: '\d+', strict: true, nullable: true, description: 'User ID to get information for')]
#[Route(methods: ['GET'], path: '/next-week')]
#[Route(methods: ['GET'], path: '/approval-bundle/next-week')]
public function nextWeekAction(Request $request): Response
{
$selectedUserId = $request->query->get('user');
Expand Down
4 changes: 2 additions & 2 deletions API/ApprovalOvertimeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[OA\Tag(name: 'ApprovalBundleApi')]
#[OA\Tag(name: 'ApprovalBundle')]
final class ApprovalOvertimeController extends BaseApiController
{
public function __construct(
Expand All @@ -40,7 +40,7 @@ public function __construct(
#[OA\Response(response: 200, description: 'Get overtime for that year')]
#[Rest\QueryParam(name: 'user', requirements: '\d+', strict: true, nullable: true, description: 'User ID to get information for')]
#[Rest\QueryParam(name: 'date', nullable: false, description: 'Date to get overtime until/including this date: Y-m-d')]
#[Route(methods: ['GET'], path: '/overtime_year')]
#[Route(methods: ['GET'], path: '/approval-bundle/overtime_year')]
public function overtimeForYearUntil(Request $request): Response
{
$selectedUserId = $request->query->get('user');
Expand Down
4 changes: 2 additions & 2 deletions API/ApprovalOvertimeWeeklyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[OA\Tag(name: 'ApprovalBundleApi')]
#[OA\Tag(name: 'ApprovalBundle')]
final class ApprovalOvertimeWeeklyController extends BaseApiController
{
public function __construct(
Expand All @@ -40,7 +40,7 @@ public function __construct(
#[OA\Response(response: 200, description: "Get weekly overtime overview for all weeks from 'date' and later")]
#[Rest\QueryParam(name: 'user', requirements: '\d+', strict: true, nullable: true, description: 'User ID to get information for')]
#[Rest\QueryParam(name: 'date', nullable: false, description: 'Date to get weekly overtime overview up from this date: Y-m-d')]
#[Route(methods: ['GET'], path: '/weekly_overtime')]
#[Route(methods: ['GET'], path: '/approval-bundle/weekly_overtime')]
public function weeklyOvertime(Request $request): Response
{
$selectedUserId = $request->query->get('user');
Expand Down
4 changes: 2 additions & 2 deletions API/ApprovalStatusApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[OA\Tag(name: 'ApprovalStatusApi')]
#[OA\Tag(name: 'ApprovalBundle')]
final class ApprovalStatusApiController extends BaseApiController
{
public function __construct(
Expand All @@ -40,7 +40,7 @@ public function __construct(
#[OA\Response(response: 200, description: 'Status of selected week')]
#[Rest\QueryParam(name: 'user', requirements: '\d+', strict: true, nullable: true, description: 'User ID to get information for')]
#[Rest\QueryParam(name: 'date', nullable: false, description: 'Date as monday of selected week: Y-m-d')]
#[Route(methods: ['GET'], path: '/week-status')]
#[Route(methods: ['GET'], path: '/approval-bundle/week-status')]
public function submitWeekAction(Request $request): Response
{
$selectedUserId = $request->query->get('user');
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.2.0

- **API endpoints changed** to support Kimai naming conventions
- All API endpoints contain additionally "/approval-bundle/" in as prefix - this is a breaking change, so if you have integrations, you need to update them - the "TimeKex" integration has been updated - use the latest release and update the configuration

## 2.1.4

- fix: Break issue calculations had not been correct, when time entries had been in misorder, e.g. entered later times before earlier times, this is now fixed.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Kimai plugin to manage approvals and supporting related API",
"homepage": "https://www.kimai.org/store/katjaglass-approval-bundle.html",
"type": "kimai-plugin",
"version": "2.1.3",
"version": "2.2.0",
"keywords": [
"kimai",
"kimai-plugin"
Expand Down

0 comments on commit 78fed54

Please # to comment.