-
Notifications
You must be signed in to change notification settings - Fork 1
feat(server): implemented evaluation of lesson attendance #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
6a528f5
to
970d62d
Compare
@mostafakamar2308 please resolve the conflict and refactor the logic. |
members: (ILesson.PopuldatedMember & { | ||
attended: boolean; | ||
})[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Don't use the column names direcly. Make use of the
this.column
util. - Also, order by the
id
as well incase two rows were created at the same time. Here is an example.
members: (PopuldatedMember & { | ||
attended: boolean; | ||
})[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definding the type this way is confusing.
members: (PopuldatedMember & { | ||
attended: boolean; | ||
})[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the type.
|
||
const minAttendanceMs = MIN_ATTENDANCE_REQUIRED * duration * 60 * 1000; // minimum attendance in ms | ||
|
||
console.log({ minAttendanceMs, totalTime }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left over.
import { evaluateAttendance } from "@/lib/lesson"; | ||
import { ISessionEvent } from "@litespace/types"; | ||
|
||
describe("evaluateAttendance", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make use of namof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/test
Quality Checklist
ClickUp