Service to create, update, and retrieve course dates information, including
date, course, trainer, students, attendances.
- Source:
Methods
(static) create(courseDateToAdd) → {Promise.<(CourseDateDTO|null)>}
Create course-date with the provided data.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
courseDateToAdd |
*
|
The course-date data to be added. |
Throws:
-
- If the operation fails or encounters an error.
- Type
-
Error
Returns:
- Type:
-
Promise.<(CourseDateDTO|null)>
A promise that resolves to a new CourseDateDTO instance representing the created course-date, or null if creation fails.
(static) delete(id) → {Promise.<boolean>}
Deletes course-date with the provided ID.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
*
|
The ID of the course-date to delete. |
Throws:
-
- If the operation fails or encounters an error.
- Type
-
Error
Returns:
- Type:
-
Promise.<boolean>
- A promise that resolves to true if the course-date was successfully deleted, or false otherwise.
(static) getById(id) → {Promise.<(CourseDateDTO|null)>}
Retrieve course-date details with the provided ID.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
*
|
The ID of the course-date to retrieve. |
Throws:
-
- If the operation fails or encounters an error.
- Type
-
Error
Returns:
- Type:
-
Promise.<(CourseDateDTO|null)>
A promise that resolves to a CourseDateDTO instance representing the retrieved course, or null if the course is not found.
(static) search(offset, limit) → {Promise.<Array.<CourseDateDTO>>}
Search for course-dates based on the provided search terms.
- 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.<Array.<CourseDateDTO>>
A promise that resolves to an array of CourseDateDTO objects matching the search terms.
(static) update(id, updateCourseDate) → {Promise.<boolean>}
Update course-date with the provided data.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
*
|
The ID of the course-date to update. |
updateCourseDate |
*
|
The updated data for the course-date. |
Throws:
-
- If the operation fails or encounters an error.
- Type
-
Error
Returns:
- Type:
-
Promise.<boolean>
- A promise that resolves to true if the course-date was successfully updated, or false otherwise.