Skip to content

refactor(core): flatten DTO hierarchy to align with flat backend API#52

Open
syed-tp wants to merge 2 commits intoref/dio-singletonfrom
dto-hierarchy-flattening
Open

refactor(core): flatten DTO hierarchy to align with flat backend API#52
syed-tp wants to merge 2 commits intoref/dio-singletonfrom
dto-hierarchy-flattening

Conversation

@syed-tp
Copy link
Copy Markdown
Collaborator

@syed-tp syed-tp commented Mar 31, 2026

  • The nested DTO structure created an architectural "trap" by implying hierarchical data where none exists at the source. Since the backend API and local database are strictly flat, keeping nested collections (chapters/lessons) led to inconsistent state and potential null pointer bugs if the nesting wasn't manually populated.
  • This refactor enforces the Single Source of Truth by requiring independent, ID-based fetching through repository streams, which results in more predictable data flow across the UI.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements DTO hierarchy flattening by removing nested collections from CourseDto and ChapterDto, aligning the models with the flat backend API and local database. The changes include updating serialization logic, refactoring Riverpod providers to fetch related data independently, and adjusting UI screens to handle separate data streams. Feedback identifies an N+1 network request bottleneck in lesson fetching, non-reactive provider implementations using one-time stream reads, and potential UI flickering during loading states.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e57026c9dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant