feat(server): implemented evaluation of lesson attendance#563
Draft
mostafakamar2308 wants to merge 1 commit intomasterfrom
Draft
feat(server): implemented evaluation of lesson attendance#563mostafakamar2308 wants to merge 1 commit intomasterfrom
mostafakamar2308 wants to merge 1 commit intomasterfrom
Conversation
6a528f5 to
970d62d
Compare
Member
|
@mostafakamar2308 please resolve the conflict and refactor the logic. |
neuodev
requested changes
Jun 4, 2025
Comment on lines
+15
to
+17
| members: (ILesson.PopuldatedMember & { | ||
| attended: boolean; | ||
| })[]; |
Member
There was a problem hiding this comment.
Defining the type this way is confusing.
| if (events && !isEmpty(events)) | ||
| builder.whereIn(this.column("type"), events); | ||
|
|
||
| const rows = await builder.orderBy("created_at", "asc").then(); |
Member
There was a problem hiding this comment.
- Don't use the column names direcly. Make use of the
this.columnutil. - Also, order by the
idas well incase two rows were created at the same time. Here is an example.
Comment on lines
+148
to
+150
| members: (PopuldatedMember & { | ||
| attended: boolean; | ||
| })[]; |
Member
There was a problem hiding this comment.
Definding the type this way is confusing.
Comment on lines
+173
to
+175
| members: (PopuldatedMember & { | ||
| attended: boolean; | ||
| })[]; |
|
|
||
| const minAttendanceMs = MIN_ATTENDANCE_REQUIRED * duration * 60 * 1000; // minimum attendance in ms | ||
|
|
||
| console.log({ minAttendanceMs, totalTime }); |
| import { evaluateAttendance } from "@/lib/lesson"; | ||
| import { ISessionEvent } from "@litespace/types"; | ||
|
|
||
| describe("evaluateAttendance", () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quality Checklist
ClickUp