feat: filter timeline by date range and hotels

This commit is contained in:
Björn Fromme
2025-03-21 11:52:29 +01:00
parent 9ffada111c
commit 06c32fd597
14 changed files with 316 additions and 28 deletions
+7 -1
View File
@@ -17,6 +17,12 @@ abstract class AbstractFilterDto
foreach ($reflection->getProperties() as $property) {
$name = $property->getName();
// don't count properties starting with '_'
if (str_starts_with($name, '_')) {
continue;
}
if ($this->$name !== $freshInstance->$name) {
++$filterCount;
}
@@ -24,4 +30,4 @@ abstract class AbstractFilterDto
return $filterCount;
}
}
}
+1 -4
View File
@@ -2,9 +2,6 @@
namespace App\Model;
use App\Entity\Destination;
use App\Entity\JobProfile;
class AssignmentFilterDto extends AbstractFilterDto
{
public const DURATION_WEEKEND = 1;
@@ -116,4 +113,4 @@ class AssignmentFilterDto extends AbstractFilterDto
return $this;
}
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Model;
use Carbon\CarbonPeriod;
class TimelineFilterDto extends AssignmentFilterDto
{
protected ?CarbonPeriod $_period = null;
public function getPeriod(): ?CarbonPeriod
{
return $this->_period;
}
public function setPeriod(?CarbonPeriod $_period): static
{
$this->_period = $_period;
return $this;
}
}
+1 -1
View File
@@ -159,6 +159,6 @@ class TimelineItem
return 1;
}
return $this->getDateFrom()->diff($this->getDateTo())->days;
return $this->getDateFrom()->diff($this->getDateTo())->days + 1;
}
}