bridge-in-tech-backend icon indicating copy to clipboard operation
bridge-in-tech-backend copied to clipboard

Feat: create POST /organizations /{organization_id} /programs/{program_id} /send_request

Open mtreacy002 opened this issue 4 years ago β€’ 27 comments

Description

As a developer, I need add POST /organizations /{organization_id} /programs/{program_id} /send_request API endpoint, so that a mentor/mentee can apply to a program.

Mocks

NA

Acceptance Criteria

Update [Required]

  • [ ] add POST /organizations /{organization_id} /programs/{program_id} /send_request API endpoint
  • [ ] this request must create 2 db instances, one for MentorshipRelationModel under public (MS) schema and the other is the MentorshipRelationExtensionModel under bitschema, each with its relevant information.
  • [ ] include all possible http responses:
    • Created (201): when the process completed successfully
    • Bad Request (400): when the payload contains invalid fields
    • Unauthorized (401): when the token is missing/invalid/expired
    • Not Found (404): when the organization and/or program don't exist
    • Conflict (409): when the user has already made the request to that program
    • Internal server error (500): when either MS or BIT server is facing internal server error

Enhancement to Update [Optional]

NA

Definition of Done

  • [ ] All of the required items are completed.
  • [ ] Approval by 1 mentor.

Estimation

2-3 days

mtreacy002 avatar Sep 29 '20 08:09 mtreacy002

Can I work on this? (But, I would require some guidance as I am new to this :D)

Sanika1999 avatar Sep 30 '20 18:09 Sanika1999

Sure, @Sanika1999, I'll assign you to this. But are you able to solve the setting up issue on the backend you mentioned here? Let me know if this is still an issue after pulling the latest code change on upstream develop branch.

mtreacy002 avatar Sep 30 '20 23:09 mtreacy002

@mtreacy002 Iam still working on this it might take 1-2 days more.

Sanika1999 avatar Oct 04 '20 08:10 Sanika1999

That's ok, @Sanika1999 . Take your time. It is a pretty big task. Thanks for giving the update.

mtreacy002 avatar Oct 07 '20 08:10 mtreacy002

Hi @mtreacy002 Iam so sorry but my laptop has crashed so I need to set everything up again. You can unassign me for now.πŸ˜”

Sanika1999 avatar Oct 08 '20 06:10 Sanika1999

I would like to work on this @mtreacy002

vj-codes avatar Oct 11 '20 10:10 vj-codes

That's ok, @Sanika1999 . Thanks for letting me know. Hope you get the laptop fix soon πŸ˜‰. @vj-codes . Yes, suree. I'll assign you to this.

mtreacy002 avatar Oct 11 '20 10:10 mtreacy002

Update: working on it , will send a PR by this week

vj-codes avatar Oct 19 '20 11:10 vj-codes

@vj-codes , can you please give me an update on where you are with this issue? Thanks

mtreacy002 avatar Oct 24 '20 01:10 mtreacy002

@mtreacy002 heyy , I am kinda busy with a hackathon project which will get over on 26th , if this is an urgent issue to be fixed , anyone else willing to can work coz I won't be able to until 26th .

vj-codes avatar Oct 24 '20 08:10 vj-codes

That's ok, @vj-codes. Take your time. You can do it after the 26 if you'd like. BIT backend repo is currently blocked by PR #167 and #129 anyway. Even the other PRs that are currently open cannot be merged until the 2 PRs mentioned get reviewed πŸ™„ . Just let me know when you ready to pick it up again πŸ˜‰

mtreacy002 avatar Oct 24 '20 10:10 mtreacy002

@mtreacy002 really sorry for the delay , I would like to work on this again!

vj-codes avatar Nov 01 '20 11:11 vj-codes

Sure, thanks for the update, @vj-codes. Look forward to the PR... :wink:

mtreacy002 avatar Nov 02 '20 08:11 mtreacy002

