feat: filter assignments by hotel in favor of destination
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Service\Common;
|
||||
|
||||
use App\Entity\Destination;
|
||||
use App\Entity\JobProfile;
|
||||
use App\Model\AssignmentFilterDto;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@@ -68,13 +67,8 @@ class AssignmentFilterHandler
|
||||
;
|
||||
$filterDto->setJobProfile($jobProfile);
|
||||
}
|
||||
if (isset($data['destination']) && 0 < (int) $data['destination']) {
|
||||
$destination = $this
|
||||
->entityManager
|
||||
->getRepository(Destination::class)
|
||||
->find($data['destination'])
|
||||
;
|
||||
$filterDto->setDestination($destination);
|
||||
if (isset($data['hotel'])) {
|
||||
$filterDto->setHotel($data['hotel']);
|
||||
}
|
||||
if (isset($data['duration']) && 0 < (int) $data['duration']) {
|
||||
$filterDto->setDuration($data['duration']);
|
||||
@@ -92,7 +86,7 @@ class AssignmentFilterHandler
|
||||
'date_from' => $filterDto->getDateFrom(),
|
||||
'date_to' => $filterDto->getDateTo(),
|
||||
'job_profile' => $filterDto->getJobProfile()?->getId(),
|
||||
'destination' => $filterDto->getDestination()?->getId(),
|
||||
'hotel' => $filterDto->getHotel(),
|
||||
'duration' => $filterDto->getDuration(),
|
||||
'status' => $filterDto->getStatus(),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user