src/Entity/Calculations.php line 40

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\CalculationsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use ApiPlatform\Metadata\Get;
  11. use ApiPlatform\Metadata\GetCollection;
  12. use ApiPlatform\Metadata\Delete;
  13. use ApiPlatform\Metadata\Put;
  14. use ApiPlatform\Metadata\Post;
  15. use App\Controller\CalculationsController;
  16. #[ORM\Entity(repositoryClassCalculationsRepository::class)]
  17. #[ApiResource(
  18.     operations: [
  19.         new Get(),
  20.         new Post(),
  21.         new Delete(),
  22.         new GetCollection(),
  23.         new Put(),
  24.         new Post(
  25.             name'clear_calculations',
  26.             uriTemplate'/calculations/clear'
  27.             controllerCalculationsController::class
  28.         )
  29.     ],
  30.     normalizationContext: ['groups' => ['calculations:read']],
  31.     denormalizationContext: ['groups' => ['calculations:write''agreements:read''agreements:write']],
  32.     order: ['date' => 'ASC']
  33. )]
  34. #[ApiFilter(SearchFilter::class, properties: ['agreement.id' => 'exact'])]
  35. class Calculations
  36. {
  37.     #[ORM\Id]
  38.     #[ORM\GeneratedValue
  39.     #[ORM\Column]
  40.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  41.     private ?int $id null;
  42.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $name null;
  45.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  46.     #[ORM\Column(nullabletrue)]
  47.     private ?float $initialBalance null;
  48.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?float $coming null;
  51.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  52.     #[ORM\Column(nullabletrue)]
  53.     private ?float $discharge null;
  54.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  55.     #[ORM\Column(nullabletrue)]
  56.     private ?float $finalBalance null;
  57.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $movementDocument null;
  60.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  61.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  62.     private ?\DateTimeInterface $date null;
  63.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  64.     #[ORM\ManyToOne(inversedBy'calculations')]
  65.     private ?Agreements $agreement null;
  66.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  67.     #[ORM\Column(length100nullabletrue)]
  68.     private ?string $agreementType null;
  69.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  70.     #[ORM\Column(length100nullabletrue)]
  71.     private ?string $typeMutualSettlements null;
  72.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  73.     #[ORM\Column(length100nullabletrue)]
  74.     private ?string $oragnazationName null;
  75.     #[Groups(['calculations:read''calculations:write''agreements:read''agreements:write'])]
  76.     #[ORM\ManyToOne(inversedBy'calculations')]
  77.     private ?Orders $orders null;
  78.     public function getId(): ?int
  79.     {
  80.         return $this->id;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     public function setName(?string $name): self
  87.     {
  88.         $this->name $name;
  89.         return $this;
  90.     }
  91.     public function getInitialBalance(): ?float
  92.     {
  93.         return $this->initialBalance;
  94.     }
  95.     public function setInitialBalance(?float $initialBalance): self
  96.     {
  97.         $this->initialBalance $initialBalance;
  98.         return $this;
  99.     }
  100.     public function getComing(): ?float
  101.     {
  102.         return $this->coming;
  103.     }
  104.     public function setComing(?float $coming): self
  105.     {
  106.         $this->coming $coming;
  107.         return $this;
  108.     }
  109.     public function getDischarge(): ?float
  110.     {
  111.         return $this->discharge;
  112.     }
  113.     public function setDischarge(?float $discharge): self
  114.     {
  115.         $this->discharge $discharge;
  116.         return $this;
  117.     }
  118.     public function getFinalBalance(): ?float
  119.     {
  120.         return $this->finalBalance;
  121.     }
  122.     public function setFinalBalance(?float $finalBalance): self
  123.     {
  124.         $this->finalBalance $finalBalance;
  125.         return $this;
  126.     }
  127.     public function getMovementDocument(): ?string
  128.     {
  129.         return $this->movementDocument;
  130.     }
  131.     public function setMovementDocument(?string $movementDocument): self
  132.     {
  133.         $this->movementDocument $movementDocument;
  134.         return $this;
  135.     }
  136.     public function getDate(): ?\DateTimeInterface
  137.     {
  138.         return $this->date;
  139.     }
  140.     public function setDate(?\DateTimeInterface $date): self
  141.     {
  142.         $this->date $date;
  143.         return $this;
  144.     }
  145.     public function getAgreement(): ?Agreements
  146.     {
  147.         return $this->agreement;
  148.     }
  149.     public function setAgreement(?Agreements $agreement): self
  150.     {
  151.         $this->agreement $agreement;
  152.         return $this;
  153.     }
  154.     public function getAgreementType(): ?string
  155.     {
  156.         return $this->agreementType;
  157.     }
  158.     public function setAgreementType(?string $agreementType): self
  159.     {
  160.         $this->agreementType $agreementType;
  161.         return $this;
  162.     }
  163.     public function getTypeMutualSettlements(): ?string
  164.     {
  165.         return $this->typeMutualSettlements;
  166.     }
  167.     public function setTypeMutualSettlements(?string $typeMutualSettlements): self
  168.     {
  169.         $this->typeMutualSettlements $typeMutualSettlements;
  170.         return $this;
  171.     }
  172.     public function getOragnazationName(): ?string
  173.     {
  174.         return $this->oragnazationName;
  175.     }
  176.     public function setOragnazationName(?string $oragnazationName): self
  177.     {
  178.         $this->oragnazationName $oragnazationName;
  179.         return $this;
  180.     }
  181.     public function getOrders(): ?Orders
  182.     {
  183.         return $this->orders;
  184.     }
  185.     public function setOrders(?Orders $orders): self
  186.     {
  187.         $this->orders $orders;
  188.         return $this;
  189.     }
  190. }