Changes between Version 2 and Version 3 of WriterViewsStoryCollaborationDetails


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

--

Legend:

Unmodified
Added
Removed
Modified
  • WriterViewsStoryCollaborationDetails

    v2 v3  
    22
    33=== Actor: **Writer**
     4
    45A writer views all current collaborators on their story, including their roles and permission levels, and can manage the collaboration.
    56
     
    89**2.** The system retrieves all collaborators and their details for the story.
    910{{{#!sql
    10 SELECT u.username, u.name, u.surname, r.roles, p.permission_level, c.created_at
     11SELECT u.username, u.user_name, u.surname, c.role, c.permission_level, c.collab_created_at
    1112FROM COLLABORATION c
    1213JOIN USERS u ON c.user_id = u.user_id
    13 JOIN ROLES r ON c.user_id = r.user_id AND c.story_id = r.story_id
    14 JOIN PERMISSION_LEVEL p ON c.user_id = p.user_id AND c.story_id = p.story_id
    1514WHERE c.story_id = 5
    16 ORDER BY p.permission_level DESC;
     15ORDER BY c.permission_level DESC;
    1716}}}
    1817
    1918**3.** The writer decides to update a collaborator's permission level.
    2019{{{#!sql
    21 UPDATE PERMISSION_LEVEL
     20UPDATE COLLABORATION
    2221SET permission_level = 3
    2322WHERE user_id = 9 AND story_id = 5;
     
    3029}}}
    3130
    32 **5.** The system confirms the changes and the ROLES and PERMISSION_LEVEL records are automatically removed via CASCADE.
     31**5.** The system confirms the collaborator was removed.
    3332
    3433**6.** The system sends a notification to the removed collaborator.
    3534{{{#!sql
    36 INSERT INTO NOTIFICATION (content, is_read, created_at)
    37 VALUES ('You have been removed as a collaborator from "Letters from Constantinople"', FALSE, CURRENT_TIMESTAMP);
     35INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at)
     36VALUES ('You have been removed as a collaborator from "Letters from Constantinople"', 'collaboration_removed', FALSE, 9, 5, CURRENT_TIMESTAMP);
    3837}}}
    39 }}}