AttendanceController interface represents the structure of the attendance controller.

This interface provides the following methods:

insertIntoAttendance - Inserts a new attendance record.

checkAndInsertStatusNotPresentAttendance - Checks and inserts attendance records for students not present.

getLecturesAndAttendancesByCourseId - Gets lectures and attendances by course ID.

updateAttendanceStatus - Updates the attendance status.

deleteAttendance - Deletes an attendance record.

markStudentAsNotPresentInPastLectures - Marks late enrolling students as not present in past lectures.

interface AttendanceController {
    checkAndInsertStatusNotPresentAttendance: (
        date: string,
        studentnumbers: string[],
        lectureid: string,
    ) => Promise<unknown>;
    deleteAttendance: (
        studentnumber: string,
        lectureid: string,
    ) => Promise<unknown>;
    getLecturesAndAttendancesByCourseId: (courseid: string) => Promise<unknown>;
    insertIntoAttendance: (
        status: string,
        date: string,
        studentnumber: string,
        lectureid: string,
    ) => Promise<unknown>;
    markStudentAsNotPresentInPastLectures: (
        studentnumber: string | number,
        courseid: number,
    ) => Promise<void>;
    updateAttendanceStatus: (
        attendanceid: number,
        status: number,
    ) => Promise<unknown>;
}

Properties

checkAndInsertStatusNotPresentAttendance: (
    date: string,
    studentnumbers: string[],
    lectureid: string,
) => Promise<unknown>

Checks and inserts attendance records for students not present.

Type declaration

    • (date: string, studentnumbers: string[], lectureid: string): Promise<unknown>
    • Parameters

      • date: string

        The date of the lecture.

      • studentnumbers: string[]

        The student numbers.

      • lectureid: string

        The lecture ID.

      Returns Promise<unknown>

      A promise that resolves when the attendance records have been inserted.

deleteAttendance: (studentnumber: string, lectureid: string) => Promise<unknown>

Deletes an attendance record.

Type declaration

    • (studentnumber: string, lectureid: string): Promise<unknown>
    • Parameters

      • studentnumber: string

        The student number.

      • lectureid: string

        The lecture ID.

      Returns Promise<unknown>

      A promise that resolves when the attendance record has been deleted.

getLecturesAndAttendancesByCourseId: (courseid: string) => Promise<unknown>

Gets lectures and attendances by course ID.

Type declaration

    • (courseid: string): Promise<unknown>
    • Parameters

      • courseid: string

        The course ID.

      Returns Promise<unknown>

      A promise that resolves to the lectures and attendances.

insertIntoAttendance: (
    status: string,
    date: string,
    studentnumber: string,
    lectureid: string,
) => Promise<unknown>

Inserts a new attendance record.

Type declaration

    • (
          status: string,
          date: string,
          studentnumber: string,
          lectureid: string,
      ): Promise<unknown>
    • Parameters

      • status: string

        The attendance status.

      • date: string

        The date of the lecture.

      • studentnumber: string

        The student number.

      • lectureid: string

        The lecture ID.

      Returns Promise<unknown>

      A promise that resolves when the attendance record has been inserted.

markStudentAsNotPresentInPastLectures: (
    studentnumber: string | number,
    courseid: number,
) => Promise<void>

Marks late enrolling students as not present in past lectures.

Type declaration

    • (studentnumber: string | number, courseid: number): Promise<void>
    • Parameters

      • studentnumber: string | number

        The student number.

      • courseid: number

        The course ID.

      Returns Promise<void>

      A promise that resolves when the student is marked as not present in past lectures.

updateAttendanceStatus: (
    attendanceid: number,
    status: number,
) => Promise<unknown>

Updates the attendance status.

Type declaration

    • (attendanceid: number, status: number): Promise<unknown>
    • Parameters

      • attendanceid: number

        The attendance ID.

      • status: number

        The new attendance status.

      Returns Promise<unknown>

      A promise that resolves when the attendance status has been updated.