Giter Club home page Giter Club logo

laravel-cqrs-es's People

Contributors

batusa avatar bramdevries avatar dieterve avatar jdrieghe avatar woutersioen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-cqrs-es's Issues

Able to generate commands and events

Writing commands and events is a lot of work and it's something that could be generated from a schema or CLI.

Laravel already has various make: commands so we should stick to using those.

Some useful generators:

make:command

  • Creates a command in App\${Aggregate}\Commands\${name}
  • Creates a command handler in App\${Aggregate}\CommandHandlers\${name}
  • Creates a command handler test in tests_path()/App\${Aggregate}\CommandHandlers\${name}Test

make:event

  • Adds default serialization for all value objects.

make:read-model

Couple of concerns:

  • How can we pass a long list of parameters to the commands/events, especially when they are value objects.
  • How can we make the tests_path() configurable? Laravel doesn't have it by default and the location can vary (codeception, PHPUnit, PHPSpec, ...)

TODOS_

  • Able to configure tests_path
  • Commands
    • Able to pass parameters
  • Events
    • Able to pass parameters
    • Add default deserializationCallbacks for each parameter
  • Aggregate
    • Add WriteRepositoryInterface
    • Add DbalWriteRepository

Custom database connection names are not supported

I have several database connections configured in my config/database.php file, for example:

 'connections' => [
        'event_sourcing' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

        'crud' => [
            'driver' => 'mysql',
            'host' => env('DB_CRUD_HOST', '127.0.0.1'),
            'port' => env('DB_CRUD_PORT', '3306'),
            'database' => env('DB_CRUD_DATABASE', 'forge'),
            'username' => env('DB_CRUD_USERNAME', 'forge'),
            'password' => env('DB_CRUD_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
    ],

And I want to use the "event_sourcing" connection as default. But when I do that, I get an error while running my migration: "The given 'driver' pdo_event_sourcing is unknown, Doctrine currently supports only the following drivers: (...)".

After some debugging I found the following line which is responsible for this bug: https://github.com/madewithlove/laravel-cqrs-es/blame/develop/src/EventStore/EventStoreManager.php#L35

Why is it overwriting my "driver" setting? I have already configured that in config/database.php, but because of that line I can't name my connection anything else than mysql.

Make compatible with Laravel 5.4

Code wise it's already done on master, but Laravel has a dependency on ramsey/uuid:3 while broadway:0.10 has one for ramsey/uuid:2.4. In 1.0.0 broadway is adding support for ramsey/uuid:3 so to avoid upgrading issues for this package we should wait till a 1.0.0 version is tagged.

Reset read models when doing event-store:replay

Currently when doing event-store:replay it will still keep old read models around. Ideally these should be cleared.

Since read models can be stored in different drivers we should write the logic ourselves but instead provide an API so that people can hook into these events.

My proposal is to trigger the following application events:

event-store.replay.before
event-store.replay.after

This would allow package consumers to listen for these events and executed the necessary logic.

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.