| @@ 19-46 (lines=28) @@ | ||
| 16 | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | ||
| 19 | class TaskPriorityChanged implements DomainEvent |
|
| 20 | { |
|
| 21 | private $taskId; |
|
| 22 | private $priority; |
|
| 23 | private $occurredOn; |
|
| 24 | ||
| 25 | public function __construct(TaskId $taskId, TaskPriority $priority) |
|
| 26 | { |
|
| 27 | $this->taskId = $taskId; |
|
| 28 | $this->priority = $priority; |
|
| 29 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function id() : TaskId |
|
| 33 | { |
|
| 34 | return $this->taskId; |
|
| 35 | } |
|
| 36 | ||
| 37 | public function priority() : TaskPriority |
|
| 38 | { |
|
| 39 | return $this->priority; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function occurredOn() : \DateTimeInterface |
|
| 43 | { |
|
| 44 | return $this->occurredOn; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 19-46 (lines=28) @@ | ||
| 16 | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | ||
| 19 | class TaskProgressChanged implements DomainEvent |
|
| 20 | { |
|
| 21 | private $taskId; |
|
| 22 | private $progress; |
|
| 23 | private $occurredOn; |
|
| 24 | ||
| 25 | public function __construct(TaskId $taskId, TaskProgress $progress) |
|
| 26 | { |
|
| 27 | $this->taskId = $taskId; |
|
| 28 | $this->progress = $progress; |
|
| 29 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function id() : TaskId |
|
| 33 | { |
|
| 34 | return $this->taskId; |
|
| 35 | } |
|
| 36 | ||
| 37 | public function progress() |
|
| 38 | { |
|
| 39 | return $this->progress; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function occurredOn() : \DateTimeInterface |
|
| 43 | { |
|
| 44 | return $this->occurredOn; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 20-47 (lines=28) @@ | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | use Kreta\TaskManager\Domain\Model\Organization\Participant; |
|
| 19 | ||
| 20 | class TaskReassigned implements DomainEvent |
|
| 21 | { |
|
| 22 | private $taskId; |
|
| 23 | private $assignee; |
|
| 24 | private $occurredOn; |
|
| 25 | ||
| 26 | public function __construct(TaskId $taskId, Participant $assignee) |
|
| 27 | { |
|
| 28 | $this->taskId = $taskId; |
|
| 29 | $this->assignee = $assignee; |
|
| 30 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function id() : TaskId |
|
| 34 | { |
|
| 35 | return $this->taskId; |
|
| 36 | } |
|
| 37 | ||
| 38 | public function assignee() : Participant |
|
| 39 | { |
|
| 40 | return $this->assignee; |
|
| 41 | } |
|
| 42 | ||
| 43 | public function occurredOn() : \DateTimeInterface |
|
| 44 | { |
|
| 45 | return $this->occurredOn; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||