Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Apply to be a mentor #35

Open
stiffneckjim opened this issue Apr 14, 2020 · 1 comment
Open

Apply to be a mentor #35

stiffneckjim opened this issue Apr 14, 2020 · 1 comment
Assignees

Comments

@stiffneckjim
Copy link

As a member of the mentorship programme
I want to register my interest in becoming a mentor
So that I can be paired with someone who wants to be mentored and share my technical knowledge

@r1903 r1903 self-assigned this Apr 24, 2020
@fourstacks
Copy link
Collaborator

Overview

Once a user has registered and is authenticated in the app, they should have the ability to submit a registration to become a mentor.

This will involve filling out a form that captures details of their background and what they are willing to offer in terms of time and skills as a mentor.

Upon submission of this form, the user should get some form of instant feedback to confirm success and their registration should be saved in pending status. CodeHub admins should receive a notification that a new registration has been submitted so that they can perform a review and approve/decline the registration as appropriate.

Technical approach

We’ll first need to create a Mentor model along with a migration (with the fields from the form).

A GET route to house the mentor profile creation form will be required. A suggested route URL is /profiles/mentor/new (so that we can also add a similar route for mentees later).

A controller method for this route will be required. As this is a route to create a resource an appropriate controller and method would be MentorProfileController@create.

This controller method will need to serve an inertia page view under Profiles/Mentor/Create.tsx. The view should house a form with the fields required. These fields should be based on those found in the existing google form (though we won’t need to capture name and email as we’ll already have these from their User model.

The form should be submitted to a POST route (we can use the same URL: /profiles/mentor/new). This should be handled by a store method in our MentorProfileController.

Our form should be backed by server validation at a minimum (front end validation is nice but not as necessary) so we should create a laravel form request class to hold this validation logic: Validation - Laravel. We’ll also need to make sure our forms can access and display these server side errors: Forms - Inertia.js.

If data is valid then our store method should then handle:

  • Creating a new Mentor model with the data from the form. This model should belongTo the User model that created it. This Mentor model should have a status field in the database. It’s probably worth using a PHP enum to handle these status. This package is great for this (also check out the blog post linked to in the readme just after the contents of what an enum is if you’re not sure): GitHub - BenSampo/laravel-enum: Simple, extensible and powerful enumeration implementation for Laravel.
  • Sending a notification to the relevant CodeHub admins to alert them that a new registration has taken place. Laravel has a really great notifications system set up which we could leverage for this: Notifications - Laravel. For example with just a few lines of code we could send notifications to a Slack channel and/or via email and/or save the notification in the database so that admins can see the notifications on screen.
  • Redirect the user to a confirmation page.

For the redirect it might be worth creating a new route and controller: /profiles and ProfilesController@index. We can direct mentees to this page when they have completed their registrations as well. The confirmation should explain the status of their profile (pending) along with the next steps and what to expect.

Things to consider

  • Which fields from the mentor registration form do we need? Which can we drop?
  • We need to consider the best way to store data from the form. For example, dates should be stored as DateTime fields rather than strings etc
  • How should admins be alerted when a registration has taken place? Do we want to give admins the opportunity to decide for themselves on notification preferences? Slack and email are obvious options - any others?

@fourstacks fourstacks self-assigned this May 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants