src/Listener/NonMember/ContractListener.php line 460

Open in your IDE?
  1. <?php
  2. namespace App\Listener\NonMember;
  3. use App\Controller\Ajax\TutorialController;
  4. use App\Controller\MySief\ContractController;
  5. use App\Controller\MySief\SanctionsController;
  6. use App\Controller\MySief\TransferController;
  7. use App\Entity\LeadRegistrant\Agreement;
  8. use App\Entity\LegalEntity;
  9. use App\Entity\LegalEntity\Contract\AbstractContract;
  10. use App\Entity\LegalEntity\Contract\Amendment;
  11. use App\Entity\LegalEntity\Contract\Contract;
  12. use App\Entity\LegalEntity\Contract\LicenseAgreement;
  13. use App\Entity\Notification;
  14. use App\Entity\Notification\NonMember\ContractsAddedNotification;
  15. use App\Entity\Notification\NonMember\ContractsPendingNotification;
  16. use App\Entity\StaffRequest;
  17. use App\Entity\Substance\Definition;
  18. use App\Entity\User;
  19. use App\Entity\Worker;
  20. use App\FormType\TonnageBandType;
  21. use App\Service\DossierCalculator;
  22. use App\Service\StaffTransferCreator;
  23. use App\Workers\AgreementGeneratorWorker;
  24. use App\Workers\AgreementGeneratorWorkerConfig;
  25. use App\Workers\FinishTransferWorker;
  26. use App\Workers\FinishTransferWorkerConfig;
  27. use App\Workers\LicenseAgreementAmendmentWorker;
  28. use App\Workers\LicenseAgreementAmendmentWorkerConfig;
  29. use App\Workers\NonPetroleumWorker;
  30. use App\Workers\NonPetroleumWorkerConfig;
  31. use App\Workers\ScheduleFourWorker;
  32. use App\Workers\ScheduleFourWorkerConfig;
  33. use App\Workers\ScheduleThreeWorker;
  34. use App\Workers\ScheduleThreeWorkerConfig;
  35. use App\Workers\SendAcceptedContractWorker;
  36. use App\Workers\SendAcceptedContractWorkerConfig;
  37. use App\Workers\StatusWorker;
  38. use App\Workers\StatusWorkerConfig;
  39. use App\Workers\TokenRenewalCheckWorker;
  40. use App\Workers\TokenRenewalCheckWorkerConfig;
  41. use App\Workers\TonnageBandWorker;
  42. use App\Workers\TonnageBandWorkerConfig;
  43. use App\Workers\WorkerAlreadyQueuedException;
  44. use Carbon\Carbon;
  45. use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface;
  46. use Doctrine\ORM\EntityManagerInterface;
  47. use Doctrine\ORM\Event\LifecycleEventArgs;
  48. use Doctrine\ORM\Event\OnFlushEventArgs;
  49. use Doctrine\ORM\Events;
  50. use Symfony\Component\DependencyInjection\ContainerInterface;
  51. use Symfony\Component\HttpFoundation\RedirectResponse;
  52. use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
  53. use Symfony\Component\HttpKernel\Controller\ErrorController;
  54. use Symfony\Component\HttpKernel\Event\ControllerEvent;
  55. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  56. use Symfony\Component\Routing\RouterInterface;
  57. use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
  58. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  59. use Symfony\Component\Validator\Validator\ValidatorInterface;
  60. class ContractListener implements EventSubscriberInterfaceWarmableInterface
  61. {
  62.     /**
  63.      * @var TokenStorageInterface
  64.      */
  65.     private $storage;
  66.     /**
  67.      * @var EntityManagerInterface
  68.      */
  69.     private $em;
  70.     /**
  71.      * @var RouterInterface
  72.      */
  73.     private $router;
  74.     /**
  75.      * @var ContractController
  76.      */
  77.     private $controller;
  78.     /**
  79.      * @var ValidatorInterface
  80.      */
  81.     private $validator;
  82.     /**
  83.      * @var DossierCalculator
  84.      */
  85.     private $dossierCalculator;
  86.     private StaffTransferCreator $staffTransferCreator;
  87.     /**
  88.      * @var bool
  89.      */
  90.     private static $enabled true;
  91.     public function __construct(TokenStorageInterface $storageEntityManagerInterface $emRouterInterface $routerContractController $controllerContainerInterface $containerValidatorInterface $validatorDossierCalculator $dossierCalculatorStaffTransferCreator $staffTransferCreator)
  92.     {
  93.         $this->storage $storage;
  94.         $this->em $em;
  95.         $this->router $router;
  96.         $this->controller $controller;
  97.         $this->controller->setContainer($container);
  98.         $this->validator $validator;
  99.         $this->dossierCalculator $dossierCalculator;
  100.         $this->staffTransferCreator $staffTransferCreator;
  101.     }
  102.     private function computeChanges($entity)
  103.     {
  104.         $uow $this->em->getUnitOfWork();
  105.         $class $this->em->getClassMetadata(get_class($entity));
  106.         $uow->computeChangeSet($class$entity);
  107.     }
  108.     public function getSubscribedEvents()
  109.     {
  110.         return [Events::postPersistEvents::postUpdateEvents::postRemoveEvents::onFlush];
  111.     }
  112.     public function postPersist(LifecycleEventArgs $args)
  113.     {
  114.         if (!$args->getEntity() instanceof AbstractContract) {
  115.             return;
  116.         }
  117.         $this->processContract($args->getEntityManager(), $args->getEntity());
  118.     }
  119.     public function postUpdate(LifecycleEventArgs $args)
  120.     {
  121.         if (!$args->getEntity() instanceof AbstractContract) {
  122.             return;
  123.         }
  124.         $this->processContract($args->getEntityManager(), $args->getEntity());
  125.     }
  126.     public function postRemove(LifecycleEventArgs $args)
  127.     {
  128.         if (!$args->getEntity() instanceof AbstractContract) {
  129.             return;
  130.         }
  131.         $this->processContract($args->getEntityManager(), $args->getEntity(), true);
  132.     }
  133.     public function onFlush(OnFlushEventArgs $args)
  134.     {
  135.         if (!self::$enabled) {
  136.             return;
  137.         }
  138.         $em $args->getEntityManager();
  139.         $uow $em->getUnitOfWork();
  140.         $md $em->getClassMetadata(Worker::class);
  141.         foreach ($uow->getScheduledEntityUpdates() as $contract) {
  142.             if (!$contract instanceof AbstractContract) {
  143.                 continue;
  144.             }
  145.             $changes $uow->getEntityChangeSet($contract);
  146.             if (!array_key_exists('accepted'$changes)) {
  147.                 continue;
  148.             }
  149.             if ($contract instanceof LicenseAgreement) {
  150.                 $reason $changes['accepted'][1]
  151.                     ? 'License agreement marked as accepted'
  152.                     'License agreement marked as not accepted';
  153.                 foreach ($contract->getLegalEntity()->getOrderLines() as $line) {
  154.                     /** @var User $user */
  155.                     $user $this->storage->getToken()->getUser();
  156.                     // Status worker (calculate status for all order lines)
  157.                     $worker = (new Worker(StatusWorker::class, (new StatusWorkerConfig())
  158.                         ->setOrderLineId($line->getId())
  159.                         ->setReason($reason)
  160.                         ->setUserId($user->getId())
  161.                     ))->setDelay(20);
  162.                     $em->persist($worker);
  163.                     $uow->computeChangeSet($md$worker);
  164.                     // Token renewal check worker
  165.                     try {
  166.                         $worker $this->em->getRepository(Worker::class)->createWorker(TokenRenewalCheckWorker::class, (new TokenRenewalCheckWorkerConfig())
  167.                             ->setEcId($line->getSubstance()->getEc()->getId()))
  168.                         ->setDelay(2);
  169.                         $em->persist($worker);
  170.                         $uow->computeChangeSet($md$worker);
  171.                     } catch (WorkerAlreadyQueuedException $e) {
  172.                     }
  173.                 }
  174.                 // Regenerate license agreement
  175.                 try {
  176.                     $worker $this->em->getRepository(Worker::class)->createWorker(AgreementGeneratorWorker::class, (new AgreementGeneratorWorkerConfig())
  177.                         ->setType(AgreementGeneratorWorkerConfig::TYPE_NON_MEMBER)
  178.                         ->setImport(false)
  179.                         ->setReset(false)
  180.                         ->setNotify(false)
  181.                         ->setEntityId($contract->getLegalEntity()->getId())
  182.                     )->setDelay(10);
  183.                     $em->persist($worker);
  184.                     $uow->computeChangeSet($md$worker);
  185.                 } catch (WorkerAlreadyQueuedException $e) {
  186.                 }
  187.             }
  188.             // Regenerate schedule 4 amendment
  189.             if ($contract instanceof Amendment && Amendment::TYPE_SCHEDULE_4 === $contract->getType()) {
  190.                 try {
  191.                     $worker $this->em->getRepository(Worker::class)->createWorker(ScheduleFourWorker::class, (new ScheduleFourWorkerConfig())
  192.                         ->setId($contract->getId()))
  193.                     ->setDelay(2);
  194.                     $em->persist($worker);
  195.                     $uow->computeChangeSet($md$worker);
  196.                 } catch (WorkerAlreadyQueuedException $e) {
  197.                 }
  198.             }
  199.             // Regenerate non-petroleum data sharing agreement
  200.             if ($contract instanceof LegalEntity\Contract\NonPetroleumAgreement) {
  201.                 try {
  202.                     $config = (new NonPetroleumWorkerConfig())
  203.                         ->setId($contract->getId());
  204.                     if ($contract->isAccepted() && $contract->getAcceptedAt()->format('d-m-Y') === carbon::today()->format('d-m-Y')) {
  205.                         $config->setAccepted(true);
  206.                     }
  207.                     $worker $this->em->getRepository(Worker::class)->createWorker(NonPetroleumWorker::class, $config)
  208.                         ->setDelay(2);
  209.                     $em->persist($worker);
  210.                     $uow->computeChangeSet($md$worker);
  211.                 } catch (WorkerAlreadyQueuedException $e) {
  212.                 }
  213.             }
  214.             // Regenerate License agreement amendment
  215.             if ($contract instanceof Amendment && Amendment::TYPE_LICENSE_AGREEMENT === $contract->getType()) {
  216.                 try {
  217.                     $worker $em->getRepository(Worker::class)->createWorker(LicenseAgreementAmendmentWorker::class, (new LicenseAgreementAmendmentWorkerConfig())
  218.                         ->setId($contract->getId()))
  219.                     ->setDelay(2);
  220.                     $em->persist($worker);
  221.                     $uow->computeChangeSet($md$worker);
  222.                 } catch (WorkerAlreadyQueuedException $e) {
  223.                 }
  224.             }
  225.             // Regenerate schedule 3 amendment
  226.             if ($contract instanceof Amendment && Amendment::TYPE_SCHEDULE_3 === $contract->getType()) {
  227.                 /** @var LegalEntity\Contract\Schedule3Amendment $contract */
  228.                 $linkedContract $contract->getAmendment();
  229.                 if ($linkedContract->isAccepted()) {
  230.                     $request $this->em->getRepository(StaffRequest::class)->find($contract->getTransferRequest());
  231.                     $substances = [];
  232.                     $oldSubstances = [];
  233.                     if ($request instanceof StaffRequest\TransferRequest) {
  234.                         foreach ($request->getSubstances() as $substance) {
  235.                             $substances[] = $em->getRepository(Definition::class)->find($substance);
  236.                         }
  237.                         foreach ($request->getLegalEntity()->getSubstances() as $substance) {
  238.                             $oldSubstances[] = $em->getRepository(Definition::class)->find($substance);
  239.                         }
  240.                         if ($substances === $oldSubstances) {
  241.                             if (!$request->getLegalEntity()->getRemarks()->isEmpty()) {
  242.                                 foreach ($request->getLegalEntity()->getRemarks() as $remark) {
  243.                                     $request->getNewLegalEntity()->getRemarks()->add($remark);
  244.                                 }
  245.                             }
  246.                         }
  247.                         if ($request->getMember()) {
  248.                             $md $this->em->getClassMetadata(Worker::class);
  249.                             // Queue the transfer worker
  250.                             try {
  251.                                 $worker $this->em->getRepository(Worker::class)->createWorker(
  252.                                     FinishTransferWorker::class,
  253.                                     (new FinishTransferWorkerConfig())
  254.                                         ->setTransferRequest($request->getId())
  255.                                 )->setDelay(2);
  256.                                 $this->em->persist($worker);
  257.                                 $uow->computeChangeSet($md$worker);
  258.                             } catch (WorkerAlreadyQueuedException $e) {
  259.                             }
  260.                         } else {
  261.                             /**
  262.                              * @var StaffRequest\TransferRequest $request
  263.                              */
  264.                             $steps $request->getProgress()->getSteps();
  265.                             $steps[] = 'awaiting-invoice-creation';
  266.                             $request->getProgress()
  267.                                 ->setStatus('primary')
  268.                                 ->setPercentage(66)
  269.                                 ->setStatusText('Awaiting invoice creation, ')
  270.                                 ->setWaiting('staff interaction required')
  271.                                 ->setSteps($steps);
  272.                             if (!$request->getNewLegalEntity()->getLicenseAgreement()->isAccepted()) {
  273.                                 // Queue the license agreement generator
  274.                                 try {
  275.                                     $worker $em->getRepository(Worker::class)->createWorker(
  276.                                         AgreementGeneratorWorker::class,
  277.                                         (new AgreementGeneratorWorkerConfig())
  278.                                             ->setType(AgreementGeneratorWorkerConfig::TYPE_NON_MEMBER)
  279.                                             ->setReset(false)
  280.                                             ->setEntityId($request->getNewLegalEntity()->getId())
  281.                                     )->setDelay(2);
  282.                                     $em->persist($worker);
  283.                                     $uow->computeChangeSet($md$worker);
  284.                                 } catch (WorkerAlreadyQueuedException $e) {
  285.                                 }
  286.                             }
  287.                             $this->em->persist($request->getNewLegalEntity());
  288.                         }
  289.                     }
  290.                 }
  291.                 try {
  292.                     $config = (new ScheduleThreeWorkerConfig())
  293.                         ->setId($contract->getId());
  294.                     if ($contract->isAccepted()) {
  295.                         $config->setAccepted(true);
  296.                     }
  297.                     $worker $this->em->getRepository(Worker::class)->createWorker(ScheduleThreeWorker::class, $config)->setDelay(2);
  298.                     $em->persist($worker);
  299.                     $uow->computeChangeSet($md$worker);
  300.                 } catch (WorkerAlreadyQueuedException $e) {
  301.                 }
  302.                 try {
  303.                     $linkedWorker $this->em->getRepository(Worker::class)->createWorker(ScheduleThreeWorker::class, (new ScheduleThreeWorkerConfig())
  304.                         ->setId($linkedContract->getId()))->setDelay(2);
  305.                     $em->persist($linkedWorker);
  306.                     $uow->computeChangeSet($md$linkedWorker);
  307.                 } catch (WorkerAlreadyQueuedException $e) {
  308.                 }
  309.             }
  310.             // Regenerate tonnageBandAmendment
  311.             if ($contract instanceof Amendment && Amendment::TYPE_TONNAGEBAND === $contract->getType()) {
  312.                 if ($changes['accepted'][1]) {
  313.                     $substancemd $em->getClassMetadata(Definition::class);
  314.                     $remarkmd $em->getClassMetadata(LegalEntity\Remark::class);
  315.                     $amendment $contract;
  316.                     $data $amendment->getData();
  317.                     foreach ($data['substances'] as $substanceId) {
  318.                         $substance $this->em->getRepository(Definition::class)->find($substanceId);
  319.                         /** @var LegalEntity $entity */
  320.                         $entity $substance->getLegalEntity();
  321.                         $bands TonnageBandType::getTonnageBands(true);
  322.                         $remark = new LegalEntity\Remark();
  323.                         $user $this->em->getRepository(User::class)->find(3);
  324.                         $contents sprintf('Tonnage band change for EC %s from [%s] to [%s]'$substance->getEc()->getEc(), $bands[$substance->getPreviousTonnageBand()], $bands[$substance->getNewTonnageBand()]);
  325.                         $remark->setContents($contents)
  326.                             ->setDate(carbon::now())
  327.                             ->setLegalEntity($entity)
  328.                             ->setAuthor($user);
  329.                         $entity->getRemarks()->add($remark);
  330.                         $this->em->persist($remark);
  331.                         $uow->computeChangeSet($remarkmd$remark);
  332.                         $substance->setTonnageChanged(false);
  333.                         $substance->setTonnageBand($substance->getNewTonnageBand());
  334.                         $substance->setNewTonnageBand(null);
  335.                         $substance->setPreviousTonnageBand(null);
  336.                         $substance->getTonnageBandProof()->setAmendmentId(null);
  337.                         $substance->getTonnageBandProof()->setTonnageInvoiceId(null);
  338.                         $this->em->persist($substance);
  339.                         $uow->computeChangeSet($substancemd$substance);
  340.                     }
  341.                 }
  342.                 try {
  343.                     $worker $this->em->getRepository(Worker::class)->createWorker(TonnageBandWorker::class, (new TonnageBandWorkerConfig())
  344.                         ->setAmendment($contract->getId()))
  345.                     ->setDelay(10);
  346.                     $em->persist($worker);
  347.                     $uow->computeChangeSet($md$worker);
  348.                 } catch (WorkerAlreadyQueuedException $e) {
  349.                 }
  350.             }
  351.             // Send copy of contract to authorized representative
  352.             try {
  353.                 /** @var User $user */
  354.                 $user $this->storage->getToken()->getUser();
  355.                 $worker = ($this->em->getRepository(Worker::class)->createWorker(SendAcceptedContractWorker::class, (new SendAcceptedContractWorkerConfig())
  356.                     ->setUserId($user->getId())
  357.                     ->setContractId($contract->getId())
  358.                     ->setLicenseAgreement($contract instanceof LicenseAgreement)
  359.                 ))->setDelay(300);
  360.                 $em->persist($worker);
  361.                 $uow->computeChangeSet($md$worker);
  362.             } catch (WorkerAlreadyQueuedException $e) {
  363.             }
  364.         }
  365.     }
  366.     /**
  367.      * @param AbstractContract|Contract|LicenseAgreement $contract
  368.      */
  369.     private function processContract(EntityManagerInterface $emAbstractContract $contractbool $removed false)
  370.     {
  371.         if (!self::$enabled) {
  372.             return;
  373.         }
  374.         $repository $em->getRepository(Notification::class);
  375.         if ($contract instanceof Agreement) {
  376.             return;
  377.         }
  378.         if ($contract instanceof LegalEntity\Contract\ModifiedLicenseAgreement) {
  379.             /** @var LegalEntity\Contract\ModifiedLicenseAgreement $contract */
  380.             $user $contract->getCompany()->getUser();
  381.         } else {
  382.             /** @var Amendment $contract */
  383.             $user $contract->getLegalEntity()->getUser();
  384.         }
  385.         if ($contract instanceof Amendment && Amendment::TYPE_SCHEDULE_3 === $contract->getType()) {
  386.             if ($contract instanceof LegalEntity\Contract\Schedule3Amendment) {
  387.                 $linkedContract $contract->getAmendment();
  388.                 if ($contract->isAccepted() && $linkedContract->isAccepted()) {
  389.                     $request $this->em->getRepository(StaffRequest::class)->find($contract->getTransferRequest());
  390.                     $repository $this->em->getRepository(Notification::class);
  391.                     /** @var StaffRequest\TransferRequest $request */
  392.                     if (!$request->isCompleted()) {
  393.                         if ($request->isTransferStaffRequest()) {
  394.                             if (!$request->getMember()) {
  395.                                 $notification = (new Notification\Staff\StaffTransferAcceptedNotification())
  396.                                     ->setup($request->getLegalEntity()->getUser(), $request);
  397.                                 $repository->removeByInternalCode($notification);
  398.                                 if (!$removed) {
  399.                                     $repository->notifyStaff($notification);
  400.                                 }
  401.                             }
  402.                         } else {
  403.                             $notification = (new Notification\NonMember\TransferAcceptedNotification())
  404.                                 ->setup($request->getLegalEntity()->getUser(), $request);
  405.                             $repository->removeByInternalCode($notification);
  406.                             if (!$removed) {
  407.                                 $repository->notifyStaff($notification);
  408.                             }
  409.                         }
  410.                         $request->setContractAccepted(true);
  411.                         $request->setAccepted(true);
  412.                     }
  413.                 }
  414.             }
  415.         }
  416.         if ($contract->isAcceptanceRequired()) {
  417.             $notification = (new ContractsPendingNotification())->setup($em$user);
  418.             // Remove the existing notification (if there is one)
  419.             $repository->removeByInternalCode($notification);
  420.             // Create a new one if one or more contracts require acceptance
  421.             /** @var ContractsPendingNotification $notification */
  422.             if (!$removed && $notification->getPending() > 0) {
  423.                 $repository->notifyUser($notification);
  424.             }
  425.         } else {
  426.             $notification = (new ContractsAddedNotification())->setup($em$user);
  427.             // Remove the existing notification (if there is one)
  428.             $repository->removeByInternalCode($notification);
  429.             // Create a new one if one or more contracts require acceptance
  430.             /** @var ContractsAddedNotification $notification */
  431.             if (!$removed && $notification->getNew() > 0) {
  432.                 $repository->notifyUser($notification);
  433.             }
  434.         }
  435.     }
  436.     public function onKernelController(ControllerEvent $event)
  437.     {
  438.         if (!self::$enabled) {
  439.             return;
  440.         }
  441.         $token $this->storage->getToken();
  442.         if (!$token instanceof TokenInterface) {
  443.             return;
  444.         }
  445.         $user $token->getUser();
  446.         if (!$user instanceof User) {
  447.             return;
  448.         }
  449.         $entities $this->em->getRepository(LegalEntity::class)->findBy(['user' => $user]);
  450.         if (count($entities) > 0) {
  451.             foreach ($entities as $entity) {
  452.                 $violations $this->validator->validate($entity);
  453.                 if ($violations->count() > 0) {
  454.                     return;
  455.                 }
  456.             }
  457.         }
  458.         // Count the number of pending contracts
  459.         $pending = (int) $this->em->createQueryBuilder()
  460.             ->from(Contract::class, 'contract')
  461.             ->select('COUNT(contract)')
  462.             ->join('contract.legalEntity''e')
  463.             ->where('e.user = :user')
  464.             ->setParameter('user'$user)
  465.             ->andWhere('contract.accepted = :false')
  466.             ->setParameter('false'false)
  467.             ->andWhere('contract.file.path IS NOT NULL')
  468.             ->andWhere('contract.forceAcceptance = TRUE')
  469.             ->andWhere('e.status = :status')
  470.             ->setParameter('status'LegalEntity::STATUS_APPROVED)
  471.             ->getQuery()->useQueryCache(true)->getSingleScalarResult();
  472.         if (=== $pending) {
  473.             return;
  474.         }
  475.         $controller $event->getController();
  476.         if (!is_array($controller)) {
  477.             return;
  478.         }
  479.         if ($controller[0] instanceof TutorialController) {
  480.             return;
  481.         }
  482.         if ($controller[0] instanceof SanctionsController) {
  483.             return;
  484.         }
  485.         if (!isset($entity)) {
  486.             throw new \Exception('entity is not set');
  487.         }
  488.         if (!$entity->isInactive()) {
  489.             if ($controller[0] instanceof ErrorController) {
  490.                 // We always need to show error pages
  491.                 $event->getRequest()->attributes->remove('contract_enforcement');
  492.             } elseif ($controller[0] instanceof ContractController || $controller[0] instanceof TransferController) {
  493.                 // Notice needs to be shown, but no redirect required
  494.                 $event->getRequest()->attributes->set('contract_enforcement'false);
  495.             } else {
  496.                 $redirectUrl $this->router->generate('my-sief-page.contracts.index');
  497.                 $event->setController(function () use ($redirectUrl) {
  498.                     return new RedirectResponse($redirectUrl);
  499.                 });
  500.             }
  501.         }
  502.     }
  503.     public function onKernelResponse(ResponseEvent $event)
  504.     {
  505.     }
  506.     public static function disable()
  507.     {
  508.         self::$enabled false;
  509.     }
  510.     public static function enable()
  511.     {
  512.         self::$enabled true;
  513.     }
  514.     public function warmUp($cacheDir): array
  515.     {
  516.         return [TokenStorageInterface::class, EntityManagerInterface::class, RouterInterface::class, ContractController::class, ContainerInterface::class, ValidatorInterface::class, DossierCalculator::class];
  517.     }
  518. }