Changes between Version 2 and Version 3 of WrittersCollaboration


Ignore:
Timestamp:
08/24/26 16:08:43 (13 days ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WrittersCollaboration

    v2 v3  
    1 == Writer Invites a Collaborator to a Story
     1==  Writer Invites a Collaborator to a Story
    22
    33=== Actor: **Writter**
     4
    45A writer invites another writer to collaborate on their story, assigning them a role and permission level within the collaboration.
    56
     
    78
    89**2.** The system displays the current list of collaborators on the story.
    9 
    1010{{{#!sql
    11 SELECT u.username, u.name, u.surname, r.roles, p.permission_level
     11SELECT u.username, u.user_name, u.surname, c.role, c.permission_level
    1212FROM COLLABORATION c
    1313JOIN USERS u ON c.user_id = u.user_id
    14 JOIN ROLES r ON c.user_id = r.user_id AND c.story_id = r.story_id
    15 JOIN PERMISSION_LEVEL p ON c.user_id = p.user_id AND c.story_id = p.story_id
    1614WHERE c.story_id = 5;
    1715}}}
     
    2119**4.** The writer assigns a role and permission level to the new collaborator.
    2220
    23 **5.**  TThe system inserts the new collaborator into the COLLABORATION table.
    24 
     21**5.** The system inserts the new collaborator into the COLLABORATION table, together with their assigned role and permission level.
    2522{{{#!sql
    26 INSERT INTO COLLABORATION (user_id, story_id, created_at)
    27 VALUES (9, 5, CURRENT_TIMESTAMP);
     23INSERT INTO COLLABORATION (user_id, story_id, role, permission_level, collab_created_at)
     24VALUES (9, 5, 'co-author', 4, CURRENT_TIMESTAMP);
     25}}}
     26**6.** The system sends a notification to the invited writer informing them of the collaboration.
     27{{{#!sql
     28INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
     29VALUES ('You have been invited to collaborate on "Letters from Constantinople"', 'collaboration_invite', FALSE, 9, 5, CURRENT_TIMESTAMP);
    2830}}}
    2931
    30 **6.** The system assigns the role to the collaborator.
    31 
    32 {{{#!sql
    33 INSERT INTO ROLES (user_id, story_id, roles)
    34 VALUES (9, 5, 'co-author');
    35 }}}
    36 
    37 **7.** The system assigns the permission level to the collaborator.
    38 
    39 {{{#!sql
    40 INSERT INTO PERMISSION_LEVEL (user_id, story_id, permission_level)
    41 VALUES (9, 5, 4);
    42 }}}
    43 
    44 **8.**The system sends a notification to the invited writer informing them of the collaboration.
    45 {{{#!sql
    46 INSERT INTO NOTIFICATION (content, is_read, created_at)
    47 VALUES ('You have been invited to collaborate on "Letters from Constantinople"', FALSE, CURRENT_TIMESTAMP);
    48 }}}
    49 **9.** The system confirms the collaborator was successfully added.
    50 
     32**7.** The system confirms the collaborator was successfully added.