-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.php
More file actions
41 lines (35 loc) · 875 Bytes
/
Event.php
File metadata and controls
41 lines (35 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
declare(strict_types=1);
namespace ComplexHeart\Domain\Contracts\Events;
/**
* Interface Event
*
* Represents a domain event - something that happened in the domain.
*
* @author Unay Santisteban <usantisteban@othercode.io>
*/
interface Event
{
/**
* The unique id for the current domain event (UUID).
*/
public function eventId(): string;
/**
* The unique domain event name, commonly is a dotted string.
*
* Examples: order.placed, user.registered, payment.processed
*/
public function eventName(): string;
/**
* Returns the event payload.
*
* @return array<string, mixed>
*/
public function payload(): array;
/**
* The timestamp when the domain event occurred in ISO-8601.
*
* Example: 2005-08-15T15:52:01+0000
*/
public function occurredOn(): string;
}