Commit d7b3668f authored by Johan Vervloet's avatar Johan Vervloet

Log timestamp in event store.

Closes #103
parent 72178421
Pipeline #123874960 failed with stages
in 2 minutes and 43 seconds
......@@ -3,6 +3,7 @@
## [1.0] - Unreleased
- Introduced `ScoreLineNumber`, got rid of 'dummy games', #129
- Log event time in the event store, #103
## [0.5.1] - 2020-02-29
......
......@@ -177,7 +177,7 @@
<!-- The table with the actual scores -->
<h2>{{ $t("scores") }}</h2>
<h2 id="score-table">{{ $t("scores") }}</h2>
<div class="table-responsive table-sm">
<score-sheet
......
......@@ -2,9 +2,10 @@
namespace App\EventSourcing\EventStore\Orm\Entity;
use App\EventSourcing\Aggregate\AggregateRootIdentifier;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\UniqueConstraint;
use App\EventSourcing\Aggregate\AggregateRootIdentifier;
/**
* @ORM\Table(name="event_store",
......@@ -49,6 +50,12 @@ class OrmStoredEvent
*/
private $payload = [];
/**
* @var DateTimeImmutable
* @ORM\Column(type="datetime")
*/
private $createdAt;
public function __construct(
AggregateRootIdentifier $aggregateRootId,
int $aggregateVersion,
......@@ -59,6 +66,10 @@ class OrmStoredEvent
$this->aggregateVersion = $aggregateVersion;
$this->eventType = $eventType;
$this->payload = $payload;
// This will not override the datetime stored in the database, since the
// constructor is not used by doctrine when hydrating an OrmStoredEvent.
$this->createdAt = new DateTimeImmutable();
}
public function getId(): ?int
......
......@@ -45,7 +45,9 @@ final class DealerCest
$i->seeOptionIsSelected('new_dealer', 'tlm');
// Reload the page, and see if dealer is still selected (see #29).
$i->reloadPage();
$i->waitForText('penn');
$i->waitForText('New player:');
$i->scrollTo('#score-table');
$i->waitForText('tlm', null, 'th.table-primary');
$i->see('tlm', 'th.table-primary');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment