Added usage check to delete endpoints

This commit is contained in:
Constantin Graf
2024-04-18 21:42:29 +02:00
committed by Constantin Graf
parent 40f1159ea5
commit ad6146c483
18 changed files with 326 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
declare(strict_types=1);
use App\Exceptions\Api\EntityStillInUseApiException;
use App\Exceptions\Api\InactiveUserCanNotBeUsedApiException;
use App\Exceptions\Api\TimeEntryCanNotBeRestartedApiException;
use App\Exceptions\Api\TimeEntryStillRunningApiException;
@@ -15,5 +16,6 @@ return [
TimeEntryCanNotBeRestartedApiException::KEY => 'Time entry is already stopped and can not be restarted',
InactiveUserCanNotBeUsedApiException::KEY => 'Inactive user can not be used',
UserIsAlreadyMemberOfProjectApiException::KEY => 'User is already a member of the project',
EntityStillInUseApiException::KEY => 'The :modelToDelete is still used by a :modelInUse and can not be deleted.',
],
];

View File

@@ -202,4 +202,16 @@ return [
'currency' => 'The :attribute field must be a valid currency code (ISO 4217).',
'organization' => 'The :attribute does not exist.',
'task_belongs_to_project' => 'The :attribute is not part of the given project.',
'entities' => [
'organization' => 'organization',
'project' => 'project',
'task' => 'task',
'time_entry' => 'time entry',
'user' => 'user',
'client' => 'client',
'member' => 'member',
'project_member' => 'project member',
'tag' => 'tag',
],
];