Skip to content

Refactor course to course data#1721

Open
AngelsandDevsLOL wants to merge 3 commits into
Courseography:masterfrom
AngelsandDevsLOL:refactor-course-to-courseData
Open

Refactor course to course data#1721
AngelsandDevsLOL wants to merge 3 commits into
Courseography:masterfrom
AngelsandDevsLOL:refactor-course-to-courseData

Conversation

@AngelsandDevsLOL
Copy link
Copy Markdown
Contributor

@AngelsandDevsLOL AngelsandDevsLOL commented Jun 3, 2026

Proposed Changes

This PR moves the existing Course data type in Database/Tables.hs to Models/Course.hs, and renames it to CourseData. This data type is used to return course data from the back-end to the front-end. It is separate from Courses in Database/Tables.hs, which is used for internal back-end use.

Methods in Models/Course.hs is updated to use CourseData instead of Course. The import, import Database.Tables hiding (breadth, distribution) is changed to just import Database.Tables since the breadth and distribution for the Course data type is no longer there. The parameters for insertCourse is also adjusted accordingly.

Screenshots of your changes (if applicable)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality) X
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.
  • I have updated the project Changelog (this is required for all changes).

After opening your pull request:

  • I have verified that the CircleCI checks have passed.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 23

Coverage remained the same at 58.609%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 13 uncovered changes across 1 file (1 of 14 lines covered, 7.14%).
  • 14 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
app/Models/Course.hs 14 1 7.14%

Coverage Regressions

14 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
app/Models/Course.hs 10 53.95%
app/Database/Tables.hs 4 76.0%

Coverage Stats

Coverage Status
Relevant Lines: 3938
Covered Lines: 2370
Line Coverage: 60.18%
Relevant Branches: 964
Covered Branches: 503
Branch Coverage: 52.18%
Branches in Coverage %: Yes
Coverage Strength: 164.61 hits per line

💛 - Coveralls

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.

2 participants