byrokrat/giroapp

Add a service layer

Closed this issue · 2 comments

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).

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.

Implementing this will leave us with two sorts of commands.

  • CommandBus\CommandInterface commands and
  • Console\CommandInterface commands

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

And Adapter => SymfonyAdapter at the same time..