Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
fix: applicant list and domain event handle null course
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoaureliocardoso committed Dec 22, 2022
1 parent 099a7d3 commit de6e9c5
Show file tree
Hide file tree
Showing 4 changed files with 587 additions and 503 deletions.
12 changes: 6 additions & 6 deletions app/Listeners/DomainEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ public function handleBondReviewRequested(BondReviewRequested $event)
*/
public function handleBondImpeded(BondImpeded $event)
{
$secUsers = $this->userRepository->getActiveUsersOfActiveTypeId($this->secUtId);
$users = $this->userRepository->getActiveUsersOfActiveTypeId($this->secUtId);

/**
* @var Course $course
* @var ?Course $course
*/
$course = $event->bond->course;
$courseId = $course->id;
$coordUsers = $this->userRepository->getActiveUsersOfActiveTypeIdOfCourseId($this->coordUtId, $courseId);

$users = $secUsers->merge($coordUsers);
$courseId = $course?->id;
if ($courseId != null) {
$users->merge($this->userRepository->getActiveUsersOfActiveTypeIdOfCourseId($this->coordUtId, $courseId));
}

Notification::send($users, new BondImpededNotification($event->bond));
$this->logger->logDomainEvent(
Expand Down
Loading

0 comments on commit de6e9c5

Please sign in to comment.