Options
All
  • Public
  • Public/Protected
  • All
Menu

Module orm_functions/student

Index

Functions

  • deleteStudent(studentId: number): Promise<student & { person: person }>
  • Parameters

    • studentId: number

      the student who's info we are deleting from the student-table

    Returns Promise<student & { person: person }>

    personal info about the student, this info can be used to further remove the personal info about this student in other tables

  • deleteStudentFromDB(studentId: number): Promise<void>
  • Parameters

    • studentId: number

      the student whose info we are deleting from the database. all related records are deleted too!

    Returns Promise<void>

  • filterStudents(pagination: DBPagination, nameFilter: FilterString, emailFilter: FilterString, roleFilterArray: FilterStringArray, alumniFilter: FilterBoolean, coachFilter: FilterBoolean, statusFilter: undefined | decision_enum, osocYear: FilterNumber, emailStatusFilter: undefined | email_status_enum, nameSort: FilterSort, emailSort: FilterSort, loginUserId: number): Promise<{ data: (student & { job_application: { applied_role: (applied_role & { role: { name: string } })[]; evaluation: { decision: decision_enum }[]; student_coach: boolean }[]; person: person })[]; pagination: { count: number; page: number } }>
  • Parameters

    • pagination: DBPagination

      object representing the pagination

    • nameFilter: FilterString

      name that we are filtering on (or undefined if not filtering on name)

    • emailFilter: FilterString

      email that we are filtering on (or undefined if not filtering on email)

    • roleFilterArray: FilterStringArray

      role that we are filtering on (or undefined if not filtering on role)

    • alumniFilter: FilterBoolean

      alumni status that we are filtering on (or undefined if not filtering on alumni status)

    • coachFilter: FilterBoolean

      coach status that we are filtering on (or undefined if not filtering on coach status)

    • statusFilter: undefined | decision_enum

      decision status that we are filtering on (or undefined if not filtering on status)

    • osocYear: FilterNumber
    • emailStatusFilter: undefined | email_status_enum

      email status that we are filtering on (or undefined if not filtering on email status)

    • nameSort: FilterSort

      asc or desc if we want to sort on name, undefined if we are not sorting on name

    • emailSort: FilterSort

      asc or desc if we are sorting on email, undefined if we are not sorting on email

    • loginUserId: number

      the id of the loginUser that is searching

    Returns Promise<{ data: (student & { job_application: { applied_role: (applied_role & { role: { name: string } })[]; evaluation: { decision: decision_enum }[]; student_coach: boolean }[]; person: person })[]; pagination: { count: number; page: number } }>

    the filtered students with their person data and other filter fields in a promise

  • getAllStudents(): Promise<(student & { person: person })[]>
  • Returns Promise<(student & { person: person })[]>

    a list of all the student objects in the database together with their personal info

  • getAppliedYearsForStudent(studentId: number): Promise<number[]>
  • Parameters

    • studentId: number

    Returns Promise<number[]>

    a list of all the years the student has applied for

  • getStudent(studentId: number): Promise<null | (student & { person: person })>
  • returns:

    object with all the info about this student together with their personal info

    Parameters

    • studentId: number

    Returns Promise<null | (student & { person: person })>

  • searchStudentByGender(gender: string): Promise<(student & { person: person })[]>
  • returns:

    a list of all the person objects in the database that match

    Parameters

    • gender: string

    Returns Promise<(student & { person: person })[]>

  • updateStudent(student: UpdateStudent): Promise<student & { person: person }>

Generated using TypeDoc