-
Notifications
You must be signed in to change notification settings - Fork 14
Refactor/subscriber attribute routes #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c22bd44
Update: subscriber attribute values routes
tatevikg1 d4d0aeb
Update: remove brackets
tatevikg1 c263e0d
Swagger schemas in request/normalizer
tatevikg1 7455a1a
After review 0
tatevikg1 dd66bac
Fix tests
tatevikg1 0867d4c
Update: coderabbit configs
tatevikg1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,7 @@ reviews: | |
| base_branches: | ||
| - ".*" | ||
| drafts: false | ||
|
|
||
| checks: | ||
| docstring_coverage: | ||
| enabled: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| "@coderabbitai summary" | ||
| @coderabbitai summary | ||
|
|
||
| Thanks for contributing to phpList! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,59 @@ | |
|
|
||
| namespace PhpList\RestBundle\Identity\Request; | ||
|
|
||
| use OpenApi\Attributes as OA; | ||
| use PhpList\Core\Domain\Identity\Model\Administrator; | ||
| use PhpList\Core\Domain\Identity\Model\Dto\CreateAdministratorDto; | ||
| use PhpList\RestBundle\Common\Request\RequestInterface; | ||
| use PhpList\RestBundle\Identity\Validator\Constraint\UniqueEmail; | ||
| use PhpList\RestBundle\Identity\Validator\Constraint\UniqueLoginName; | ||
| use Symfony\Component\Validator\Constraints as Assert; | ||
|
|
||
| #[OA\Schema( | ||
| schema: 'CreateAdministratorRequest', | ||
| required: ['login_name', 'password', 'email', 'super_user'], | ||
| properties: [ | ||
| new OA\Property( | ||
| property: 'login_name', | ||
| type: 'string', | ||
| maxLength: 255, | ||
| minLength: 3, | ||
| example: 'admin' | ||
| ), | ||
| new OA\Property( | ||
| property: 'password', | ||
| type: 'string', | ||
| format: 'password', | ||
| maxLength: 255, | ||
| minLength: 6, | ||
| example: 'StrongP@ssw0rd' | ||
| ), | ||
| new OA\Property( | ||
| property: 'email', | ||
| type: 'string', | ||
| format: 'email', | ||
| example: '[email protected]' | ||
| ), | ||
| new OA\Property( | ||
| property: 'super_user', | ||
| type: 'boolean', | ||
| example: false | ||
| ), | ||
| new OA\Property( | ||
| property: 'privileges', | ||
| description: 'Array of privileges where keys are privilege names and values are booleans', | ||
| properties: [ | ||
| new OA\Property(property: 'subscribers', type: 'boolean', example: true), | ||
| new OA\Property(property: 'campaigns', type: 'boolean', example: false), | ||
| new OA\Property(property: 'statistics', type: 'boolean', example: true), | ||
| new OA\Property(property: 'settings', type: 'boolean', example: false), | ||
| ], | ||
| type: 'object', | ||
| example: ['subscribers' => true, 'campaigns' => false, 'statistics' => true, 'settings' => false] | ||
| ), | ||
| ], | ||
| type: 'object' | ||
| )] | ||
| class CreateAdministratorRequest implements RequestInterface | ||
| { | ||
| #[Assert\NotBlank] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,14 +4,58 @@ | |
|
|
||
| namespace PhpList\RestBundle\Identity\Request; | ||
|
|
||
| use OpenApi\Attributes as OA; | ||
| use PhpList\Core\Domain\Identity\Model\Administrator; | ||
| use PhpList\Core\Domain\Identity\Model\Dto\UpdateAdministratorDto; | ||
| use PhpList\Core\Domain\Identity\Model\PrivilegeFlag; | ||
| use PhpList\RestBundle\Common\Request\RequestInterface; | ||
| use PhpList\RestBundle\Identity\Validator\Constraint\UniqueEmail; | ||
| use PhpList\RestBundle\Identity\Validator\Constraint\UniqueLoginName; | ||
| use Symfony\Component\Validator\Constraints as Assert; | ||
|
|
||
| #[OA\Schema( | ||
| schema: 'UpdateAdministratorRequest', | ||
| properties: [ | ||
| new OA\Property( | ||
| property: 'login_name', | ||
| type: 'string', | ||
| maxLength: 255, | ||
| minLength: 3, | ||
| example: 'admin' | ||
| ), | ||
| new OA\Property( | ||
| property: 'password', | ||
| type: 'string', | ||
| format: 'password', | ||
| maxLength: 255, | ||
| minLength: 6, | ||
| example: 'StrongP@ssw0rd' | ||
| ), | ||
| new OA\Property( | ||
| property: 'email', | ||
| type: 'string', | ||
| format: 'email', | ||
| example: '[email protected]' | ||
| ), | ||
| new OA\Property( | ||
| property: 'super_user', | ||
| type: 'boolean', | ||
| example: false | ||
| ), | ||
| new OA\Property( | ||
| property: 'privileges', | ||
| description: 'Array of privileges where keys are privilege names and values are booleans', | ||
| properties: [ | ||
| new OA\Property(property: 'subscribers', type: 'boolean', example: true), | ||
| new OA\Property(property: 'campaigns', type: 'boolean', example: false), | ||
| new OA\Property(property: 'statistics', type: 'boolean', example: true), | ||
| new OA\Property(property: 'settings', type: 'boolean', example: false), | ||
| ], | ||
| type: 'object', | ||
| example: ['subscribers' => true, 'campaigns' => false, 'statistics' => true, 'settings' => false] | ||
| ), | ||
| ], | ||
| type: 'object' | ||
| )] | ||
TatevikGr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| class UpdateAdministratorRequest implements RequestInterface | ||
| { | ||
| public int $administratorId; | ||
|
|
@@ -28,7 +72,7 @@ class UpdateAdministratorRequest implements RequestInterface | |
| public ?string $email = null; | ||
|
|
||
| #[Assert\Type('bool')] | ||
| public ?bool $superAdmin = null; | ||
| public ?bool $superUser = null; | ||
|
|
||
| /** | ||
| * Array of privileges where keys are privilege names (from PrivilegeFlag enum) and values are booleans. | ||
|
|
@@ -49,7 +93,7 @@ public function getDto(): UpdateAdministratorDto | |
| loginName: $this->loginName, | ||
| password: $this->password, | ||
| email: $this->email, | ||
| superAdmin: $this->superAdmin, | ||
| superAdmin: $this->superUser, | ||
| privileges: $this->privileges | ||
| ); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.