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

Add collaborators #264

Closed
wants to merge 10 commits into from
Closed

Add collaborators #264

wants to merge 10 commits into from

Conversation

MarioRodrigues10
Copy link
Member

No description provided.

lib/atomic/accounts/user.ex Outdated Show resolved Hide resolved
test/support/fixtures/accounts_fixtures.ex Outdated Show resolved Hide resolved

@required_fields ~w(collaborator_id department_id)a

schema "collaborator_departments" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not have a role to identify this relation, e.g.: 'President', 'Vice-President', etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about creating another schema "board_users" where i give those roles to an user

Copy link
Member Author

@MarioRodrigues10 MarioRodrigues10 Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside this schema i can create role field and give it to user , what you think?

@feliciofilipe
Copy link
Member

feliciofilipe commented Feb 19, 2023

We need to discuss this carefully before going forward

Co-authored-by: Rui Lopes <76881129+RuiL1904@users.noreply.github.com>
Copy link
Member

@ruioliveira02 ruioliveira02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As collaborators change every year you should add the year as a field IMO

create table(:collaborator_departments, primary_key: false) do
add :id, :binary_id, primary_key: true

add :collaborator_id, references(:users, on_delete: :nothing, type: :binary_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
add :collaborator_id, references(:users, on_delete: :nothing, type: :binary_id)
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)

@required_fields ~w(collaborator_id department_id)a

schema "collaborator_departments" do
belongs_to :collaborator, User
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
belongs_to :collaborator, User
belongs_to :user, User

@MarioRodrigues10
Copy link
Member Author

This was closed because it was done in #291

@ruilopesm ruilopesm deleted the mr/add-collaborators branch August 6, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants