vendor/crosiersource/crosierlib-radx/src/Entity/Estoque/MovimentacaoItem.php line 51

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibRadxBundle\Entity\Estoque;
  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\Doctrine\Annotations\TrackedEntity;
  11. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  12. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Symfony\Component\Serializer\Annotation\Groups;
  15. /**
  16.  * @ApiResource(
  17.  *     normalizationContext={"groups"={"movimentacaoItem","entityId"},"enable_max_depth"=true},
  18.  *     denormalizationContext={"groups"={"movimentacaoItem"},"enable_max_depth"=true},
  19.  *
  20.  *     itemOperations={
  21.  *          "get"={"path"="/est/movimentacaoItem/{id}", "security"="is_granted('ROLE_ESTOQUE')"},
  22.  *          "put"={"path"="/est/movimentacaoItem/{id}", "security"="is_granted('ROLE_ESTOQUE')"},
  23.  *          "delete"={"path"="/est/movimentacaoItem/{id}", "security"="is_granted('ROLE_ADMIN')"}
  24.  *     },
  25.  *     collectionOperations={
  26.  *          "get"={"path"="/est/movimentacaoItem", "security"="is_granted('ROLE_ESTOQUE')"},
  27.  *          "post"={"path"="/est/movimentacaoItem", "security"="is_granted('ROLE_ESTOQUE')"}
  28.  *     },
  29.  *
  30.  *     attributes={
  31.  *          "pagination_items_per_page"=10,
  32.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  33.  *     }
  34.  * )
  35.  * @ApiFilter(PropertyFilter::class)
  36.  *
  37.  * @ApiFilter(SearchFilter::class, properties={"nome": "partial", "documento": "exact", "id": "exact"})
  38.  * @ApiFilter(OrderFilter::class, properties={"id", "documento", "nome", "updated"}, arguments={"orderParameterName"="order"})
  39.  *
  40.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibRadxBundle\EntityHandler\Estoque\MovimentacaoItemEntityHandler")
  41.  *
  42.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibRadxBundle\Repository\Estoque\MovimentacaoItemRepository")
  43.  * @ORM\Table(name="est_movimentacao_item")
  44.  * @TrackedEntity
  45.  *
  46.  * @author Carlos Eduardo Pauluk
  47.  */
  48. class MovimentacaoItem implements EntityId
  49. {
  50.     use EntityIdTrait;
  51.     /**
  52.      *
  53.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Estoque\Movimentacao", inversedBy="itens")
  54.      * @ORM\JoinColumn(name="movimentacao_id")
  55.      *
  56.      * @var null|Movimentacao
  57.      */
  58.     public ?Movimentacao $movimentacao null;
  59.     /**
  60.      *
  61.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Estoque\Produto")
  62.      * @ORM\JoinColumn(name="produto_id", nullable=false)
  63.      *
  64.      * @var null|Produto
  65.      */
  66.     public ?Produto $produto null;
  67.     /**
  68.      *
  69.      * @ORM\Column(name="qtde", type="decimal", precision=15, scale=2)
  70.      * @Groups("movimentacaoItem")
  71.      *
  72.      * @var null|float
  73.      */
  74.     public ?float $qtde null;
  75.     /**
  76.      *
  77.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Estoque\Unidade")
  78.      * @ORM\JoinColumn(name="unidade_id", nullable=false)
  79.      *
  80.      * @var null|Unidade
  81.      */
  82.     public ?Unidade $unidade null;
  83.     /**
  84.      *
  85.      * @ORM\Column(name="json_data", type="json")
  86.      * @var null|array
  87.      * @NotUppercase()
  88.      * @Groups("movimentacaoItem")
  89.      */
  90.     public ?array $jsonData null;
  91. }