byrokrat / giroapp

Command line app for managing autogiro donations.
GNU General Public License v3.0
4 stars 2 forks source link

Add a service layer #165

Closed hanneskod closed 5 years ago

hanneskod commented 6 years ago

It has been requested to be able to execute giroapp commands without passing a shell. That kind of thing should be implemented as a service layer.

Possible a command bus using Tactician.

It also makes sense to differentiate between commands (revoke mandate) and events (mandate revoked).

hanneskod commented 5 years ago

In providing a quick fix for #171 we differentiate between MANDATE_REVOCATION_REQUESTED and MANDATE_REVOKED, the former being the user requesting revocation and the latter the bank confirming the request OR signaling the revocation for other reasons. The reason for this quick fix is to create a clean hook for plugins. They are however handled in the same way throughout the listener ecosystem.

This highlights the need of a service layer. In both these situations a RevokeMandate command should be evoked. And IF the handling of that command leads to a change in donor state (eg. if the donor was active prior to the handling) then a MANDATE_REVOKED event should be dispatched.

hanneskod commented 5 years ago

Implementing this will leave us with two sorts of commands.

Some renaming to separate the two is needed. Maybe Console\ConsoleInterface and AddConsole ... ??

And Adapter => SymfonyAdapter at the same time..