|
|
@@ -29,6 +29,7 @@ use App\Validator\Constraints as OpentalentAssert;
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use JetBrains\PhpStorm\Pure;
|
|
|
use Symfony\Component\ObjectMapper\Attribute\Map;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
/**
|
|
|
* Classe resource contient tous les champs pour la gestion d'un événement pour un profile Freemium.
|
|
|
@@ -64,6 +65,7 @@ use Symfony\Component\ObjectMapper\Attribute\Map;
|
|
|
#[ApiFilter(filterClass: OrderFilter::class, properties: ['datetimeStart'], arguments: ['orderParameterName' => 'order'])]
|
|
|
#[Map(source: Event::class)]
|
|
|
#[OpentalentAssert\FieldLesserThan(field: 'datetimeStart', comparedTo: 'datetimeEnd')]
|
|
|
+#[OpentalentAssert\FieldLesserThan(field: 'priceMini', comparedTo: 'priceMaxi')]
|
|
|
class FreemiumEvent implements ApiResourcesInterface
|
|
|
{
|
|
|
#[ApiProperty(identifier: true)]
|
|
|
@@ -81,8 +83,10 @@ class FreemiumEvent implements ApiResourcesInterface
|
|
|
|
|
|
public ?File $image = null;
|
|
|
|
|
|
+ #[Assert\Url(protocols: ['http', 'https'])]
|
|
|
public ?string $url = null;
|
|
|
|
|
|
+ #[Assert\Url(protocols: ['http', 'https'])]
|
|
|
public ?string $urlTicket = null;
|
|
|
|
|
|
public ?Place $place = null;
|
|
|
@@ -119,8 +123,9 @@ class FreemiumEvent implements ApiResourcesInterface
|
|
|
|
|
|
public ?PricingEventEnum $pricing = null;
|
|
|
|
|
|
+ #[Assert\Positive()]
|
|
|
public ?float $priceMini = null;
|
|
|
-
|
|
|
+ #[Assert\Positive()]
|
|
|
public ?float $priceMaxi = null;
|
|
|
|
|
|
#[Pure]
|