| @@ 20-54 (lines=35) @@ | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | use Kreta\SharedKernel\Domain\Model\Identity\Slug; |
|
| 19 | ||
| 20 | class OrganizationCreated implements DomainEvent |
|
| 21 | { |
|
| 22 | private $organizationId; |
|
| 23 | private $organizationName; |
|
| 24 | private $organizationSlug; |
|
| 25 | private $occurredOn; |
|
| 26 | ||
| 27 | public function __construct(OrganizationId $id, OrganizationName $name, Slug $slug) |
|
| 28 | { |
|
| 29 | $this->organizationId = $id; |
|
| 30 | $this->organizationName = $name; |
|
| 31 | $this->organizationSlug = $slug; |
|
| 32 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function organizationId() : OrganizationId |
|
| 36 | { |
|
| 37 | return $this->organizationId; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function organizationName() : OrganizationName |
|
| 41 | { |
|
| 42 | return $this->organizationName; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function organizationSlug() : Slug |
|
| 46 | { |
|
| 47 | return $this->organizationSlug; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function occurredOn() : \DateTimeInterface |
|
| 51 | { |
|
| 52 | return $this->occurredOn; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 20-54 (lines=35) @@ | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | use Kreta\SharedKernel\Domain\Model\Identity\Slug; |
|
| 19 | ||
| 20 | class OrganizationEdited implements DomainEvent |
|
| 21 | { |
|
| 22 | private $organizationId; |
|
| 23 | private $name; |
|
| 24 | private $slug; |
|
| 25 | private $occurredOn; |
|
| 26 | ||
| 27 | public function __construct(OrganizationId $organizationId, OrganizationName $name, Slug $slug) |
|
| 28 | { |
|
| 29 | $this->organizationId = $organizationId; |
|
| 30 | $this->name = $name; |
|
| 31 | $this->slug = $slug; |
|
| 32 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function id() : OrganizationId |
|
| 36 | { |
|
| 37 | return $this->organizationId; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function name() : OrganizationName |
|
| 41 | { |
|
| 42 | return $this->name; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function slug() : Slug |
|
| 46 | { |
|
| 47 | return $this->slug; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function occurredOn() : \DateTimeInterface |
|
| 51 | { |
|
| 52 | return $this->occurredOn; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 20-57 (lines=38) @@ | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | use Kreta\TaskManager\Domain\Model\User\UserId; |
|
| 19 | ||
| 20 | class OrganizationMemberAdded implements DomainEvent |
|
| 21 | { |
|
| 22 | private $organizationId; |
|
| 23 | private $organizationMemberId; |
|
| 24 | private $userId; |
|
| 25 | private $occurredOn; |
|
| 26 | ||
| 27 | public function __construct( |
|
| 28 | OrganizationMemberId $organizationMemberId, |
|
| 29 | UserId $userId, |
|
| 30 | OrganizationId $organizationId |
|
| 31 | ) { |
|
| 32 | $this->organizationId = $organizationId; |
|
| 33 | $this->organizationMemberId = $organizationMemberId; |
|
| 34 | $this->userId = $userId; |
|
| 35 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function organizationId() : OrganizationId |
|
| 39 | { |
|
| 40 | return $this->organizationId; |
|
| 41 | } |
|
| 42 | ||
| 43 | public function organizationMemberId() : OrganizationMemberId |
|
| 44 | { |
|
| 45 | return $this->organizationMemberId; |
|
| 46 | } |
|
| 47 | ||
| 48 | public function userId() : UserId |
|
| 49 | { |
|
| 50 | return $this->userId; |
|
| 51 | } |
|
| 52 | ||
| 53 | public function occurredOn() : \DateTimeInterface |
|
| 54 | { |
|
| 55 | return $this->occurredOn; |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| @@ 20-54 (lines=35) @@ | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | use Kreta\TaskManager\Domain\Model\User\UserId; |
|
| 19 | ||
| 20 | class OwnerAdded implements DomainEvent |
|
| 21 | { |
|
| 22 | private $ownerId; |
|
| 23 | private $userId; |
|
| 24 | private $organizationId; |
|
| 25 | private $occurredOn; |
|
| 26 | ||
| 27 | public function __construct(OwnerId $ownerId, UserId $userId, OrganizationId $organizationId) |
|
| 28 | { |
|
| 29 | $this->organizationId = $organizationId; |
|
| 30 | $this->ownerId = $ownerId; |
|
| 31 | $this->userId = $userId; |
|
| 32 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function organizationId() : OrganizationId |
|
| 36 | { |
|
| 37 | return $this->organizationId; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function ownerId() : OwnerId |
|
| 41 | { |
|
| 42 | return $this->ownerId; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function userId() : UserId |
|
| 46 | { |
|
| 47 | return $this->userId; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function occurredOn() : \DateTimeInterface |
|
| 51 | { |
|
| 52 | return $this->occurredOn; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 19-53 (lines=35) @@ | ||
| 16 | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | ||
| 19 | class TaskEdited implements DomainEvent |
|
| 20 | { |
|
| 21 | private $taskId; |
|
| 22 | private $title; |
|
| 23 | private $description; |
|
| 24 | private $occurredOn; |
|
| 25 | ||
| 26 | public function __construct(TaskId $taskId, TaskTitle $title, string $description) |
|
| 27 | { |
|
| 28 | $this->taskId = $taskId; |
|
| 29 | $this->title = $title; |
|
| 30 | $this->description = $description; |
|
| 31 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function id() : TaskId |
|
| 35 | { |
|
| 36 | return $this->taskId; |
|
| 37 | } |
|
| 38 | ||
| 39 | public function title() : TaskTitle |
|
| 40 | { |
|
| 41 | return $this->title; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function description() : string |
|
| 45 | { |
|
| 46 | return $this->description; |
|
| 47 | } |
|
| 48 | ||
| 49 | public function occurredOn() : \DateTimeInterface |
|
| 50 | { |
|
| 51 | return $this->occurredOn; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 19-53 (lines=35) @@ | ||
| 16 | ||
| 17 | use Kreta\SharedKernel\Domain\Model\DomainEvent; |
|
| 18 | ||
| 19 | class UserReceivedNotification implements DomainEvent |
|
| 20 | { |
|
| 21 | private $userId; |
|
| 22 | private $notificationId; |
|
| 23 | private $body; |
|
| 24 | private $occurredOn; |
|
| 25 | ||
| 26 | public function __construct(UserId $userId, NotificationId $notificationId, NotificationBody $body) |
|
| 27 | { |
|
| 28 | $this->notificationId = $notificationId; |
|
| 29 | $this->body = $body; |
|
| 30 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 31 | $this->userId = $userId; |
|
| 32 | } |
|
| 33 | ||
| 34 | public function userId() : UserId |
|
| 35 | { |
|
| 36 | return $this->userId; |
|
| 37 | } |
|
| 38 | ||
| 39 | public function notificationId() : NotificationId |
|
| 40 | { |
|
| 41 | return $this->notificationId; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function body() : NotificationBody |
|
| 45 | { |
|
| 46 | return $this->body; |
|
| 47 | } |
|
| 48 | ||
| 49 | public function occurredOn() : \DateTimeInterface |
|
| 50 | { |
|
| 51 | return $this->occurredOn; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||