code-corps / code-corps/code-corps-api

Add InvitedUser model, policy, and controller

Ouverte
#1,350 1 commentaire 0 réactions 1 personne assignée Réclamée par @begedin Voir sur GitHub
in progress
Langage dominant
Elixir
Étoiles
234
Forks
82
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

# Problem

We want to add an `InvitedUser` with the following attributes:

- `email` - string; required
- `role` - string; optional
- `name` - string; optional

And the following relationships:

- `invitee` - optional; eventually set to the `user` created from this invite
- `inviter` - required; the `user` who created the invite
- `project` - optional; the project the invite is for

We’ll need create, update, index and show endpoints.

If inviting to a `project`, the policy should check permissions similar to how `ProjectUser` works.

When the invite flow is complete, ie to claim an invite, we’ll need to:

- create a user
- set the `invited_user`’s `invitee_id`
- create a `project_user` for the `project` with the specified `role`

It may make sense to do this on the user create endpoint by specifying the `InvitedUser` `id` as a relationship.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.