Giter Site home page Giter Site logo

domain-event's People

Contributors

sylvainfilteau avatar yvoyer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

domain-event's Issues

Add Support for Symfony 5

Error: Class 'Symfony\Component\EventDispatcher\Event' not found

/var/www/project/vendor/star/domain-event/src/Ports/Symfony/EventAdapter.php:17
/var/www/project/vendor/symfony/error-handler/DebugClassLoader.php:337
/var/www/project/vendor/star/domain-event/src/Ports/Symfony/SymfonyPublisher.php:37
/var/www/project/vendor/star/domain-event/src/Ports/Symfony/SymfonyPublisher.php:75
/var/www/project/src/ProductInventory/Infrastructure/EventStore/ProductEventStore.php:40
/var/www/project/src/ProductInventory/Domain/Commands/Product/RegisterProductHandler.php:23
/var/www/project/src/Core/Application/Messaging/ClassMapCommands.php:29
/var/www/project/tests/Functional/Http/Fixtures/ApiFixture.php:38
/var/www/project/tests/Functional/Http/Fixtures/ApiFixture.php:29
/var/www/project/tests/Functional/Http/Controller/ProductShowTest.php:21

use Symfony\Contracts\EventDispatcher\Event;

Add support for ordering on pushed_on column

When rewriting history of events in a store, we might need to push or remove events.
When pushing new events, only fetching by version can cause conflicts with the date.
We should load the event of the aggregate using an order on pushed_on, version ASC to avoid conflict, and more control on the fetch.

Cannot use the EventPublisher in a symfony application

I get an error must be an instance of MyApp\Event instance of Star\Component\DomainEvent\Symfony\EventAdapter given when using the symfony dispatcher in my app.

// services.yml
services:
    app.event_publisher:
        class: Star\Component\DomainEvent\Symfony\SymfonyPublisher
        arguments:
            - '@event_dispatcher'

    MyApp\MyListener:
        tags:
            - { name: 'kernel.event_subscriber' }

Triggering multiple times an event do not propagate it twice

Step to reproduce

  1. Call twice the aggregate method which adds a mutation
  2. collect events

Expected result
The collected events count should be 2

Actual result
The collected events count is 1

This has the effect of not publishing twice the event when given to the EventPublisher

Mutating to another state inside a mutation do not keep the order of events

Steps to reproduce:

  • Creating aggregate: with event AggregateWasCreated
  • Call $this->mutate(new OtherEvent())Inside onAggregateWasCreated()

When collecting uncommited events, the order is not reflecting the execution

$aggregate = Aggregate::create();
$events = $aggregate->uncommitedEvents(); 
// $events[0] => OtherEvent
// $events[1] => AggregateWasCreated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.