== Writer Invites a Collaborator to a Story === Actor: **Writter** A writer invites another writer to collaborate on their story, assigning them a role and permission level within the collaboration. **1.** The writer navigates to their story management page and selects "Manage Collaborators". **2.** The system displays the current list of collaborators on the story. {{{#!sql SELECT u.username, u.user_name, u.surname, c.role, c.permission_level FROM COLLABORATION c JOIN USERS u ON c.user_id = u.user_id WHERE c.story_id = 5; }}} **3.** The writer searches for another writer by username and selects them. **4.** The writer assigns a role and permission level to the new collaborator. **5.** The system inserts the new collaborator into the COLLABORATION table, together with their assigned role and permission level. {{{#!sql INSERT INTO COLLABORATION (user_id, story_id, role, permission_level, collab_created_at) VALUES (9, 5, 'co-author', 4, CURRENT_TIMESTAMP); }}} **6.** The system sends a notification to the invited writer informing them of the collaboration. {{{#!sql INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) VALUES ('You have been invited to collaborate on "Letters from Constantinople"', 'collaboration_invite', FALSE, 9, 5, CURRENT_TIMESTAMP); }}} **7.** The system confirms the collaborator was successfully added.