AttendanceRepository provides logic for storing and retrieving session interest in the database.

const postgres: PostgresService

const attendanceRepo = new AttendanceRepository({
postgres,
})

Hierarchy

  • AttendanceRepository

Constructors

Methods

  • attend marks an attendee as interested in a session from the attendee and session's ids. The attendee's id is most likely to come from an AuthToken's sub property.

    await attendanceRepo.attend(5, 'session-a')
    

    Parameters

    • attendee: number
    • session: string

    Returns Promise<void>

  • getSessionAttendance create a map of session id to the number of attendees interested in that session.

    const sessionAttendance = await attendanceRepo.getSessionAttendance()

    sessionAttendance.get('session-a') // 5

    Returns Promise<Map<string, number>>

  • getUserAttendance gets a list of the Attendance records that an attendee has created.

    const userAttendance = await attendanceRepo.getUserAttendance()
    

    Parameters

    • attendee: number

    Returns Promise<Attendance[]>

  • unattend is the opposite of attend, it removes any interest records for an attendee and a given session.

    await attendanceRepo.unattend(5, 'session-a')
    

    Parameters

    • attendee: number
    • session: string

    Returns Promise<void>

Generated using TypeDoc