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

Invitation #135

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Invitation #135

wants to merge 21 commits into from

Conversation

RomainGuarinoni
Copy link
Collaborator

@RomainGuarinoni RomainGuarinoni commented Mar 25, 2022

New invitations system

2 types of invitations

  • MusicianToGroup : When a musician want to join a group and send an invite to the group
  • GroupToMusician : When a group want a musician as a new member and send an invitation to the musician

Schemas

MusicianToGroup

        id: { type: 'string' },
        type: { type: 'string', enum: ['musicianToGroup', 'groupToMusician'] },
        musician: { $ref: '#/components/schemas/musicianMinimized' },
        instruments: {
          type: 'array',
          items: { $ref: '#/components/schemas/instrument' },
        },
        description: { type: 'string', nullable: true },

GroupToMusician

        id: { type: 'string' },
        type: { type: 'string', enum: ['musicianToGroup', 'groupToMusician'] },
        group: { $ref: '#/components/schemas/groupDescription' },
        invitor: { $ref: '#/components/schemas/musicianMinimized' },
        instruments: {
          type: 'array',
          items: { $ref: '#/components/schemas/instrument' },
        },
        description: { type: 'string', nullable: true },

The invitor is the musician that send an invite to another musician to join the group

Routes for groups

All these routes can be accessed by all the member of the group. Event a member can send, accept or decline an invitation.

GET /groups/{groupId}/invitations/received

Return all the invitation received by the groups

GET /groups/{groupId}/invitations/sent

Return all the invitations sent by the group

POST /groups/{groupId}/invitations

Send a new invitation to a musician. If the invitation already exist, it will updated it if needed

DELETE /groups/{groupId}/invitations/{invitationId}

Delete an invitation that the group have sent to a musician

POST /groups/{groupId}/invitations/{invitationId}/accept

Accept an invitation received by the group

DELETE /groups/{groupId}/invitations/{invitationId}/decline

Decline an invitation received by the group

Routes for profil

GET /profil/invitations/received

Return all the invitation received by the logged musician

GET /profil/invitations/sent

Return all the invitations sent by the logged musician

POST /profil/invitations

Send a new invitation to a group. If the invitation already exist, it will updated it if needed

DELETE /profil/invitations/{invitationId}

Delete an invitation that the logged musician have sent to a musician

POST /profil/invitations/{invitationId}/accept

Accept an invitation received by the logged musician

DELETE /profil/invitations/{invitationId}/decline

Decline an invitation received by the logged musician

New notifications

  • GroupReceiveInvitationNotification
  • MusicianJoinedGroupNotification
  • GroupDeclineInvitationNotification
  • MusicianDeclineInvitationNotification

Memberships

Now, membership can either be admin, lite_admin or member. There is no pending or declined anymore

@RomainGuarinoni RomainGuarinoni linked an issue Mar 25, 2022 that may be closed by this pull request
19 tasks
@RomainGuarinoni RomainGuarinoni self-assigned this Mar 28, 2022
@RomainGuarinoni RomainGuarinoni added enhancement New feature or request Long issue Need a lot of times to implement labels Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Long issue Need a lot of times to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change group invitation
1 participant