ubclaunchpad / rocket2

🚀 The official UBC Launch Pad Slack bot and team management platform
https://rocket2.readthedocs.io
Other
18 stars 6 forks source link

Refactor business logic to accommodate HTTP API #222

Open rwblickhan opened 5 years ago

rwblickhan commented 5 years ago

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:

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.

app/controller/commands/ factory/

rwblickhan commented 5 years ago

IMG_3990

Here's our notes on implementing it.

chuck-sys commented 4 years ago

To Do: