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

Add InvitedUser model, policy, and controller

オープン
#1,350 コメント 1 件 リアクション 0 件 担当者 1 名 @begedin が担当を希望しています GitHub で見る
in progress
主要言語
Elixir
スター
234
フォーク
82
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。