Skip to content

Commit

Permalink
Merge pull request #1594 from ConductionNL/feature/unique-reference
Browse files Browse the repository at this point in the history
Reference should always be unique
  • Loading branch information
WilcoLouwerse authored Dec 14, 2023
2 parents 9c51b7b + 46a9a87 commit 7ea7fbc
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 1 deletion.
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

0 comments on commit 7ea7fbc

Please sign in to comment.