Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions documentation/Dotkernel_API.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"identity\": \"{{$randomUserName}}\",\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"status\": \"active\",\r\n \"roles\": [\r\n {\r\n \"uuid\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"raw": "{\r\n \"identity\": \"{{$randomUserName}}\",\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"status\": \"active\",\r\n \"roles\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -178,7 +178,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"roles\": [\r\n {\r\n \"uuid\": \"{{$randomUUID}}\"\r\n }\r\n ],\r\n \"status\": \"active\"\r\n}",
"raw": "{\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"roles\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\"\r\n }\r\n ],\r\n \"status\": \"active\"\r\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -209,7 +209,8 @@
""
],
"type": "text/javascript",
"packages": {}
"packages": {},
"requests": {}
}
}
],
Expand Down Expand Up @@ -1176,7 +1177,9 @@
"exec": [
""
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {},
"requests": {}
}
}
],
Expand All @@ -1185,7 +1188,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"identity\": \"{{$randomUserName}}\",\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"status\": \"pending\",\r\n \"detail\": {\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"email\": \"{{$randomExampleEmail}}\"\r\n },\r\n \"roles\": [\r\n {\r\n \"uuid\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"raw": "{\r\n \"identity\": \"{{$randomUserName}}\",\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"status\": \"pending\",\r\n \"detail\": {\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"email\": \"{{$randomExampleEmail}}\"\r\n },\r\n \"roles\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -1314,7 +1317,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"status\": \"active\",\r\n \"detail\": {\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"email\": \"{{$randomExampleEmail}}\"\r\n },\r\n \"roles\": [\r\n {\r\n \"uuid\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"raw": "{\r\n \"password\": \"dotkernel\",\r\n \"passwordConfirm\": \"dotkernel\",\r\n \"status\": \"active\",\r\n \"detail\": {\r\n \"firstName\": \"{{$randomFirstName}}\",\r\n \"lastName\": \"{{$randomLastName}}\",\r\n \"email\": \"{{$randomExampleEmail}}\"\r\n },\r\n \"roles\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\"\r\n }\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/src/Command/AdminCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* firstName: string,
* lastName: string,
* status: 'active',
* roles: array{uuid: non-empty-string}[],
* roles: array{id: non-empty-string}[],
* }
* @throws Exception
*/
Expand All @@ -118,7 +118,7 @@ private function getData(InputInterface $input): array
'lastName' => trim($input->getOption('lastName')),
'status' => AdminStatusEnum::Active->value,
'roles' => [
['uuid' => $adminRole->getUuid()->toString()],
['id' => $adminRole->getId()->toString()],
],
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/src/InputFilter/AdminRoleInputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

/**
* @phpstan-type AdminRoleDataType array{
* uuid: non-empty-string,
* id: non-empty-string,
* }
* @extends AbstractInputFilter<AdminRoleDataType>
*/
class AdminRoleInputFilter extends AbstractInputFilter
{
public function __construct()
{
$this->add(new UuidInput('uuid'));
$this->add(new UuidInput('id'));

Check warning on line 20 in src/Admin/src/InputFilter/AdminRoleInputFilter.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 20 in src/Admin/src/InputFilter/AdminRoleInputFilter.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 20 in src/Admin/src/InputFilter/AdminRoleInputFilter.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 20 in src/Admin/src/InputFilter/AdminRoleInputFilter.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
}
}
48 changes: 24 additions & 24 deletions src/Admin/src/OpenAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
property: 'roles',
type: 'array',
items: new OA\Items(
required: ['uuid'],
required: ['id'],
properties: [
new OA\Property(property: 'uuid', type: 'string'),
new OA\Property(property: 'id', type: 'string'),

Check warning on line 123 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 123 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 123 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 123 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
],
),
),
Expand Down Expand Up @@ -157,15 +157,15 @@
* @see DeleteAdminResourceHandler::handle()
*/
#[OA\Delete(
path: '/admin/{uuid}',
description: 'Authenticated (super)admin deletes an admin account identified by its UUID',
path: '/admin/{id}',

Check warning on line 160 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 160 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 160 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 160 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration
description: 'Authenticated (super)admin deletes an admin account identified by its id',

Check warning on line 161 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin deletes an admin account identified by its id'' type is not compatible with declaration

Check warning on line 161 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin deletes an admin account identified by its id'' type is not compatible with declaration

Check warning on line 161 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin deletes an admin account identified by its id'' type is not compatible with declaration

