Skip to content
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

Reference should always be unique #1594

Merged
merged 1 commit into from
Dec 14, 2023
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
3 changes: 3 additions & 0 deletions api/src/Entity/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -48,6 +49,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Action
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -50,6 +51,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Application
{
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/CollectionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* })
*
* @UniqueEntity("name")
* @UniqueEntity("reference")
*/
class CollectionEntity
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Cronjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -43,6 +44,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Cronjob
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -57,6 +58,8 @@
* "entities",
* "proxy"
* })
*
* @UniqueEntity("reference")
*/
class Endpoint
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use phpDocumentor\Reflection\Types\This;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -63,6 +64,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Entity
{
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
* })
*
* @UniqueEntity("name")
* @UniqueEntity("reference")
*/
class Gateway
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -44,6 +45,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Mapping
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -49,6 +50,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Organization
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/SecurityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -50,6 +51,8 @@
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class SecurityGroup
{
Expand Down
6 changes: 5 additions & 1 deletion api/src/Entity/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -41,8 +42,11 @@
* @ApiFilter(DateFilter::class, strategy=DateFilter::EXCLUDE_NULL)
* @ApiFilter(SearchFilter::class, properties={
* "supportedSchemas": "exact",
* "name": "exact"
* "name": "exact",
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*/
class Template
{
Expand Down
3 changes: 3 additions & 0 deletions api/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Gedmo\Mapping\Annotation as Gedmo;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
Expand Down Expand Up @@ -50,6 +51,8 @@
* "reference": "exact"
* })
*
* @UniqueEntity("reference")
*
* @ORM\Table(name="`user`")
*/
class User implements PasswordAuthenticatedUserInterface
Expand Down
Loading