<aside>

</aside>

Persistence Model

Table video_progresses [note: 'Theo dõi trạng thái xem video của learner'] 
{
  user_id           uuid                       [ref: > users.id, note: 'Học viên xem video']  
  lesson_id         uuid                       [ref: > video_lessons.lesson_id, note: 'Lesson video']  
  watched_sec       int                        [default: 0, note: 'Số giây đã xem']  
  completed         bool                       [default: false, note: 'Xem ≥ 95% ?']  
  completed_at      timestamp                  [note: 'Thời điểm hoàn thành video']
  updated_at        timestamp
  
  indexes { (user_id, lesson_id) [pk] }  
}
Table video_notes [note: 'Ghi chú thời điểm cụ thể trong video của learner'] 
{
  id                  uuid                          [pk, note: 'ID note video']  
  user_id             uuid                          [ref: > users.id, note: 'Học viên ghi chú']  
  lesson_id           uuid                          [ref: > video_lessons.lesson_id, note: 'Lesson video']  
  timestamp_sec       int                           [note: 'Thời điểm trong video (giây)']  
  content             text                          [not null, note: 'Nội dung ghi chú']  
  created_at          timestamp                     [default: `now()`]  
  updated_at          timestamp                     [default: `now()`]  
  deleted_at          timestamp                     [null]  
}

Domain Use Cases

Complete Video Lesson Command

Reset Video Progress Command

Get Video Progress Query

Add Video Note Command

Update Video Note Command

Remove Video Note Command

List Video Notes By Lesson Query


TODO USE CASE

(TODO) List Video Progresses By User Query

(TODO) List Video Notes By User Query

(TODO) Start Video Command

(TODO) Update Video Progress Command

(TODO) List Video Progresses By Lesson Query