Check warning on line 161 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin deletes an admin account identified by its id'' type is not compatible with declaration
summary: 'Admin deletes an admin account',
security: [['AuthToken' => []]],
tags: ['Admin'],
parameters: [
new OA\Parameter(
name: 'uuid',
description: 'Admin UUID',
name: 'id',

Check warning on line 167 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 167 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 167 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 167 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
description: 'Admin id',

Check warning on line 168 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 168 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 168 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 168 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration
in: 'path',
required: true,
schema: new OA\Schema(type: 'string'),
Expand All @@ -187,15 +187,15 @@
* @see GetAdminResourceHandler::handle()
*/
#[OA\Get(
path: '/admin/{uuid}',
description: 'Authenticated (super)admin fetches an admin account identified by its UUID',
path: '/admin/{id}',

Check warning on line 190 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 190 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 190 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 190 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration
description: 'Authenticated (super)admin fetches an admin account identified by its id',

Check warning on line 191 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin account identified by its id'' type is not compatible with declaration

Check warning on line 191 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin account identified by its id'' type is not compatible with declaration

Check warning on line 191 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin account identified by its id'' type is not compatible with declaration

Check warning on line 191 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin account identified by its id'' type is not compatible with declaration
summary: 'Admin fetches an admin account',
security: [['AuthToken' => []]],
tags: ['Admin'],
parameters: [
new OA\Parameter(
name: 'uuid',
description: 'Admin UUID',
name: 'id',

Check warning on line 197 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 197 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 197 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 197 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
description: 'Admin id',

Check warning on line 198 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 198 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 198 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 198 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration
in: 'path',
required: true,
schema: new OA\Schema(type: 'string'),
Expand All @@ -218,7 +218,7 @@
* @see PatchAdminResourceHandler::handle()
*/
#[OA\Patch(
path: '/admin/{uuid}',
path: '/admin/{id}',

Check warning on line 221 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 221 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 221 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration

Check warning on line 221 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/{id}'' type is not compatible with declaration
description: 'Authenticated (super)admin updates an existing admin account',
summary: 'Admin updates an admin account',
security: [['AuthToken' => []]],
Expand All @@ -236,9 +236,9 @@
property: 'roles',
type: 'array',
items: new OA\Items(
required: ['uuid'],
required: ['id'],
properties: [
new OA\Property(property: 'uuid', type: 'string'),
new OA\Property(property: 'id', type: 'string'),

Check warning on line 241 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 241 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 241 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 241 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
],
),
),
Expand All @@ -249,8 +249,8 @@
tags: ['Admin'],
parameters: [
new OA\Parameter(
name: 'uuid',
description: 'Admin UUID',
name: 'id',

Check warning on line 252 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 252 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 252 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 252 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
description: 'Admin id',

Check warning on line 253 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 253 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 253 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration

Check warning on line 253 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin id'' type is not compatible with declaration
in: 'path',
required: true,
schema: new OA\Schema(type: 'string'),
Expand Down Expand Up @@ -352,15 +352,15 @@
* @see GetAdminRoleResourceHandler::handle()
*/
#[OA\Get(
path: '/admin/role/{uuid}',
description: 'Authenticated (super)admin fetches an admin role identified by its UUID',
path: '/admin/role/{id}',

Check warning on line 355 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/role/{id}'' type is not compatible with declaration

Check warning on line 355 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/role/{id}'' type is not compatible with declaration

Check warning on line 355 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/role/{id}'' type is not compatible with declaration

Check warning on line 355 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/role/{id}'' type is not compatible with declaration
description: 'Authenticated (super)admin fetches an admin role identified by its id',

Check warning on line 356 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin role identified by its id'' type is not compatible with declaration

Check warning on line 356 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin role identified by its id'' type is not compatible with declaration

Check warning on line 356 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin role identified by its id'' type is not compatible with declaration

Check warning on line 356 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Authenticated (super)admin fetches an admin role identified by its id'' type is not compatible with declaration
summary: 'Admin fetches an admin role',
security: [['AuthToken' => []]],
tags: ['AdminRole'],
parameters: [
new OA\Parameter(
name: 'uuid',
description: 'Admin role UUID',
name: 'id',

Check warning on line 362 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 362 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 362 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 362 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
description: 'Admin role id',

Check warning on line 363 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin role id'' type is not compatible with declaration

Check warning on line 363 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin role id'' type is not compatible with declaration

Check warning on line 363 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin role id'' type is not compatible with declaration

Check warning on line 363 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''Admin role id'' type is not compatible with declaration
in: 'path',
required: true,
schema: new OA\Schema(type: 'string'),
Expand Down Expand Up @@ -418,9 +418,9 @@
property: 'roles',
type: 'array',
items: new OA\Items(
required: ['uuid'],
required: ['id'],
properties: [
new OA\Property(property: 'uuid', type: 'string'),
new OA\Property(property: 'id', type: 'string'),

Check warning on line 423 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 423 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 423 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 423 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
],
),
),
Expand All @@ -444,7 +444,7 @@
#[OA\Schema(
schema: 'Admin',
properties: [
new OA\Property(property: 'uuid', type: 'string', example: '1234abcd-abcd-4321-12ab-123456abcdef'),
new OA\Property(property: 'id', type: 'string', example: '1234abcd-abcd-4321-12ab-123456abcdef'),

Check warning on line 447 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 447 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 447 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 447 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
new OA\Property(property: 'identity', type: 'string'),
new OA\Property(property: 'firstName', type: 'string'),
new OA\Property(property: 'lastName', type: 'string'),
Expand All @@ -454,7 +454,7 @@
type: 'array',
items: new OA\Items(
properties: [
new OA\Property(property: 'uuid', type: 'string'),
new OA\Property(property: 'id', type: 'string'),

Check warning on line 457 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 457 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 457 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 457 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
new OA\Property(property: 'name', type: 'string', example: AdminRoleEnum::Admin->value),
],
type: 'object',
Expand Down Expand Up @@ -489,7 +489,7 @@
#[OA\Schema(
schema: 'AdminRole',
properties: [
new OA\Property(property: 'uuid', type: 'string', example: '1234abcd-abcd-4321-12ab-123456abcdef'),
new OA\Property(property: 'id', type: 'string', example: '1234abcd-abcd-4321-12ab-123456abcdef'),

Check warning on line 492 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 492 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 492 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 492 in src/Admin/src/OpenAPI.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
new OA\Property(property: 'name', type: 'string', example: AdminRoleEnum::Admin->value),
new OA\Property(
property: '_links',
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/src/RoutesDelegator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public function __invoke(ContainerInterface $container, string $serviceName, callable $callback): Application
{
$uuid = ConfigProvider::REGEXP_UUID;
$id = ConfigProvider::REGEXP_UUID;

/** @var RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(RouteCollectorInterface::class);
Expand All @@ -37,14 +37,14 @@
->get('', GetAdminCollectionHandler::class, 'admin::list-admin')
->post('', PostAdminResourceHandler::class, 'admin::create-admin');

$routeCollector->group('/admin/' . $uuid)
$routeCollector->group('/admin/' . $id)

Check warning on line 40 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/' . $id' type is not compatible with declaration

Check warning on line 40 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/' . $id' type is not compatible with declaration

Check warning on line 40 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/' . $id' type is not compatible with declaration

Check warning on line 40 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/admin/' . $id' type is not compatible with declaration
->delete('', DeleteAdminResourceHandler::class, 'admin::delete-admin')
->get('', GetAdminResourceHandler::class, 'admin::view-admin')
->patch('', PatchAdminResourceHandler::class, 'admin::update-admin');

$routeCollector->group('/admin/role')
->get('', GetAdminRoleCollectionHandler::class, 'admin::list-role')
->get('/' . $uuid, GetAdminRoleResourceHandler::class, 'admin::view-role');
->get('/' . $id, GetAdminRoleResourceHandler::class, 'admin::view-role');

Check warning on line 47 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/' . $id' type is not compatible with declaration

Check warning on line 47 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/' . $id' type is not compatible with declaration

Check warning on line 47 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/' . $id' type is not compatible with declaration

Check warning on line 47 in src/Admin/src/RoutesDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''/' . $id' type is not compatible with declaration

$routeCollector->group('/admin/account')
->get('', GetAdminAccountResourceHandler::class, 'admin::view-account')
Expand Down
14 changes: 7 additions & 7 deletions src/Admin/src/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
/**
* @throws NotFoundException
*/
public function findAdmin(string $uuid): Admin
public function findAdmin(string $id): Admin
{
$admin = $this->adminRepository->find($uuid);
$admin = $this->adminRepository->find($id);

Check warning on line 52 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$id' type is not compatible with declaration

Check warning on line 52 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$id' type is not compatible with declaration

Check warning on line 52 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$id' type is not compatible with declaration

Check warning on line 52 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$id' type is not compatible with declaration
if (! $admin instanceof Admin) {
throw NotFoundException::create(Message::ADMIN_NOT_FOUND);
}
Expand Down Expand Up @@ -119,12 +119,12 @@
$admin->setStatus($status);
}

$this->validateUniqueAdmin((string) $admin->getIdentity(), $admin->getUuid());
$this->validateUniqueAdmin((string) $admin->getIdentity(), $admin->getId());

if (array_key_exists('roles', $data) && count($data['roles']) > 0) {
$admin->resetRoles();
foreach ($data['roles'] as $roleData) {
$adminRole = $this->adminRoleRepository->find($roleData['uuid']);
$adminRole = $this->adminRoleRepository->find($roleData['id']);
if (! $adminRole instanceof AdminRole) {
throw NotFoundException::create(Message::ROLE_NOT_FOUND);
}
Expand All @@ -144,14 +144,14 @@
/**
* @throws ConflictException
*/
public function validateUniqueAdmin(string $identity, ?UuidInterface $uuid = null): void
public function validateUniqueAdmin(string $identity, ?UuidInterface $id = null): void
{
$admin = $this->adminRepository->findOneBy(['identity' => $identity]);
if ($admin instanceof Admin) {
if ($uuid === null) {
if ($id === null) {
throw ConflictException::create(Message::DUPLICATE_IDENTITY);
}
if ($admin->getUuid()->toString() !== $uuid->toString()) {
if (! $admin->getId()->equals($id)) {
throw ConflictException::create(Message::DUPLICATE_IDENTITY);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/src/Service/AdminServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function deleteAdmin(Admin $admin): void;
/**
* @throws NotFoundException
*/
public function findAdmin(string $uuid): Admin;
public function findAdmin(string $id): Admin;

/**
* @param array<non-empty-string, mixed> $params
Expand Down
4 changes: 2 additions & 2 deletions src/App/src/Attribute/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
public function __construct(
public string $entity,
public string $identifier = 'uuid',
public string $placeholder = 'uuid',
public string $identifier = 'id',
public string $placeholder = 'id',
public ?string $guard = null,
) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/App/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public static function getCollection(string $collectionClass, string $route, str
public static function getResource(
string $resourceClass,
string $route,
string $resourceIdentifier = 'uuid',
string $resourceIdentifierPlaceholder = 'uuid'
string $resourceIdentifier = 'id',
string $resourceIdentifierPlaceholder = 'id'
): array {
return [
'__class__' => RouteBasedResourceMetadata::class,
Expand Down
11 changes: 6 additions & 5 deletions src/Core/src/Admin/src/Entity/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Core\App\Entity\PasswordTrait;
use Core\App\Entity\RoleInterface;
use Core\App\Entity\TimestampsTrait;
use Core\App\Entity\UuidIdentifierTrait;
use Core\Setting\Entity\Setting;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
Expand All @@ -29,6 +30,7 @@
{
use PasswordTrait;
use TimestampsTrait;
use UuidIdentifierTrait;

/** @var non-empty-string|null $identity */
#[ORM\Column(name: 'identity', type: 'string', length: 191, unique: true)]
Expand All @@ -53,8 +55,8 @@
/** @var Collection<int, RoleInterface> $roles */
#[ORM\ManyToMany(targetEntity: AdminRole::class)]
#[ORM\JoinTable(name: 'admin_roles')]
#[ORM\JoinColumn(name: 'userUuid', referencedColumnName: 'uuid')]
#[ORM\InverseJoinColumn(name: 'roleUuid', referencedColumnName: 'uuid')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id')]

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''user_id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''user_id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''user_id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''user_id'' type is not compatible with declaration

Check warning on line 58 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
#[ORM\InverseJoinColumn(name: 'role_id', referencedColumnName: 'id')]

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''role_id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''role_id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''role_id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''role_id'' type is not compatible with declaration

Check warning on line 59 in src/Core/src/Admin/src/Entity/Admin.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''id'' type is not compatible with declaration
protected Collection $roles;

/** @var Collection<int, Setting> $settings */
Expand All @@ -65,7 +67,6 @@
{
parent::__construct();

$this->created();
$this->roles = new ArrayCollection();
$this->settings = new ArrayCollection();
}
Expand Down Expand Up @@ -219,7 +220,7 @@

/**
* @return array{
* uuid: non-empty-string,
* id: non-empty-string,
* identity: non-empty-string|null,
* firstName: string|null,
* lastName: string|null,
Expand All @@ -232,7 +233,7 @@
public function getArrayCopy(): array
{
return [
'uuid' => $this->uuid->toString(),
'id' => $this->id->toString(),
'identity' => $this->identity,
'firstName' => $this->firstName,
'lastName' => $this->lastName,
Expand Down
Loading
Loading