---
# System prepended metadata

title: Backend requirements Vinofy V0.0.8

---

# Backend requirements Vinofy V0.0.8

### TODOs

* Add new tables to DB (siprewards_tasks, user_siprewards_tasks)
* Update users table (add sipcoints field)
* Fill siprewards_tasks with data from Figma Design
* Create endpoint GET 'users/sipcoints'
* Create endpoint GET 'siprawards/tasks'
* Create endpoint POST 'social_media_sharing'
* Update signup to receive 'referrer' query param
* Update social media **signup** to receive 'referrer' query param (ignore if user trying to auth already exist)
* Update user's sipcoints when user:
    * creates a reaction video
    * likes 10 reactions
    * rates 5 wines
    * someone signs up with user's id as referrer code(invite a friend)
  
### Notes
* Invite friend is the only task with field is_one_time_task = false
* If is_one_time_task = false and user_siprewards_tasks.steps_done == siprewards_tasks.steps_needed then set user_siprewards_tasks.steps_done = 0 and user_siprewards_tasks.times_completed++


### DB Tables

![](https://i.imgur.com/hSzHPt4.png)

### Endpoints

#### path: users/sipcoints
method: GET
request body: none
query params: none

response:
```
{
    sipcoints: int
}
```

#### path: siprawards/tasks
method: GET
request body: none
query params: none

response:
```
{
    data: [
        {
            id: String,
            title: String,
            Description: String,
            sipcoints: interger,
            steps: integer,
            steps_done: integer,
            sub_tasks: [
                {
                    id: String,
                    title: String,
                    Description: String,
                    sipcoints: interger,
                    steps: integer,
                    steps_done: integer
                }
                ...
            ]
            
        }
    ]
}
```

#### path: social_media_sharing
method: POST
request body: none
query params: none

response:
```
{
    msg: 'ok'
}
```


















