chore: code cleanup
This commit is contained in:
@@ -57,7 +57,6 @@ class FeedbackReminderService
|
|||||||
$hotelBaseCodes[] = substr($hotelCode, -3, 3);
|
$hotelBaseCodes[] = substr($hotelCode, -3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var User[] $hotelManagers */
|
|
||||||
$hotelManagers = $this
|
$hotelManagers = $this
|
||||||
->userRepository
|
->userRepository
|
||||||
->getUsersByRoleAndHotelCode('ROLE_HOTEL_MANAGER', $hotelBaseCodes)
|
->getUsersByRoleAndHotelCode('ROLE_HOTEL_MANAGER', $hotelBaseCodes)
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ use App\Email\Mailer;
|
|||||||
use App\Entity\Disposition;
|
use App\Entity\Disposition;
|
||||||
use App\Entity\Upload;
|
use App\Entity\Upload;
|
||||||
use App\Repository\DispositionRepository;
|
use App\Repository\DispositionRepository;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\ORM\Query\Expr\Join;
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
|
use Doctrine\ORM\Query\Parameter;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class UploadReminderService
|
class UploadReminderService
|
||||||
@@ -20,7 +22,7 @@ class UploadReminderService
|
|||||||
|
|
||||||
public function sendContractUploadReminders(): string
|
public function sendContractUploadReminders(): string
|
||||||
{
|
{
|
||||||
// Contracts have to be uploaded before assignment's begin date. Reminder is
|
// Contracts have to be uploaded before assignments' begin date. Reminder is
|
||||||
// sent 7 and 14 days after disposition has been created.
|
// sent 7 and 14 days after disposition has been created.
|
||||||
$contractDueDateFirst = (new \DateTimeImmutable())->modify('-7 days');
|
$contractDueDateFirst = (new \DateTimeImmutable())->modify('-7 days');
|
||||||
$contractDueDateSecond = (new \DateTimeImmutable())->modify('-14 days');
|
$contractDueDateSecond = (new \DateTimeImmutable())->modify('-14 days');
|
||||||
@@ -40,11 +42,11 @@ class UploadReminderService
|
|||||||
$qb->expr()->eq('document.createdAt', ':contractDueDateSecond'),
|
$qb->expr()->eq('document.createdAt', ':contractDueDateSecond'),
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
->setParameters([
|
->setParameters(new ArrayCollection([
|
||||||
'documentType' => Upload::TYPE_CONTRACT,
|
new Parameter('documentType', Upload::TYPE_CONTRACT),
|
||||||
'contractDueDateFirst' => $contractDueDateFirst,
|
new Parameter('contractDueDateFirst', $contractDueDateFirst),
|
||||||
'contractDueDateSecond' => $contractDueDateSecond,
|
new Parameter('contractDueDateSecond', $contractDueDateSecond),
|
||||||
])
|
]))
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
@@ -99,10 +101,10 @@ class UploadReminderService
|
|||||||
$qb->expr()->eq('destination.dateTo', ':dateTo'),
|
$qb->expr()->eq('destination.dateTo', ':dateTo'),
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
->setParameters([
|
->setParameters(new ArrayCollection([
|
||||||
'documentType' => Upload::TYPE_INVOICE,
|
new Parameter('documentType', Upload::TYPE_INVOICE),
|
||||||
'dateTo' => $invoiceDueDate,
|
new Parameter('dateTo', $invoiceDueDate),
|
||||||
])
|
]))
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user