@mtreacy002 hey I kinda forgot the file in which the changes were needed πŸ‘€ So just to make sure , ms schema and bit schema are the right files or not?

vj-codes avatar Nov 04 '20 12:11 vj-codes

Sorry for the late reply, @vj-codes . We definitely need a new file (mentorship_relation.py) under api/models and another new file for mentorship_relation_extension.py under api/dao. Under api/resources we also need one file for mentorship_relations.py that will takee care all the routings related to mentorship_relations be it for BIT mentorship_relation_extension table or MS mentorship_relation table.

There is a file called db_add_mock.py under app/database that can help you get an idea of how the mentorship relation is created in the database (lines 339 to 475). The attributes of the mentorship_relation and mentorship_relation_extension on that file might be slightly different since the file was created at the initial stage of GSoC to test the database design. But from there you could see how the two tables related to mentorship relation and tasks are connected. From the file you should be able to construct the needed route flows, api request/response models and the dao logics for creating the mentorship relation.

IMO at this stage the db models under database schemas should be enough to cater for the needed information so you might not need to change anything under ms_schema and bit_schema.

Let me know if you have any doubts.

mtreacy002 avatar Nov 22 '20 10:11 mtreacy002

@vj-codes , thank you again for coming to the BIT Open Session just now. As you've mentioned that you won't be available for the upcoming weeks, I'll unassign you from this issue and assign this to myself for now. Please let me know if this is as what you'd prefer.

mtreacy002 avatar Dec 13 '20 11:12 mtreacy002

Hi @mtreacy002, is this still available? :slightly_smiling_face:

NenadPantelic avatar Jan 09 '21 19:01 NenadPantelic

Hi @NenadPantelic , I was thinking on working on this myself. But if you’re interested, you can give it a try. Do you have an idea on how to approach this?

mtreacy002 avatar Jan 14 '21 06:01 mtreacy002

Hi @mtreacy002, I'm currently working on some other issues. I can ping you after I have them finished, and if the issue is still available, I can take it. What do you think?

NenadPantelic avatar Jan 15 '21 12:01 NenadPantelic

Sure, that’s sounds great πŸ‘ , @NenadPantelic

mtreacy002 avatar Jan 17 '21 21:01 mtreacy002

@mtreacy002 Currently there can be only one mentorship_relation at a time, be it mentor or mentee but this shouldn't be in the case of an organization, right? Or even an organization cannot have many mentor-mentee relations?

And is it both ways? Can the creator of the organization send a mentorship_relation request?

decon-harsh avatar Jan 31 '21 19:01 decon-harsh

@mtreacy002 I would like to work on this.

decon-harsh avatar Feb 02 '21 00:02 decon-harsh

@mtreacy002 Currently there can be only one mentorship_relation at a time, be it mentor or mentee but this shouldn't be in the case of an organization, right?

Or even an organization cannot have many mentor-mentee relations?

And is it both ways? Can the creator of the organization send a mentorship_relation request?

@decon-harsh , since the organisation actually connected to the mentor or mentee through a program, so within that program, the organisation only allowed to have one mentor and one mentee. The organisation itself can have many programs which means indirectly it is allowed to have many mentors and mentors, just not within the same program. Also, if the BIT member already blocked to work in a program (either as mentor or mentee), they are not allowed to apply to another program regardless of the organisation. Does this answer your question?

mtreacy002 avatar Feb 02 '21 04:02 mtreacy002

Can an org send request to a mentee? @mtreacy002

decon-harsh avatar Feb 02 '21 04:02 decon-harsh

Can an org send request to a mentee? @mtreacy002

Yes, the organisation through the program can send a request to the mentor or mentee, @decon-harsh

mtreacy002 avatar Feb 04 '21 04:02 mtreacy002

Would you like me to assign you to this, @decon-harsh ?

mtreacy002 avatar Feb 04 '21 04:02 mtreacy002

Yess i would love to work on this @mtreacy002

decon-harsh avatar Feb 04 '21 05:02 decon-harsh