Skip to content

Commit 7ba2e37

Browse files
Merge pull request #347 from tcet-opensource/260-create-apidoc-for-practical
[Added] apidoc for practical model
2 parents 1213e8e + 4e06155 commit 7ba2e37

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

_apidoc.js

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,105 @@
666666
* attainment as per Bloom's Taxanomy (L1-L6).
667667
*/
668668

669+
// ------------------------------------------------------------------------------------------
670+
// Practical.
671+
// ------------------------------------------------------------------------------------------
672+
673+
/**
674+
* @api {post} /practical/create Create Practical
675+
* @apiName CreatePractical
676+
* @apiGroup Practical
677+
*
678+
* @apiBody {Number} no Practical number.
679+
* @apiBody {String} title Title of the practical.
680+
* @apiBody {String} type Type of the practical.
681+
* @apiBody {Number} hours Number of hours required.
682+
* @apiBody {String[]} cognitiveLevels Array of cognitive levels (L1-L6).
683+
*
684+
* @apiSuccess {Object} res The created Practical entity.
685+
* @apiSuccess {String} res._id ID of the created entity.
686+
* @apiSuccess {Number} res.no Practical number.
687+
* @apiSuccess {String} res.title Title of the practical.
688+
* @apiSuccess {String} res.type Type of the practical.
689+
* @apiSuccess {Number} res.hours Number of hours required.
690+
* @apiSuccess {String[]} res.cognitiveLevels Array of cognitive levels (L1-L6).
691+
*/
692+
693+
/**
694+
* @api {get} /practical/list List Practical
695+
* @apiName ListPractical
696+
* @apiGroup Practical
697+
*
698+
* @apiQuery {Number} [no] Filter by Practical number.
699+
* @apiQuery {String} [title] Filter by title.
700+
* @apiQuery {String} [type] Filter by type.
701+
* @apiQuery {Number} [hours] Filter by hours.
702+
* @apiQuery {String[]} [cognitiveLevels] Filter by cognitive levels (L1-L6).
703+
*
704+
* @apiSuccess {Object[]} res List of Practical entities.
705+
* @apiSuccess {String} res._id ID of the Practical entity.
706+
* @apiSuccess {Number} res.no Practical number.
707+
* @apiSuccess {String} res.title Title of the Practical.
708+
* @apiSuccess {String} res.type Type of the Practical.
709+
* @apiSuccess {Number} res.hours Number of hours required.
710+
* @apiSuccess {String[]} res.cognitiveLevels Array of cognitive levels (L1-L6).
711+
*/
712+
713+
/**
714+
* @api {post} /practical/update/:id Update Practical
715+
* @apiName UpdatePractical
716+
* @apiGroup Practical
717+
*
718+
* @apiBody {String} id ID of the Practical entity to update.
719+
* @apiBody {Number} [no] New Practical number.
720+
* @apiBody {String} [title] New title.
721+
* @apiBody {String} [type] New type.
722+
* @apiBody {Number} [hours] New hours.
723+
* @apiBody {String[]} [cognitiveLevels] New cognitive levels (L1-L6).
724+
*
725+
* @apiSuccess {Object} res The updated Practical entity.
726+
* @apiSuccess {String} res._id ID of the updated entity.
727+
* @apiSuccess {Number} res.no Updated Practical number.
728+
* @apiSuccess {String} res.title Updated title.
729+
* @apiSuccess {String} res.type Updated type.
730+
* @apiSuccess {Number} res.hours Updated hours.
731+
* @apiSuccess {String[]} res.cognitiveLevels Updated cognitive levels (L1-L6).
732+
*/
733+
734+
/**
735+
* @api {delete} /practical/delete/:id Delete Practical
736+
* @apiName DeletePractical
737+
* @apiGroup Practical
738+
*
739+
* @apiParam {String} id ID of the Practical entity to delete.
740+
*
741+
* @apiSuccess {String} res Success message indicating the entity is deleted.
742+
*/
743+
744+
/**
745+
* @api {error} 500 Internal Server Error
746+
* @apiName InternalServerError
747+
* @apiGroup Errors
748+
*
749+
* @apiError (Error 500) {String} err Error message for internal server errors.
750+
*/
751+
752+
/**
753+
* @api {error} 404 Not Found
754+
* @apiName NotFoundError
755+
* @apiGroup Errors
756+
*
757+
* @apiError (Error 404) {String} err Error message for resource not found.
758+
*/
759+
760+
/**
761+
* @api {error} 400 Bad Request
762+
* @apiName BadRequestError
763+
* @apiGroup Errors
764+
*
765+
* @apiError (Error 400) {String} err Error message for bad requests.
766+
*/
767+
669768
// ------------------------------------------------------------------------------------------
670769
// Group.
671770
// ------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)