Skip to content

feat: add grading type#881

Draft
narumedsr-p wants to merge 1 commit intomvp1-devfrom
mvp1-dev-grading-type
Draft

feat: add grading type#881
narumedsr-p wants to merge 1 commit intomvp1-devfrom
mvp1-dev-grading-type

Conversation

@narumedsr-p
Copy link

Why did you create this PR

  • Add GradingType to CourseInfo

Note: To ensure CourseInfo updates correctly per Semester, AcademicYear, and StudyProgram, some attribute need to be modified. Since these changes will directly impact the Course API, I haven't implemented them yet and left some comment in the schema for now.

@changeset-bot
Copy link

changeset-bot bot commented Jan 24, 2026

⚠️ No Changeset found

Latest commit: 7ecac52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

# turbo
.turbo

backend/* No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

There's no backend folder

Comment on lines 64 to 66
department: data.department || "",
credit: new Prisma.Decimal(data.credit),
creditHours: data.creditHours || "",
Copy link
Member

Choose a reason for hiding this comment

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

Do not use empty string as a empty value. Use NULL instead.

"Empty string" means "The string that have length 0" while "null" means "really nothing" data type

Comment on lines 236 to 238
const sortedItems = [...items].sort(
(a, b) => (a.cartOrder ?? 0) - (b.cartOrder ?? 0)
(a, b) => (a.cartOrder ?? 0) - (b.cartOrder ?? 0),
);
Copy link
Member

Choose a reason for hiding this comment

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

sorting should be Database task. Not service

Comment on lines +67 to +73
gradingType:
data.creditHours && data.creditHours.includes("S/U")
? GradingType.SU
: GradingType.LETTER,
academicYear: parseInt(data.academicYear),
semester: mapSemester(data.semester),
studyProgram: mapStudyProgram(data.studyProgram),
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you have to map semester and study program. Just generated enum as a controller's input

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants