-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
_apidoc.js
1885 lines (1769 loc) · 71.5 KB
/
_apidoc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ------------------------------------------------------------------------------------------
// General apiDoc documentation blocks and old history blocks.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Success.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Errors.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Permissions.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// History.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Index.
// ------------------------------------------------------------------------------------------
/**
* @api {get} / Retrieve Home Information
* @apiName GetIndex
* @apiGroup Index
*
* @apiSuccess {String} res server working.
*/
// ------------------------------------------------------------------------------------------
// User.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /add Add new User
* @apiName AddUser
* @apiGroup User
*
* @apiBody {String} name Name and surname of user
* @apiBody {String} password Password of the user
* @apiBody {String} emailId EmailID of the user. It would be the college assosiated emailID
* @apiBody {String} uid This will be their ERPID
* @apiBody {String="Student", "Faculty"} userType This will be type of user.
* currently we support only 2
*
* @apiSuccess {String} res returns success message "added user with \<ID\>".
*
* @apiError (Error 500) err Error while inserting in Database.
*/
// ------------------------------------------------------------------------------------------
// Auth.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /auth Login User
* @apiName LoginUser
* @apiGroup Authentication
*
* @apiBody {String} id User ID.
* @apiBody {String} password User password.
*
* @apiSuccess {String} res Response message.
* @apiSuccess {Object} user User details.
* @apiSuccess {String} user.uid User ID.
* @apiSuccess {String} user.name User name.
* @apiSuccess {String} user.emailId User email ID.
* @apiSuccess {String} user.type User type.
* @apiSuccess {String} user.token User token.
*
* @apiSuccessExample Success Response:
* HTTP/1.1 200 OK
* {
* "res": "welcome",
* "user": {
* "uid": "123",
* "name": "Some User",
* "emailId": "[email protected]",
* "type": "user",
* "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
* }
* }
*
* @apiError (Error 403) UserDoesNotExist Incorrect ID or password.
* @apiError (Error 500) ServerError Something is wrong on our side. Try again.
*/
/**
* @api {post} /auth/validateUser Validate User
* @apiName ValidateUser
* @apiGroup Authentication
* @apiDescription Validates the user's authentication token.
*
* @apiHeader {String} Authorization User's authentication token.
*
* @apiSuccess {Object} res User object.
* @apiSuccess {Object} res.user User details.
* @apiSuccess {String} res.user.uid User ID.
* @apiSuccess {String} res.user.name User name.
* @apiSuccess {String} res.user.emailId User email ID.
* @apiSuccess {String} res.user.type User type.
*
* @apiSuccessExample Success Response:
* HTTP/1.1 200 OK
* {
* "res": {
* "user": {
* "uid": "123",
* "name": "Some User",
* "emailId": "[email protected]",
* "type": "user"
* },
* "msg": "user validated",
* "err": null
* }
* }
*/
/**
* @api {post} /auth/sendOTP Send OTP
* @apiName SendOTP
* @apiGroup Authentication
* @apiDescription Sends an OTP (One-Time Password) to the user's email ID.
*
* @apiBody {String} uid User ID.
* @apiBody {String} emailId User email ID.
*
* @apiSuccess {String} res Response message.
*
* @apiSuccessExample Success Response:
* HTTP/1.1 200 OK
* {
* "res": "otp sent to emailID"
* }
*
* @apiError (Error) IncorrectUidOrEmail Incorrect UID or emailId.
*/
/**
* @api {post} /auth/resetPassword Reset Password
* @apiName ResetPassword
* @apiGroup Authentication
* @apiDescription Resets the user's password using the provided OTP (One-Time Password).
*
* @apiBody {String} uid User ID.
* @apiBody {String} otp One-Time Password received by the user.
* @apiBody {String} password New password.
*
* @apiSuccess {String} res Response message.
*
* @apiSuccessExample Success Response:
* HTTP/1.1 200 OK
* {
* "res": "successfully updated password"
* }
*
* @apiError (Error) IncorrectOtp Incorrect OTP.
* @apiError (Error 500) UpdateError Something went wrong while updating password.
* @apiError (Error 500) ServerError Something went wrong.
*/
// ------------------------------------------------------------------------------------------
// Infrastructure.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /infrastructure/add Add Infrastructure
* @apiName AddInfrastructure
* @apiGroup Infrastructure
*
* @apiBody {String} name The name of the infrastructure.
* @apiBody {String} type The type of the infrastructure.
* @apiBody {String} wing The wing where the infrastructure is located.
* @apiBody {Number} floor The floor where the infrastructure is located.
* @apiBody {Number} capacity The capacity of the infrastructure.
* @apiBody {connector.Schema.Types.ObjectId} organization The organization which is associated.
*
* @apiSuccess {String} res Success message with the ID of the added infrastructure.
*
* @apiError (Error 500) DatabaseError Error while inserting in the database.
*
* @apiDescription Adds a new infrastructure to the system.
*/
/**
* @api {get} infrastructure/list Get Infrastructure List
* @apiName GetInfrastructure
* @apiGroup Infrastructure
*
* @apiQuery {String} [name] Name of Infrastructure .
* @apiQuery {String} [type] Type of Infrastructure. One of possible Lab, Classroom.
* @apiQuery {String} [wing] Wing of Infrastructure. One of possible A,B,C.
* @apiQuery {Number} [floor] Floor of Infrastructure.
* @apiQuery {Number} [capacity] Capacity of Infrastructure.
*
* @apiSuccess {Infrastructure[]} res Array of Filtered Infrastructure Doc .
* @apiSuccess {String} infrastructure._id ID of document given by database.
* @apiSuccess {String} infrastructure.name Name of Infrastructure
* @apiSuccess {String} infrastructure.type Type of Infrastructure. One of possible Lab, Classroom.
* @apiSuccess {String} infrastructure.wing Wing of Infrastructure. One of possible A,B,C.
* @apiSuccess {Number} infrastructure.floor Floor of Infrastructure.
* @apiSuccess {Number} infrastructure.capacity Capacity of Infrastructure.
* @apiSuccess {connector.Schema.Types.ObjectId} department.organization associated Organization.
*/
/**
* @api {delete} /infrastructure/delete/:infrastructureId Delete Infrastructure
* @apiName DeleteInfrastructure
* @apiGroup Infrastructure
*
* @apiParam {String} infrastructureId The ID of the infrastructure document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) err Error message if there was an error during the deletion.
*
* */
/**
* @api {post} /infrastructure/update/:id Update infrastructure details
* @apiName UpdateInfrastructure
* @apiGroup Infrastructure
* @apiDescription update Existing Infrastructure details
*
* @apiParam {String} id The infrastructure document to update.
* @apiBody {String} id Id of the infrastructure to be updated
* @apiBody {String} [name] The name of the infrastructure.
* @apiBody {String} [type] The type of the infrastructure.
* @apiBody {String} [wing] The wing where the infrastructure is located.
* @apiBody {Number} [floor] The floor where the infrastructure is located.
* @apiBody {Number} [capacity] The capacity of the infrastructure.
* @apiSuccess {connector.Schema.Types.ObjectId} department.organization associated Organization.
*
* @apiSuccess {String} res infrastructure updated.
* @apiError (Error 500) err Error in updating database
*
*/
// ------------------------------------------------------------------------------------------
// Accreditation.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /accreditation/add Add Accreditation
* @apiName AddAccreditation
* @apiGroup Accreditation
* @apiDescription Add a new accreditation.
*
* @apiBody {String} name Accreditation name.
* @apiBody {String} agencyName Agency name.
* @apiBody {Date} dateofAccreditation Date of accreditation.
* @apiBody {Date} dateofExpiry Date of expiry.
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) UserNotFound The of the User was not found
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "added accreditation Example Accreditation"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
/**
* @api {delete} /accreditation/delete/:accreditationId To delete Accreditation
* @apiName DeleteAccreditation
* @apiGroup Accreditation
*
* @apiParam {String} accreditationId The ID of the accreditation document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) err Error message if there was an error during the deletion.
*
* */
/**
* @api {post} /accreditation/update/:id update accreditation details
* @apiName UpdateAccreditation
* @apiGroup Accreditation
* @apiDescription update Existing accreditation
*
* @apiParam {String} id The accreditation document to update.
* @apiBody {String} id Id of the accreditation to be updated
* @apiBody {String} [name] Accreditation name.
* @apiBody {String} [agencyName] Agency name.
* @apiBody {Date} [dateofAccreditation] Date of accreditation.
* @apiBody {Date} [dateofExpiry] Date of expiry.
*
* @apiSuccess {String} res Accreditation updated.
* @apiError (Error 500) err Error in updating database
*
*/
/**
* @api {get} accreditation/list Get Accreditation List
* @apiName GetAccreditation
* @apiGroup Accreditation
*
* @apiQuery {String} [name] Name of accreditation .
* @apiQuery {String} [agencyName] Name of agency that issued the accreditation.
* @apiQuery {Date} [dateofAccreditation] Date on which accreditation was issued.
* @apiQuery {Date} [dateofExpiry] Date till which accreditation is valid.
*
* @apiSuccess {accreditation[]} res Array of Filtered accreditation Doc.
* @apiSuccess {String} accreditation._id ID of document given by database.
* @apiSuccess {String} accreditation.name Name of accreditation.
* @apiSuccess {String} accreditation.agencyName Name of agency that issued the accreditation.
* @apiSuccess {Date} accreditation.dateofAccreditation Date on which accreditation was issued.
* @apiSuccess {Date} accreditation.dateofExpiry Date till which accreditation is valid.
*/
//------------------------------------------------------------------------------------------
// Tutorials.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /tutorial/add Add Tutorial
* @apiName AddTutorial
* @apiGroup Tutorial
*
* @apiBody {Number} no The number of tutorial.
* @apiBody {String} title The title of tutorial.
* @apiBody {Number} hours The hours required for tutorial.
* @apiBody {String} cognitiveLevel The cognitiveLevel of tutorial.
*
* @apiSuccess {String} res Success message with the ID of the added tutorial.
*
* @apiError (Error 500) DatabaseError Error while inserting in the database.
*
* @apiDescription Adds a new tutorial to the system.
*/
/**
* @api {get} tutorial/list Get Tutorial List
* @apiName GetTutorial
* @apiGroup Tutorial
*
* @apiQuery {Number} [no] Number of Tutorial.
* @apiQuery {String} [title] Title of Tutorial.
* @apiQuery {Number} [hours] Hours required for Tutorial
* @apiQuery {String} [cognitiveLevel] Level of Tutorial.
*
* @apiSuccess {Tutorial[]} res Array of Filtered Tutorial Doc .
* @apiSuccess {String} tutorial._id ID of document given by database.
* @apiSuccess {Number} tutorial.no Number of Tutorial.
* @apiSuccess {String} tutorial.title Title of Tutorial.
* @apiSuccess {String} tutorial.hours Hours of Tutorial.
* @apiSuccess {Number} tutorial.cognitiveLevel CognitiveLevel of Tutorial.
*/
/**
* @api {delete} /tutorial/delete/:tutorialId Delete Tutorial
* @apiName DeleteTutorial,
* @apiGroup Tutorial
*
* @apiParam {String} tutorialId The ID of the tutorial document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) err Error message if there was an error during the deletion.
*
* */
/**
* @api {post} /tutorial/update/:id Update tutorial details
* @apiName UpdateTutorial
* @apiGroup Tutorial
* @apiDescription update Existing Tutorial details
*
* @apiParam {String} id The tutorial document to update.
* @apiBody {String} id Id of the tutorial to be updated
* @apiBody {Number} [no] The no of tutorial.
* @apiBody {String} [title] The title of tutorial.
* @apiBody {String} [hours] The hours required for the tutorial.
* @apiBody {Number} [cognitiveLevel] The cognitiveLevel of tutorial.
*
* @apiSuccess {String} res tutorial updated.
* @apiError (Error 500) err Error in updating database
*
*/
// ------------------------------------------------------------------------------------------
// Timetable.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /timetable/add Add Timetable
* @apiName AddTimetable
* @apiGroup Timetable
* @apiDescription Add a new timetable entry.
*
* @apiBody {Date} startDate Start date of the timetable.
* @apiBody {Date} endDate End date of the timetable.
* @apiBody {ObjectId} classIncharge ID of the faculty in charge (ObjectId).
* @apiBody {ObjectId} group ID of the group (ObjectId).
* @apiBody {ObjectId} activityBlueprints ID of the activity blueprint (ObjectId).
* @apiBody {String} lunchBreakStartTime Start time of the lunch break.
* @apiBody {Number} lunchBreakDuration Duration of the lunch break (in minutes).
* @apiBody {String} teaBreakStartTime Start time of the tea break.
* @apiBody {Number} teaBreakDuration Duration of the tea break (in minutes).
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) DatabaseError Error if there was an error inserting into the database.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "Added timetable for <startDate> - <endDate>"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
// ------------------------------------------------------------------------------------------
// Department.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /department/create Create Deapartment
* @apiName AddDepartment
* @apiDescription Adds a new Department.
* @apiGroup Department
*
* @apiBody {String} name The name of the Department.
* @apiBody {String} acronym The acronym of the Department.
* @apiBody {Date} yearOfStarting The year of establishment of the Department.
* @apiBody {connector.Schema.Types.ObjectId} accreditations The accreditation which is associated.
* @apiBody {connector.Schema.Types.ObjectId} infrastructure The infrastructure which is associated.
* @apiBody {connector.Schema.Types.ObjectId} organization The organization which is associated.
*
* @apiSuccess {String} res added Department successfully.
*
* @apiError (Error 500) DatabaseError Error while inserting in the DB.
*
*/
/**
* @api {get} Department/list Listdown Department
* @apiName GetDepartment
* @apiDescription Listdown the Department.
* @apiGroup Department
*
* @apiBody {String} [name] The name of the Department.
* @apiBody {String} [acronym] The acronym of the Department.
* @apiBody {Date} [yearOfStarting] The year of establishment of the Department.
* @apiBody {connector.Schema.Types.ObjectId} [accreditations] Accreditation which is associated.
* @apiBody {connector.Schema.Types.ObjectId} [infrastructure] Infrastructure which is associated.
* @apiBody {connector.Schema.Types.ObjectId} organization The organization which is associated.
*
* @apiSuccess {Department[]} res Array of Filtered Department Doc .
* @apiSuccess {String} department._id ID of document given by database.
* @apiSuccess {String} department.name Name of Infrastructure
* @apiSuccess {String} department.acronym The acronym of the Department.
* @apiSuccess {Date} department.yearOfStarting The year of establishment of the Department.
* @apiSuccess {connector.Schema.Types.ObjectId} department.accreditations associated Accreditation.
* @apiSuccess {connector.Schema.Types.ObjectId} department.infrastructure associatedInfrastructure.
* @apiSuccess {connector.Schema.Types.ObjectId} department.organization associated Organization.
* @apiError (Error 500) err Error while fetching the data.
*/
/**
* @api {delete} /department/delete/:departmentId Delete Department
* @apiName DeleteDepartment
* @apiDescription Remove the existing Department.
* @apiGroup Department
*
* @apiParam {String} departmentId The ID of the department document to delete.
*
* @apiSuccess {String} res "Department deleted successfully.
*
* @apiError (Error 500) err Error while deleting from DB.
*
* */
/**
* @api {post} /department/update/:id Update department
* @apiName UpdateDepartment
* @apiGroup Department
* @apiDescription Update Existing Department details except yearOfStarting, acronym
*
* @apiParam {String} id The department document to update.
* @apiSuccess {String} department._id ID of document given by database.
* @apiSuccess {String} department.name Name of Infrastructure
* @apiSuccess {String} department.acronym The acronym of the Department.
* @apiSuccess {Date} department.yearOfStarting The year of establishment of the Department.
* @apiSuccess {connector.Schema.Types.ObjectId} department.accreditations associated Accreditation.
* @apiSuccess {connector.Schema.Types.ObjectId} department.infrastructure associatedInfrastructure.
* @apiSuccess {connector.Schema.Types.ObjectId} department.organization associated Organization.
*
* @apiSuccess {String} res updated infrastructure with id.
* @apiError (Error 500) err Error while inserting in DB
*/
// ------------------------------------------------------------------------------------------
// Coursework
// ------------------------------------------------------------------------------------------
/**
* @api {post} /coursework/add Add Coursework
* @apiName AddCoursework
* @apiGroup Coursework
* @apiDescription Add a new coursework entry.
*
* @apiBody {ObjectId} student ID of the student (ObjectId).
* @apiBody {String} Coursework type that is either onCampus or offCampus.
* @apiBody {ObjectId} course ID of the Course in Coursework (ObjectId).
* @apiBody {ObjectId} task ID of the task in Coursework (ObjectId).
* @apiBody {String} objectID either its practicals or tutorial or assignment .
* @apiBody {ObjectId} activity Id of the activity in Coursework.
* @apiBody {Number} Marks in the Coursework.
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) DatabaseError Err message if there is an error inserting into the database.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "Added coursework"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
/**
* @api {delete} /timetable/delete/:timetableId Delete Timetable
* @apiName DeleteTimetable
* @apiGroup Timetable
*
* @apiParam {String} timetableId The ID of the timetable document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
*/
/**
* @api {delete} /coursework/delete/:courseworkId Delete Coursework
* @apiName DeleteCoursework
* @apiGroup Coursework
*
* @apiParam {String} courseworkId The ID of the Coursework document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
*/
/**
* @api {post} /timetable/update/:id Update Timetable
* @apiName UpdateTimetable
* @apiGroup Timetable
* @apiDescription Update existing timetable data.
*
* @apiParam {String} id The timetable document to update.
* @apiBody {String} id ID of the timetable to be updated.
* @apiBody {Date} [startDate] Start date of the timetable.
* @apiBody {Date} [endDate] End date of the timetable.
* @apiBody {ObjectId} [classIncharge] ID of the faculty in charge (ObjectId).
* @apiBody {ObjectId} [group] ID of the group (ObjectId).
* @apiBody {ObjectId} [activityBlueprints] ID of activity blueprint (ObjectId).
* @apiBody {String} [lunchBreakStartTime] Start time of the lunch break.
* @apiBody {Number} [lunchBreakDuration] Duration of lunch break (in minutes).
* @apiBody {String} [teaBreakStartTime] Start time of tea break.
* @apiBody {Number} [teaBreakDuration] Duration of tea break (in minutes).
*
* @apiSuccess {String} res Timetable updated.
*/
/**
* @api {post} /coursework/update/:id Update Coursework
* @apiName UpdateCoursework
* @apiGroup Coursework
* @apiDescription Update existing coursework data.
*
* @apiParam {String} id The coursework document to update.
* @apiBody {String} id ID of the Coursework to be updated.
* @apiBody {ObjectId} student ID of the student (ObjectId).
* @apiBody {String} Coursework type that is either onCampus or offCampus.
* @apiBody {ObjectId} course ID of the Course in Coursework (ObjectId).
* @apiBody {ObjectId} task ID of the task in Coursework (ObjectId).
* @apiBody {String} objectID either its practicals or tutorial or assignment .
* @apiBody {ObjectId} activity Id of the activity in Coursework.
* @apiBody {Number} Marks in the Coursework.
*
* @apiSuccess {String} res Coursework updated.
* @apiError (Error 500) DatabaseError Error in updating the database.
*/
/**
* @api {get} /timetable/list Get Timetable List
* @apiName GetTimetableList
* @apiGroup Timetable
*
* @apiQuery {Date} [startDate] Start date of the timetable.
* @apiQuery {Date} [endDate] End date of the timetable.
* @apiQuery {ObjectId} [classIncharge] ID of the faculty in charge (ObjectId).
* @apiQuery {ObjectId} [group] ID of the group (ObjectId).
* @apiQuery {ObjectId} [activityBlueprints] ID of the activity blueprint (ObjectId).
* @apiQuery {String} [lunchBreakStartTime] Start time of the lunch break.
* @apiQuery {Number} [lunchBreakDuration] Duration of the lunch break (in minutes).
* @apiQuery {String} [lunchBreakStartTime] Start time of the lunch break.
* @apiQuery {Number} [lunchBreakDuration] Duration of the lunch break (in minutes).
*
* @apiSuccess {Timetable[]} res Array of filtered timetable documents.
* @apiSuccess {String} timetable._id ID of the timetable document given by the database.
* @apiSuccess {Date} timetable.startDate Start date of the timetable.
* @apiSuccess {Date} timetable.endDate End date of the timetable.
* @apiSuccess {ObjectId} timetable.classIncharge ID of the faculty in charge (ObjectId).
* @apiSuccess {ObjectId} timetable.group ID of the group (ObjectId).
* @apiSuccess {ObjectId} timetable.activityBlueprints ID of the activity blueprint (ObjectId).
* @apiSuccess {String} timetable.lunchBreakStartTime Start time of the lunch break.
* @apiSuccess {Number} timetable.lunchBreakDuration Duration of the lunch break (in minutes).
* @apiSuccess {String} timetable.teaBreakStartTime Start time of the tea break.
* @apiSuccess {Number} timetable.teaBreakDuration Duration of the tea break (in minutes).
*/
/**
* @api {get} /coursework/list Get Coursework List
* @apiName GetCourseworkList
* @apiGroup Coursework
*
* @apiQuery {ObjectId} student ID of the student (ObjectId).
* @apiQuery {String} Coursework type that is either onCampus or offCampus.
* @apiQuery {ObjectId} course ID of the Course in Coursework (ObjectId).
* @apiQuery {ObjectId} task ID of the task in Coursework (ObjectId).
* @apiQuery {String} objectID either its practicals or tutorial or assignment .
* @apiQuery {ObjectId} activity Id of the activity in Coursework.
* @apiQuery {Number} Marks in the Coursework.
*
* @apiSuccess {Coursework[]} res Array of filtered coursework documents.
* @apiSuccess {String} coursework._id ID of the coursework document given by the database.
* @apiSuccess {ObjectId} coursework.student ID of the student (ObjectId).
* @apiSuccess {String} coursework.type Coursework type that is either onCampus or offCampus.
* @apiSuccess {ObjectId} coursework.course ID of the Course in Coursework (ObjectId).
* @apiSuccess {ObjectId} coursework.task ID of the task in Coursework (ObjectId).
* @apiSuccess {String} coursework.objectID objectID either Practicals or Tutorial or Assignment .
* @apiSuccess {ObjectId} coursework.activity Id of the activity in Coursework.
* @apiSuccess {Number} coursework.marks Marks in the Coursework.
*/
// ------------------------------------------------------------------------------------------
// Module.
// ------------------------------------------------------------------------------------------
/**
* @api {get} module/list Get Module List
* @apiName GetModule
* @apiGroup Module
*
* @apiQuery {Number} [no] Module number.
* @apiQuery {String} [name] Name of the module.
* @apiQuery {String[]} [contents] Array of contents of the module.
* @apiQuery {ObjectId} content ID of the Topics (ObjectId).
* @apiQuery {Number} [hrsPerModule] Number of hours required per module.
* @apiQuery {String[]} [cognitiveLevels] Array of cognitive levels
* of attainment as per Bloom's Taxanomy (L1-L6).
*
* @apiSuccess {module[]} res Array of Filtered module Doc.
* @apiSuccess {String} module._id ID of document given by database.
* @apiSuccess {String} module.no Module number.
* @apiSuccess {String} module.name Name of the module.
* @apiSuccess {String[]} module.contents Array of contents of the module.
* @apiSuccess {Number} module.hrsPerModule Number of hours required per module.
* @apiSuccess {String[]} module.cognitiveLevels Array of cognitive levels of
* attainment as per Bloom's Taxanomy (L1-L6).
*/
// ------------------------------------------------------------------------------------------
// Attendance.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /attendance/add Add Attendance
* @apiName AddAttendance
* @apiGroup Attendance
* @apiDescription Add a new attendance.
*
* @apiBody {String} student Student name.
* @apiBody {String} course Course name.
* @apiBody {Number} monthlyAttended Monthly attendance of student.
* @apiBody {Number} monthlyOccured Monthly occured.
* @apiBody {Number} cumulativeAttended sum of attendance of student.
* @apiBody {Number} cumulativeOccured sum of occured.
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) UserNotFound The of the User was not found
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "added attendance Example Attendance"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
// ------------------------------------------------------------------------------------------
// Exam.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /exam/add Add Exam
* @apiName AddExam
* @apiGroup Exam
* @apiDescription Add a new exam.
*
* @apiBody {String} title Exam title.
* @apiBody {ObjectId[]} students Array of student ObjectIDs.
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) ExamAddError Error while adding the exam
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "added exam Example Exam"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
/**
* @api {post} /module/add Add Module
* @apiName AddModule
* @apiGroup Module
*
* @apiBody {Number} [no] Module number.
* @apiBody {String} [name] Name of the module.
* @apiBody {String[]} [contents] Array of contents of the module.
* @apiBody {ObjectId} content ID of the Topics (ObjectId).
* @apiBody {Number} [hrsPerModule] Number of hours required per module.
* @apiBody {String[]} [cognitiveLevels] Array of cognitive levels
* of attainment as per Bloom's Taxanomy (L1-L6).
*
* @apiSuccess {String} res added Module
* @apiError (Error 500) Error while inserting in DB
*/
/**
* @api {delete} /module/delete/:moduleId Delete Module
* @apiName DeleteModule
* @apiGroup Module
*
* @apiParam {String} moduleId The ID of the Module document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
*/
/**
* @api {post} /module/update/:moduleId Update Module
* @apiName UpdateModule
* @apiGroup Module
* @apiDescription Update existing module data.
*
* @apiParam {String} moduleId The ID of the Module document to update.
* @apiBody {Number} [no] Module number.
* @apiBody {String} [name] Name of the module.
* @apiBody {String[]} [contents] Array of contents of the module.
* @apiBody {ObjectId} content ID of the Topics (ObjectId).
* @apiBody {Number} [hrsPerModule] Number of hours required per module.
* @apiBody {String[]} [cognitiveLevels] Array of cognitive levels
* of attainment as per Bloom's Taxanomy (L1-L6).
*
* @apiSuccess {String} res Module updated.
* @apiError (Error 500) DatabaseError Error in updating the database.
*/
//-----------------------------------------------------------------------------
// Organization
//-----------------------------------------------------------------------------
/**
* @api {get} /organization/list Get Organisation List
* @apiName GetOrganizationList
* @apiGroup Organization
*
* @apiQuery [parent] Id of the parent of the organization
* @apiQuery [startDate] starting date of the organization
* @apiQuery [name] name of the organization
* @apiQuery [accreditations] accreditation Id of the organization
*
* @apiSuccess {Orgaization[]} res array of filtered organization Doc
* @apiSuccess {ObjectId} organization.parent Id of the parent of the organization
* @apiSuccess {Date} organization.startDate starting date of the organization
* @apiSuccess {String} organization.name name of the organization
* @apiSuccess {ObjectId} organization.accreditations accreditation Id of the organization
*/
/**
* @api {post} /organization/add Add Organisation
* @apiName AddOrganization
* @apiGroup Organization
*
* @apiBody {ObjectId} [parent] Id of the parent of the organization
* @apiBody {Date} [startDate] starting date of the organization
* @apiBody {String} [name] name of the organization
* @apiBody {ObjectId} [accreditations] accreditation Id of the organization
*
* @apiSuccess {String} res added organization
* @apiError (Error 500) Error while inserting in DB
*/
/**
* @api {delete} /organization/delete/:organizationId Delete Organization
* @apiName DeleteOrganization
* @apiGroup Organization
*
* @apiParam {String} organizationId The ID of the Organization document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
*/
// ------------------------------------------------------------------------------------------
// Paper.
// ------------------------------------------------------------------------------------------
//
/**
* @api {post} /paper/add Add Paper
* @apiName AddPaper
* @apiDescription Adds a new Paper.
* @apiGroup Paper
*
* @apiBody {String} [answersheetID] The id of the Answersheet.
* @apiBody {connector.Schema.Types.ObjectId} Exam The Exam which is associated.
* @apiBody {connector.Schema.Types.ObjectId} Student The Student which is associated.
* @apiBody {connector.Schema.Types.ObjectId} Faculty The Faculty which is associated.
* @apiBody {Number} [marks] marks in the paper.
*
* @apiSuccess {String} res added Paper successfully.
*
* @apiError (Error 500) DatabaseError Error while inserting in the DB.
*
*/
/**
* @api {get} /paper/list Listdown Paper
* @apiName GetPaper
* @apiDescription Listdown the Paper.
* @apiGroup Paper
*
* @apiQuery {String} [answersheetID] The id of the Answersheet.
* @apiQuery {connector.Schema.Types.ObjectId} Exam The Exam which is associated.
* @apiQuery {connector.Schema.Types.ObjectId} Student The Student which is associated.
* @apiQuery {connector.Schema.Types.ObjectId} Faculty The Faculty which is associated.
* @apiQuery {Number} [marks] marks in the paper.
*
* @apiSuccess {Paper[]} res Array of Filtered Paper Doc.
* @apiSuccess {String} paper._id ID of paper given by database.
* @apiSuccess {String} paper.answersheetID ID of answersheet.
* @apiSuccess {connector.Schema.Types.ObjectId} paper.exam associated Exam.
* @apiSuccess {connector.Schema.Types.ObjectId} paper.student associated Student.
* @apiSuccess {connector.Schema.Types.ObjectId} paper.faculty associated Faculty.
* @apiSuccess {Number} paper.marks The marks in the Paper.
* @apiError (Error 500) err Error while fetching the data.
*/
/**
* @api {delete} /paper/delete/:id Delete Paper
* @apiName DeletePaper
* @apiDescription Remove the existing Paper.
* @apiGroup Paper
*
* @apiParam {String} id The ID of the Paper document to delete.
*
* @apiSuccess {String} res Paper deleted successfully.
*
* @apiError (Error 500) err Error while deleting from DB.
*
* */
// ------------------------------------------------------------------------------------------
// Assignment.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /assignment/add Add assignment
* @apiName Addassignment
* @apiGroup Assignment
* @apiDescription Add a new assignment.
*
* @apiBody {String} no Assignment number.
* @apiBody {String} title assignment title.
* @apiBody {String} type type of assignment.
* @apiBody {Number} marks marks in assignment.
*
* @apiSuccess {String} res Response message.
* @apiError (Error 500) UserNotFound The of the User was not found
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "res": "added assignment Example Assignment"
* }
*
* @apiErrorExample Error-Response:
* HTTP/1.1 500 Internal Server Error
* {
* "err": "Error while inserting in DB"
* }
*/
/**
* @api {delete} /attendance/delete/:attendanceId To delete Attendance
* @apiName DeleteAttendance
* @apiGroup Attendance
*
* @apiParam {String} attendanceId The ID of the attendance document to delete.
*
* @apiSuccess {String} res Success message indicating the deletion.
*
* @apiError (Error 500) err Error message if there was an error during the deletion.
*
* */
// ------------------------------------------------------------------------------------------
// Practical.
// ------------------------------------------------------------------------------------------
/**
* @api {post} /practical/create Create Practical
* @apiName CreatePractical
* @apiGroup Practical
*
* @apiBody {Number} no Practical number.
* @apiBody {String} title Title of the practical.
* @apiBody {String} type Type of the practical.
* @apiBody {Number} hours Number of hours required.
* @apiBody {String[]} cognitiveLevels Array of cognitive levels (L1-L6).
*
* @apiSuccess {Object} res The created Practical entity.
* @apiSuccess {String} res._id ID of the created entity.
* @apiSuccess {Number} res.no Practical number.
* @apiSuccess {String} res.title Title of the practical.
* @apiSuccess {String} res.type Type of the practical.
* @apiSuccess {Number} res.hours Number of hours required.
* @apiSuccess {String[]} res.cognitiveLevels Array of cognitive levels (L1-L6).
*/
/**
* @api {get} /practical/list List Practical
* @apiName ListPractical
* @apiGroup Practical
*
* @apiQuery {Number} [no] Filter by Practical number.
* @apiQuery {String} [title] Filter by title.
* @apiQuery {String} [type] Filter by type.
* @apiQuery {Number} [hours] Filter by hours.
* @apiQuery {String[]} [cognitiveLevels] Filter by cognitive levels (L1-L6).
*
* @apiSuccess {Object[]} res List of Practical entities.
* @apiSuccess {String} res._id ID of the Practical entity.
* @apiSuccess {Number} res.no Practical number.
* @apiSuccess {String} res.title Title of the Practical.
* @apiSuccess {String} res.type Type of the Practical.
* @apiSuccess {Number} res.hours Number of hours required.
* @apiSuccess {String[]} res.cognitiveLevels Array of cognitive levels (L1-L6).
*/
/**
* @api {post} /practical/update/:id Update Practical
* @apiName UpdatePractical
* @apiGroup Practical
*
* @apiParam {String} id The ID of the Practical document to delete.
* @apiBody {String} id ID of the Practical entity to update.
* @apiBody {Number} [no] New Practical number.
* @apiBody {String} [title] New title.
* @apiBody {String} [type] New type.
* @apiBody {Number} [hours] New hours.
* @apiBody {String[]} [cognitiveLevels] New cognitive levels (L1-L6).
*
* @apiSuccess {Object} res The updated Practical entity.
* @apiSuccess {String} res._id ID of the updated entity.
* @apiSuccess {Number} res.no Updated Practical number.
* @apiSuccess {String} res.title Updated title.
* @apiSuccess {String} res.type Updated type.