services/student

Service to create, update, and retrieve student information.

Methods

(static) delete(studentId) → {Promise.<boolean>}

Delete student with the provided ID.
Source:
Parameters:
Name Type Description
studentId * The ID of the student to delete.
Throws:
- If the operation fails or encounters an error.
Type
Error
Returns:
Type:
Promise.<boolean>
- A promise that resolves once the student has been successfully deleted.

(static) getAll(offset, limit) → {Promise.<{students: Array.<StudentDTO>, count: number}>}

Retrieve a paginated list of students.
Source:
Parameters:
Name Type Description
offset number The number of items to skip before starting to return results.
limit number The maximum number of items to return.
Throws:
- If the operation fails or encounters an error.
Type
Error
Returns:
Type:
Promise.<{students: Array.<StudentDTO>, count: number}>
- A promise that resolves to an object containing an array of TeacherDTO objects representing the teachers and the total count of teachers.

(static) getById(studentId) → {Promise.<(TeacherDTO|null)>}

Retrieve student details.
Source:
Parameters:
Name Type Description
studentId * The ID of the student to retrieve.
Throws:
- If the operation fails or encounters an error.
Type
Error
Returns:
Type:
Promise.<(TeacherDTO|null)>
- A promise that resolves to a StudentDTO object representing the student if found, or null if not found.

(static) search(terms-) → {Promise.<Array.<StudentDTO>>}

Search for students based on the provided search terms.
Source:
Parameters:
Name Type Description
terms- * The search terms to match against student first names, last names.
Throws:
- If the operation fails or encounters an error.
Type
Error
Returns:
Type:
Promise.<Array.<StudentDTO>>
A promise that resolves to an array of Student objects matching the search terms.