src/Entity/Ecommerce/ClienteConfig.php line 69

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Ecommerce;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  8. use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
  9. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  10. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\NotUppercase;
  11. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  12. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  13. use CrosierSource\CrosierLibRadxBundle\Entity\CRM\Cliente;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. /**
  18.  * Entidade 'ClienteConfig'.
  19.  *
  20.  * @ApiResource(
  21.  *     normalizationContext={"groups"={"clienteConfig", "clienteConfig_generated", "cliente", "entityId"},"enable_max_depth"=true},
  22.  *     denormalizationContext={"groups"={"clienteConfig"},"enable_max_depth"=true},
  23.  *
  24.  *     itemOperations={
  25.  *          "get"={"path"="/ecommerce/clienteConfig/{id}", "security"="is_granted('ROLE_ECOMM_ADMIN')"},
  26.  *          "put"={"path"="/ecommerce/clienteConfig/{id}", "security"="is_granted('ROLE_ECOMM_ADMIN')"},
  27.  *          "delete"={"path"="/ecommerce/clienteConfig/{id}", "security"="is_granted('ROLE_ADMIN')"}
  28.  *     },
  29.  *     collectionOperations={
  30.  *          "get"={"path"="/ecommerce/clienteConfig", "security"="is_granted('ROLE_ECOMM_ADMIN')"},
  31.  *          "post"={"path"="/ecommerce/clienteConfig", "security"="is_granted('ROLE_ECOMM_ADMIN')"}
  32.  *     },
  33.  *
  34.  *     attributes={
  35.  *          "pagination_items_per_page"=10,
  36.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  37.  *     }
  38.  *
  39.  * )
  40.  * @ApiFilter(PropertyFilter::class)
  41.  * 
  42.  * @ApiFilter(BooleanFilter::class, properties={
  43.  *     "ativo": "exact",
  44.  *     "cliente.ativo": "exact",
  45.  * })
  46.  *
  47.  * @ApiFilter(SearchFilter::class, properties={
  48.  *     "cliente": "exact"
  49.  * })
  50.  *
  51.  * @ApiFilter(OrderFilter::class, properties={
  52.  *     "id", 
  53.  *     "updated", 
  54.  *     "cliente.nome", 
  55.  *     "ativo",
  56.  *     "trayDtExpRefreshToken"
  57.  * }, arguments={"orderParameterName"="order"})
  58.  *
  59.  * @EntityHandler(entityHandlerClass="App\EntityHandler\Ecommerce\ClienteConfigEntityHandler")
  60.  *
  61.  * @ORM\Entity(repositoryClass="App\Repository\Ecommerce\ClienteConfigRepository")
  62.  * @ORM\Table(name="ecomm_cliente_config")
  63.  *
  64.  * @author Carlos Eduardo Pauluk
  65.  */
  66. class ClienteConfig implements EntityId
  67. {
  68.     use EntityIdTrait;
  69.     
  70.     /**
  71.      * @ORM\Column(name="uuid", type="string", nullable=false, length=36)
  72.      * @NotUppercase()
  73.      * @Groups("clienteConfig")
  74.      * @Assert\Length(min=36, max=36)
  75.      *
  76.      * @var string|null
  77.      */
  78.     public ?string $UUID null;
  79.     /**
  80.      *
  81.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\CRM\Cliente")
  82.      * @ORM\JoinColumn(name="cliente_id")
  83.      * @Groups("clienteConfig")
  84.      *
  85.      * @var null|Cliente
  86.      */
  87.     public ?Cliente $cliente null;
  88.     
  89.     /**
  90.      * @ORM\Column(name="ativo", type="boolean", nullable=false)
  91.      * @Groups("clienteConfig")
  92.      */
  93.     public ?bool $ativo true;
  94.     
  95.     /**
  96.      *
  97.      * @ORM\Column(name="json_data", type="json")
  98.      * @var null|array
  99.      * @NotUppercase()
  100.      * @Groups("clienteConfig")
  101.      */
  102.     public ?array $jsonData null;
  103.     /**
  104.      * @ORM\Column(name="tray_dt_exp_access_token", type="datetime")
  105.      * @Groups("clienteConfig")
  106.      * @var null|\DateTime
  107.      */
  108.     public ?\DateTime $trayDtExpAccessToken null;
  109.     
  110.     
  111. }