Skip to content

Commit

Permalink
[VoteAg] display alert on D-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaviano committed Nov 5, 2024
1 parent fd7eb65 commit 05430b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/JeMengage/Alert/Provider/ElectionAlertProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public function getAlerts(Adherent $adherent): array
{
$designations = $this->electionManager->findActiveDesignations(
$adherent,
[DesignationTypeEnum::LOCAL_POLL, DesignationTypeEnum::CONSULTATION, DesignationTypeEnum::VOTE],
[
DesignationTypeEnum::LOCAL_POLL,
DesignationTypeEnum::CONSULTATION,
DesignationTypeEnum::VOTE
],
);

if (!$designations) {
Expand Down
1 change: 1 addition & 0 deletions src/Repository/VotingPlatform/DesignationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function findAllActiveForAdherent(Adherent $adherent, array $types = [],
END AS HIDDEN score'
)
->where('DATE_ADD(designation.voteEndDate, 3, \'DAY\') > :now')
->andWhere('DATE_SUB(designation.voteStartDate, 2, \'DAY\') < :now')
->andWhere('designation.isCanceled = false')
->setParameters(['now' => new \DateTime()])
->setMaxResults($limit)
Expand Down

0 comments on commit 05430b8

Please sign in to comment.