vendor/crosiersource/crosierlib-radx/src/Entity/Estoque/DepreciacaoPreco.php line 45

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\Serializer\Filter\PropertyFilter;
  7. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  8. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  9. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. /**
  13.  * @ApiResource(
  14.  *     normalizationContext={"groups"={"depreciacaoPreco","entityId"},"enable_max_depth"=true},
  15.  *     denormalizationContext={"groups"={"depreciacaoPreco"},"enable_max_depth"=true},
  16.  *
  17.  *     itemOperations={
  18.  *          "get"={"path"="/est/depreciacaoPreco/{id}", "security"="is_granted('ROLE_ESTOQUE')"},
  19.  *          "put"={"path"="/est/depreciacaoPreco/{id}", "security"="is_granted('ROLE_ESTOQUE')"},
  20.  *          "delete"={"path"="/est/depreciacaoPreco/{id}", "security"="is_granted('ROLE_ADMIN')"}
  21.  *     },
  22.  *     collectionOperations={
  23.  *          "get"={"path"="/est/depreciacaoPreco", "security"="is_granted('ROLE_ESTOQUE')"},
  24.  *          "post"={"path"="/est/depreciacaoPreco", "security"="is_granted('ROLE_ESTOQUE')"}
  25.  *     },
  26.  *
  27.  *     attributes={
  28.  *          "pagination_items_per_page"=10,
  29.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  30.  *     }
  31.  * )
  32.  * @ApiFilter(PropertyFilter::class)
  33.  *
  34.  * @ApiFilter(OrderFilter::class, properties={"id", "updated"}, arguments={"orderParameterName"="order"})
  35.  *
  36.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibRadxBundle\EntityHandler\Estoque\DepreciacaoPrecoEntityHandler")
  37.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibRadxBundle\Repository\Estoque\DepreciacaoPrecoRepository")
  38.  * @ORM\Table(name="est_depreciacao_preco")
  39.  *
  40.  * @author Carlos Eduardo Pauluk
  41.  */
  42. class DepreciacaoPreco implements EntityId
  43. {
  44.     use EntityIdTrait;
  45.     /**
  46.      * @ORM\Column(name="porcentagem", type="decimal", nullable=false)
  47.      * @Groups("depreciacaoPreco")
  48.      */
  49.     private ?float $porcentagem;
  50.     /**
  51.      * @ORM\Column(name="prazo_fim", type="integer", nullable=false)
  52.      * @Groups("depreciacaoPreco")
  53.      */
  54.     private ?int $prazoFim;
  55.     /**
  56.      * @ORM\Column(name="prazo_ini", type="integer", nullable=false)
  57.      * @Groups("depreciacaoPreco")
  58.      */
  59.     private ?int $prazoIni;
  60. }