| | 1 | == Writer Receives and Reviews AI Suggestions |
| | 2 | |
| | 3 | === Authors: **Writter** |
| | 4 | A writer reviews AI-generated writing suggestions for their chapter, and accepts or rejects each suggestion to improve their writing quality. |
| | 5 | |
| | 6 | **1.** The writer opens a chapter and selects "View AI Suggestions". |
| | 7 | |
| | 8 | **2.** The system retrieves all pending AI suggestions for that chapter. |
| | 9 | {{{#!sql |
| | 10 | SELECT ai.suggestion_id, ai.original_text, ai.suggested_text, st.suggestion_type, ai.accepted |
| | 11 | FROM AI_SUGGESTION ai |
| | 12 | JOIN SUGGESTION_TYPE st ON ai.suggestion_id = st.suggestion_id |
| | 13 | JOIN NEED_APPROVAL na ON ai.suggestion_id = na.suggestion_id |
| | 14 | WHERE na.chapter_id = 1 AND ai.accepted = FALSE; |
| | 15 | }}} |
| | 16 | |
| | 17 | **3.** The system displays each suggestion alongside the original text. |
| | 18 | |
| | 19 | **4.** The writer reviews a suggestion and chooses to accept it. |
| | 20 | |
| | 21 | **5.** The system updates the suggestion record as accepted and records the time it was applied. |
| | 22 | |
| | 23 | {{{#!sql |
| | 24 | UPDATE AI_SUGGESTION |
| | 25 | SET accepted = TRUE, applied_at = CURRENT_TIMESTAMP |
| | 26 | WHERE suggestion_id = 3; |
| | 27 | }}} |
| | 28 | |
| | 29 | **6.** The writer rejects another suggestion, which remains marked as not accepted. |
| | 30 | |
| | 31 | {{{#!sql |
| | 32 | UPDATE AI_SUGGESTION |
| | 33 | SET accepted = FALSE |
| | 34 | WHERE suggestion_id = 2; |
| | 35 | }}} |
| | 36 | |
| | 37 | **7.** The system confirms all reviewed suggestions and updates the chapter content accordingly. |
| | 38 | |
| | 39 | |