Changes between Version 2 and Version 3 of WriterViewsStoryCollaborationDetails
- Timestamp:
- 08/24/26 16:13:17 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WriterViewsStoryCollaborationDetails
v2 v3 2 2 3 3 === Actor: **Writer** 4 4 5 A writer views all current collaborators on their story, including their roles and permission levels, and can manage the collaboration. 5 6 … … 8 9 **2.** The system retrieves all collaborators and their details for the story. 9 10 {{{#!sql 10 SELECT u.username, u. name, u.surname, r.roles, p.permission_level, c.created_at11 SELECT u.username, u.user_name, u.surname, c.role, c.permission_level, c.collab_created_at 11 12 FROM COLLABORATION c 12 13 JOIN 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_id14 JOIN PERMISSION_LEVEL p ON c.user_id = p.user_id AND c.story_id = p.story_id15 14 WHERE c.story_id = 5 16 ORDER BY p.permission_level DESC;15 ORDER BY c.permission_level DESC; 17 16 }}} 18 17 19 18 **3.** The writer decides to update a collaborator's permission level. 20 19 {{{#!sql 21 UPDATE PERMISSION_LEVEL20 UPDATE COLLABORATION 22 21 SET permission_level = 3 23 22 WHERE user_id = 9 AND story_id = 5; … … 30 29 }}} 31 30 32 **5.** The system confirms the c hanges and the ROLES and PERMISSION_LEVEL records are automatically removed via CASCADE.31 **5.** The system confirms the collaborator was removed. 33 32 34 33 **6.** The system sends a notification to the removed collaborator. 35 34 {{{#!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);35 INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) 36 VALUES ('You have been removed as a collaborator from "Letters from Constantinople"', 'collaboration_removed', FALSE, 9, 5, CURRENT_TIMESTAMP); 38 37 }}} 39 }}}
