stakwork / sphinx-tribes

Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
33 stars 60 forks source link

Build endpoint /features/brief and write feature brief to DB #1961

Open humansinstitute opened 16 hours ago

humansinstitute commented 16 hours ago

Context

For context this is the flow for the Feature Brief Generation: image

Design

  1. Create a new webhook at /features/brief
  2. Add middleware logic to unpack the data object.
  3. Retrieve current feature brief
  4. Merge and Update Feature Brief
  5. Update on page load

1. Create a new webhook

Create a webhook in sphinx-tribes/routes/features.go that will receive data from the Stakwork API at proposed route features/brief")

This would be:

https://community.sphinx.chat/features/brief
or
https://people-test.sphinx.chat/features/brief

2. Add logic to unpack the data object.

Output from Stakwork workflow will be in the following format. We should verify that the featureUUID is correct and present in the database.

{
  "output": {
    "featureBrief":"Long string to be added into the Feature Brief.",
    "audioLink": "URL can be discarded",
    "featureUUID": "1111-2222-3333-4444"
}

We will need to consolidate the Feature Brief update with the existing Data in Feature Brief.

3. Retrieve current feature brief

4. Update Feature brief

Note only the Feature Brief is being updated here is an example:

image

5. Test by refreshing the feature page.

On reload of the feature site page the new brief should be visible

Assignment Criteria

Before requesting assignment:

Acceptance Criteria

Webhook Implementation:

Testing:

MahtabBukhari commented 16 hours ago

@humansinstitute Could you please assign me?

MuhammadUmer44 commented 16 hours ago

@humansinstitute Please assign me