Please give a one-sentence summary of the cleanup you would like done.
We should refactor the business logic of our commands so they are independent of Slack messaging.
Please give as many details as possible about the cleanup or refactoring.
Our business logic (as expressed in modules like UserCommand etc) is tied pretty intimately to Slack messaging. Thus, if we introduce an HTTP API, we will need to duplicate a fair amount of functionality. We should refactor so that the business logic is independent of Slack messaging. Then the HTTP API can access the business logic directly while UserCommand and so on can access the business logic and format it appropriately for messaging to Slack.
The work might look something like this:
[ ] Create factory methods for the database facade and all our interfaces in factory/__init__.py
[ ] Create a new module called api (or something similar), use the factory methods to instantiate all the interfaces, and port over all the command helper methods as their own functions here
[ ] Import these new functions from api in the command parsers to replace the usage of their current helper methods
[ ] Delete the old helper methods
Something similar might have to be done for the webhook handlers, so leave room in the design of the new api module for this.
Please list any additional context; in particular, list what areas of the code base this would affect.
Please give a one-sentence summary of the cleanup you would like done.
We should refactor the business logic of our commands so they are independent of Slack messaging.
Please give as many details as possible about the cleanup or refactoring.
Our business logic (as expressed in modules like
UserCommand
etc) is tied pretty intimately to Slack messaging. Thus, if we introduce an HTTP API, we will need to duplicate a fair amount of functionality. We should refactor so that the business logic is independent of Slack messaging. Then the HTTP API can access the business logic directly whileUserCommand
and so on can access the business logic and format it appropriately for messaging to Slack.The work might look something like this:
factory/__init__.py
api
(or something similar), use the factory methods to instantiate all the interfaces, and port over all the command helper methods as their own functions hereapi
in the command parsers to replace the usage of their current helper methodsSomething similar might have to be done for the webhook handlers, so leave room in the design of the new
api
module for this.Please list any additional context; in particular, list what areas of the code base this would affect.
app/controller/commands/
factory/