feat: remove obsolete date range override
This commit is contained in:
1 parent
86c5d23181
commit
127ced4378
42 files changed
+152
-353
No files matched your search
@@ -37,12 +37,12 @@ class ApplicationValidator extends ConstraintValidator
|
||||
return;
|
||||
}
|
||||
|
||||
if (null === $period = $application->getAssignment()->getEffectivePeriod()) {
|
||||
if (null === $destination = $application->getAssignment()->getDestination()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$applicationDateFrom = $period->start->toDateTimeImmutable();
|
||||
$applicationDateTo = $period->end->toDateTimeImmutable();
|
||||
$applicationDateFrom = $destination->getDateFrom();
|
||||
$applicationDateTo = $destination->getDateTo();
|
||||
|
||||
$qb = $this
|
||||
->dispositionRepository
|
||||
@@ -62,26 +62,8 @@ class ApplicationValidator extends ConstraintValidator
|
||||
$qb->expr()->neq('assignment.status', ':assignment_called_off'),
|
||||
$qb->expr()->isNull('assignment.deletedAt'),
|
||||
$qb->expr()->isNull('destination.deletedAt'),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNull('assignment.dateFrom'),
|
||||
$qb->expr()->lte('destination.dateFrom', ':application_date_to')
|
||||
),
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNotNull('assignment.dateFrom'),
|
||||
$qb->expr()->lte('assignment.dateFrom', ':application_date_to')
|
||||
)
|
||||
),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNull('assignment.dateTo'),
|
||||
$qb->expr()->gte('destination.dateTo', ':application_date_from')
|
||||
),
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->isNotNull('assignment.dateTo'),
|
||||
$qb->expr()->gte('assignment.dateTo', ':application_date_from')
|
||||
)
|
||||
)
|
||||
$qb->expr()->lte('destination.dateFrom', ':application_date_to'),
|
||||
$qb->expr()->gte('destination.dateTo', ':application_date_from')
|
||||
))
|
||||
->setParameter('teamer', $teamer)
|
||||
->setParameter('disposition_called_off', Disposition::STATUS_CALLED_OFF)
|
||||
|
||||
Reference in new issue
Block a user