chore: code cleanup
This commit is contained in:
@@ -57,7 +57,6 @@ class FeedbackReminderService
|
||||
$hotelBaseCodes[] = substr($hotelCode, -3, 3);
|
||||
}
|
||||
|
||||
/** @var User[] $hotelManagers */
|
||||
$hotelManagers = $this
|
||||
->userRepository
|
||||
->getUsersByRoleAndHotelCode('ROLE_HOTEL_MANAGER', $hotelBaseCodes)
|
||||
|
||||
@@ -6,7 +6,9 @@ use App\Email\Mailer;
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\Upload;
|
||||
use App\Repository\DispositionRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\ORM\Query\Parameter;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class UploadReminderService
|
||||
@@ -20,7 +22,7 @@ class UploadReminderService
|
||||
|
||||
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.
|
||||
$contractDueDateFirst = (new \DateTimeImmutable())->modify('-7 days');
|
||||
$contractDueDateSecond = (new \DateTimeImmutable())->modify('-14 days');
|
||||
@@ -40,11 +42,11 @@ class UploadReminderService
|
||||
$qb->expr()->eq('document.createdAt', ':contractDueDateSecond'),
|
||||
)
|
||||
))
|
||||
->setParameters([
|
||||
'documentType' => Upload::TYPE_CONTRACT,
|
||||
'contractDueDateFirst' => $contractDueDateFirst,
|
||||
'contractDueDateSecond' => $contractDueDateSecond,
|
||||
])
|
||||
->setParameters(new ArrayCollection([
|
||||
new Parameter('documentType', Upload::TYPE_CONTRACT),
|
||||
new Parameter('contractDueDateFirst', $contractDueDateFirst),
|
||||
new Parameter('contractDueDateSecond', $contractDueDateSecond),
|
||||
]))
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
@@ -99,10 +101,10 @@ class UploadReminderService
|
||||
$qb->expr()->eq('destination.dateTo', ':dateTo'),
|
||||
)
|
||||
))
|
||||
->setParameters([
|
||||
'documentType' => Upload::TYPE_INVOICE,
|
||||
'dateTo' => $invoiceDueDate,
|
||||
])
|
||||
->setParameters(new ArrayCollection([
|
||||
new Parameter('documentType', Upload::TYPE_INVOICE),
|
||||
new Parameter('dateTo', $invoiceDueDate),
|
||||
]))
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user