Skip to content

Commit

Permalink
Merge pull request #11 from ConductionNL/analysis-aj6N3k
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rubenvdlinde authored Jan 14, 2020
2 parents cda6e3f + 716dc54 commit cf1514c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 65 deletions.
77 changes: 39 additions & 38 deletions api/src/Entity/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;


use App\Entity\Service;

/**
* A message to be send to a spefic recipient or list troug a message service
*
* A message to be send to a spefic recipient or list troug a message service.
*
* @ApiResource(
* normalizationContext={"groups"={"read"}, "enable_max_depth"=true},
* denormalizationContext={"groups"={"write"}, "enable_max_depth"=true}
Expand All @@ -23,24 +20,25 @@
*/
class Message
{
/**
* @var UuidInterface The UUID identifier of this resource
*
* @example e2984465-190a-4562-829e-a8cca81aa35d
*
* @Assert\Uuid
* @Groups({"read"})
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;
/**
* @var UuidInterface The UUID identifier of this resource
*
* @example e2984465-190a-4562-829e-a8cca81aa35d
*
* @Assert\Uuid
* @Groups({"read"})
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;

/**
* @var string Iether a contact component person or contact list that will recieve this message
* @example https://cc.zaakonline.nl/people/06cd0132-5b39-44cb-b320-a9531b2c4ac7
*
*
* @example https://cc.zaakonline.nl/people/06cd0132-5b39-44cb-b320-a9531b2c4ac7
*
* @Assert\Url
* @Assert\Length(
* max = 255
Expand All @@ -52,8 +50,9 @@ class Message

/**
* @var string Iether a contact component person, or wrc application that sends this message
* @example https://cc.zaakonline.nl/people/06cd0132-5b39-44cb-b320-a9531b2c4ac7
*
*
* @example https://cc.zaakonline.nl/people/06cd0132-5b39-44cb-b320-a9531b2c4ac7
*
* @Assert\Url
* @Assert\Length(
* max = 255
Expand All @@ -65,8 +64,9 @@ class Message

/**
* @var string The webresource template object (from wrc) that is used as content for this message
* @example https://wrc.zaakonline.nl/templates/013276cc-1483-46b4-ad5b-1cba5acf6d9f
*
*
* @example https://wrc.zaakonline.nl/templates/013276cc-1483-46b4-ad5b-1cba5acf6d9f
*
* @Assert\Url
* @Assert\Length(
* max = 255
Expand All @@ -78,21 +78,22 @@ class Message

/**
* @var string The current status of this message
* @example concept
*
*
* @example concept
*
* @Assert\Choice({"concept", "queued", "sending", "send", "delivered"})
* @Assert\Length(
* max = 255
* )
*
* @Assert\Length(
* max = 255
* )
*
* @Groups({"read", "write"})
* @ORM\Column(type="string", length=255)
*/
private $status;

/**
* @var \Service The webresource template object (from wrc) that is used as content for this message
*
*
* @Groups({"read", "write"})
* @MaxDepth(1)
* @ORM\ManyToOne(targetEntity="App\Entity\Service", inversedBy="messages")
Expand All @@ -102,23 +103,23 @@ class Message

/**
* @var string The data that is used to render the template
*
*
* @Groups({"read", "write"})
* @Assert\Json
* @ORM\Column(type="json", nullable=true)
*/
private $data = [];

public function getId(): ?string
{
return $this->id;
return $this->id;
}

public function setId(string $id): self
{
$this->id = $id;
return $this;
$this->id = $id;

return $this;
}

public function getReciever(): ?string
Expand Down
57 changes: 30 additions & 27 deletions api/src/Entity/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use Symfony\Component\Validator\Constraints as Assert;

/**
* A service that sends messages e.g. email or sms
*
* A service that sends messages e.g. email or sms.
*
* @ApiResource(
* normalizationContext={"groups"={"read"}, "enable_max_depth"=true},
* denormalizationContext={"groups"={"write"}, "enable_max_depth"=true}
Expand All @@ -22,19 +22,19 @@
*/
class Service
{
/**
* @var UuidInterface The UUID identifier of this resource
*
* @example e2984465-190a-4562-829e-a8cca81aa35d
*
* @Assert\Uuid
* @Groups({"read"})
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;
/**
* @var UuidInterface The UUID identifier of this resource
*
* @example e2984465-190a-4562-829e-a8cca81aa35d
*
* @Assert\Uuid
* @Groups({"read"})
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;

/**
* @MaxDepth(1)
Expand All @@ -44,19 +44,21 @@ class Service

/**
* @var string The type of this service, iether use a pre configures service or just plain simple old smtp
*
* @example smtp
*
*
* @Assert\Choice({"mailgun", "messagebird", "smtp"})
* @Assert\Length(
* max = 255
* )
* @Assert\Length(
* max = 255
* )
* @Groups({"read", "write"})
* @ORM\Column(type="string", length=255)
*/
private $type;

/**
* @var string The RSIN of the organization that ownes this service
*
* @example 002851234
*
* @Assert\NotNull
Expand All @@ -70,8 +72,9 @@ class Service

/**
* @var string The autorization be it password or api key that is used to connect to the service
*
* @example 013276cc-1483-46b4-ad5b-1cba5acf6d9f
*
*
* @Assert\NotNull
* @Assert\Length(
* max = 255
Expand All @@ -83,7 +86,7 @@ class Service

/**
* @var string Any specific setting for this service
*
*
* @Assert\Json
* @Groups({"read", "write"})
* @ORM\Column(type="json", nullable=true)
Expand All @@ -94,17 +97,17 @@ public function __construct()
{
$this->messages = new ArrayCollection();
}

public function getId(): ?string
{
return $this->id;
return $this->id;
}

public function setId(string $id): self
{
$this->id = $id;
return $this;
$this->id = $id;

return $this;
}

/**
Expand Down

0 comments on commit cf1514c

Please sign in to comment.