Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

37 lines
1.4KB

  1. <?php
  2. namespace domain\PointSale\SharedPointSale;
  3. use domain\_\AbstractManager;
  4. use domain\PointSale\PointSale\PointSale;
  5. use domain\Producer\Producer\Producer;
  6. use domain\User\User\User;
  7. class SharedPointSaleManager extends AbstractManager
  8. {
  9. protected SharedPointSaleBuilder $sharedPointSaleBuilder;
  10. public function loadDependencies(): void
  11. {
  12. $this->sharedPointSaleBuilder = $this->loadService(SharedPointSaleBuilder::class);
  13. }
  14. public function createSharedPointSale(PointSale $pointSale, Producer $producerWithSharing, User $createdBy): SharedPointSale
  15. {
  16. $sharedPointSale = $this->sharedPointSaleBuilder->instanciateSharedPointSale($pointSale, $producerWithSharing, $createdBy);
  17. $this->sharedPointSaleBuilder->create($sharedPointSale);
  18. return $sharedPointSale;
  19. }
  20. public function confirmSharedPointSale(SharedPointSale $sharedPointSale, PointSale $pointSaleWithSharing, User $confirmedBy): bool
  21. {
  22. $this->sharedPointSaleBuilder->initConfirmSharedPointSale($sharedPointSale, $pointSaleWithSharing, $confirmedBy);
  23. return $this->sharedPointSaleBuilder->update($sharedPointSale);
  24. }
  25. public function declineSharedPointSale(SharedPointSale $sharedPointSale, User $declinedBy): bool
  26. {
  27. $this->sharedPointSaleBuilder->initDeclineSharedPointSale($sharedPointSale, $declinedBy);
  28. return $this->sharedPointSaleBuilder->update($sharedPointSale);
  29. }
  30. }