mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
[export] fix calendar scopeAggregator query + unit test
This commit is contained in:
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class JobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'cal_agg';
|
||||
private const PREFIX = 'cal_agg_job';
|
||||
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
@@ -50,12 +50,12 @@ final readonly class JobAggregator implements AggregatorInterface
|
||||
)
|
||||
->leftJoin(
|
||||
UserJobHistory::class,
|
||||
"{$p}_ujh",
|
||||
"{$p}_history",
|
||||
Expr\Join::WITH,
|
||||
$qb->expr()->eq("{$p}_ujh.user", "{$p}_user")
|
||||
$qb->expr()->eq("{$p}_history.user", "{$p}_user")
|
||||
)
|
||||
->andWhere("{$p}_ujh.startDate <= :{$p}_at AND ({$p}_ujh.endDate IS NULL OR {$p}_ujh.endDate > :{$p}_at)")
|
||||
->addSelect("IDENTITY({$p}_ujh.job) AS {$p}_select")
|
||||
->andWhere("{$p}_history.startDate <= :{$p}_at AND ({$p}_history.endDate IS NULL OR {$p}_history.endDate > :{$p}_at)")
|
||||
->addSelect("IDENTITY({$p}_history.job) AS {$p}_select")
|
||||
->setParameter(
|
||||
"{$p}_at",
|
||||
$this->rollingDateConverter->convert($data['job_at'])
|
||||
@@ -71,7 +71,7 @@ final readonly class JobAggregator implements AggregatorInterface
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder->add('job_at', PickRollingDateType::class, [
|
||||
'label' => 'export.aggregator.calendar.Calc date',
|
||||
'label' => 'export.aggregator.calendar.agent_job.Calc date',
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user