anitab-org / mentorship-backend

Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.
https://mentorship-backend-temp.herokuapp.com/
GNU General Public License v3.0
196 stars 449 forks source link

Enhancement : Require mentor's approval for task completion #1130

Open RiddhiAthreya opened 3 years ago

RiddhiAthreya commented 3 years ago

Description

Task has got new property requires_approval: [bool]. If it's set to True during creation, task becomes "restricted" - i.e only mentor can mark it as done/completed. When mentee tries to mark it as done, he get's 401 Unauthorized.

Fixes #278

Type of Change:

Code/Quality Assurance Only

How Has This Been Tested?

When a mentee tries to update a task which has requires_approvalset to True Screenshot (190)

creating a task with required_approvalset to True Screenshot (191)

When mentor tries to update a task which has requires_approval set to True Screenshot (192)

Checklist:

Code/Quality Assurance Only

epicadk commented 3 years ago

You'll also need to add migrations

RiddhiAthreya commented 3 years ago

@epicadk can you please tell me how to add that?

epicadk commented 3 years ago

@epicadk can you please tell me how to add that?

I believe @mtreacy002 was going to create a doc for this?

mtreacy002 commented 3 years ago

You'll also need to add migrations

@epicadk , IMO @RiddhiAthreya doesn't need to write a migration script here since the changes applies to dao object of Task and the logic used inside Task db model. The Task db model itself doesn't get affected with the changes here. I tried running flask db migrate and got the response below.

Screen Shot 2021-07-08 at 3 30 36 pm

Let me know if you have a different view on this 😉

RiddhiAthreya commented 3 years ago

@mtreacy002 true , only the task json object has changed, but the task table remains the same :smiley:

devkapilbansal commented 3 years ago

@RiddhiAthreya any updates?