feat: add collaborative document functionality for lessons

- Create migration scripts for lesson_collaborative_docs table in both cms-service and lms-service.
- Implement CollaborativeDocEditor component for real-time editing of collaborative documents.
- Add LessonCollaborativeDocPage for instructors to view and manage collaborative documents.
- Include conflict resolution handling in the editor.
- Enhance UI with status indicators and formatting options for the document editor.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-27 14:47:41 -04:00
parent 7de24469a3
commit 12d704a139
14 changed files with 1070 additions and 25 deletions
@@ -0,0 +1,15 @@
-- Fase 40: Documentos Colaborativos (cms-service mirror)
CREATE TABLE IF NOT EXISTS lesson_collaborative_docs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
lesson_id UUID NOT NULL,
organization_id UUID NOT NULL,
course_id UUID NOT NULL,
content TEXT NOT NULL DEFAULT '',
revision BIGINT NOT NULL DEFAULT 0,
last_modified_by UUID,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_collab_docs_lesson
ON lesson_collaborative_docs (lesson_id, organization_id);