vendor/crosiersource/crosierlib-radx/src/Entity/Vendas/VendaPagto.php line 49

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibRadxBundle\Entity\Vendas;
  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\Serializer\Filter\PropertyFilter;
  8. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  9. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\NotUppercase;
  10. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  11. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Serializer\Annotation\Groups;
  14. /**
  15.  * @ApiResource(
  16.  *     normalizationContext={"groups"={"vendaPagto","entityId"},"enable_max_depth"=true},
  17.  *     denormalizationContext={"groups"={"vendaPagto"},"enable_max_depth"=true},
  18.  *
  19.  *     itemOperations={
  20.  *          "get"={"path"="/ven/vendaPagto/{id}", "security"="is_granted('ROLE_VENDAS')"},
  21.  *          "put"={"path"="/ven/vendaPagto/{id}", "security"="is_granted('ROLE_VENDAS')"},
  22.  *          "delete"={"path"="/ven/vendaPagto/{id}", "security"="is_granted('ROLE_ADMIN')"}
  23.  *     },
  24.  *     collectionOperations={
  25.  *          "get"={"path"="/ven/vendaPagto", "security"="is_granted('ROLE_VENDAS')"},
  26.  *          "post"={"path"="/ven/vendaPagto", "security"="is_granted('ROLE_VENDAS')"}
  27.  *     },
  28.  *
  29.  *     attributes={
  30.  *          "pagination_items_per_page"=10,
  31.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  32.  *     }
  33.  * )
  34.  * @ApiFilter(PropertyFilter::class)
  35.  *
  36.  * @ApiFilter(SearchFilter::class, properties={"nome": "partial", "documento": "exact", "id": "exact"})
  37.  * @ApiFilter(OrderFilter::class, properties={"id", "documento", "nome", "updated"}, arguments={"orderParameterName"="order"})
  38.  *
  39.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibRadxBundle\EntityHandler\Vendas\VendaPagtoEntityHandler")
  40.  *
  41.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibRadxBundle\Repository\Vendas\VendaPagtoRepository")
  42.  * @ORM\Table(name="ven_venda_pagto")
  43.  *
  44.  * @author Carlos Eduardo Pauluk
  45.  */
  46. class VendaPagto implements EntityId
  47. {
  48.     use EntityIdTrait;
  49.     /**
  50.      *
  51.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Vendas\Venda", inversedBy="itens")
  52.      * @ORM\JoinColumn(name="venda_id", nullable=false)     *
  53.      *
  54.      * @var null|Venda
  55.      */
  56.     public ?Venda $venda null;
  57.     /**
  58.      *
  59.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Vendas\PlanoPagto")
  60.      * @ORM\JoinColumn(name="plano_pagto_id")
  61.      * @Groups("vendaPagto")
  62.      *
  63.      * @var null|PlanoPagto
  64.      */
  65.     public ?PlanoPagto $planoPagto null;
  66.     /**
  67.      *
  68.      * @ORM\Column(name="valor_pagto", type="decimal")
  69.      * @Groups("vendaPagto")
  70.      *
  71.      * @var null|float
  72.      */
  73.     public ?float $valorPagto null;
  74.     /**
  75.      *
  76.      * @ORM\Column(name="json_data", type="json")
  77.      * @var null|array
  78.      * @NotUppercase()
  79.      * @Groups("vendaPagto")
  80.      */
  81.     public ?array $jsonData null;
  82. }