Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks
mtreacy002 opened this issue Sep 29, 2020 · 27 comments · May be fixed by #185
Open
5 tasks

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

mtreacy002 opened this issue Sep 29, 2020 · 27 comments · May be fixed by #185
Assignees
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Type: Enhancement New feature or request.

Comments

@mtreacy002
Copy link
Member

mtreacy002 commented Sep 29, 2020

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 mtreacy002 added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Sep 29, 2020
@mtreacy002 mtreacy002 changed the title Feat: POST /organizations /{organization_id} /programs/{program_id} /send_request Feat: create POST /organizations /{organization_id} /programs/{program_id} /send_request Sep 29, 2020
@Sanika1999
Copy link
Contributor

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

@mtreacy002
Copy link
Member Author

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 mtreacy002 removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Sep 30, 2020
@Sanika1999
Copy link
Contributor

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

@mtreacy002
Copy link
Member Author

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

@Sanika1999
Copy link
Contributor

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

@vj-codes
Copy link
Member

I would like to work on this @mtreacy002

@mtreacy002
Copy link
Member Author

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 mtreacy002 assigned vj-codes and unassigned Sanika1999 Oct 11, 2020
@mtreacy002 mtreacy002 added hacktoberfest Type: Enhancement New feature or request. labels Oct 14, 2020
@vj-codes
Copy link
Member

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

@mtreacy002
Copy link
Member Author

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

@vj-codes
Copy link
Member

@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 .

@mtreacy002
Copy link
Member Author

mtreacy002 commented Oct 24, 2020

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 😉

@vj-codes
Copy link
Member

vj-codes commented Nov 1, 2020

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

@mtreacy002
Copy link
Member Author

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

@vj-codes
Copy link
Member

vj-codes commented Nov 4, 2020

@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?

@mtreacy002
Copy link
Member Author

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
Copy link
Member Author

mtreacy002 commented Dec 13, 2020

@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 mtreacy002 self-assigned this Dec 13, 2020
@NenadPantelic
Copy link
Contributor

Hi @mtreacy002, is this still available? 🙂

@mtreacy002
Copy link
Member Author

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?

@NenadPantelic
Copy link
Contributor

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?

@mtreacy002
Copy link
Member Author

mtreacy002 commented Jan 17, 2021

Sure, that’s sounds great 👍 , @NenadPantelic

@mtreacy002 mtreacy002 removed their assignment Jan 26, 2021
@decon-harsh
Copy link
Member

decon-harsh commented Jan 31, 2021

@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
Copy link
Member

@mtreacy002 I would like to work on this.

@mtreacy002
Copy link
Member Author

mtreacy002 commented Feb 2, 2021

@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?

@decon-harsh
Copy link
Member

decon-harsh commented Feb 2, 2021

Can an org send request to a mentee? @mtreacy002

@mtreacy002
Copy link
Member Author

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
Copy link
Member Author

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

@decon-harsh
Copy link
Member

Yess i would love to work on this @mtreacy002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Type: Enhancement New feature or request.
Projects
None yet
5 participants