docs: dokumentasi slug di module project & task

This commit is contained in:
Muhammad Zhafran Ilham
2026-06-23 23:58:24 +07:00
parent 8aedb19ca1
commit 76eba6eb13
2 changed files with 134 additions and 36 deletions
+33 -12
View File
@@ -16,6 +16,9 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: internify-lms
* project_icon:
* type: string
* enum: [code, chart, cloud, mobile, gear, users, clipboard, speedometer, lightbulb, shield]
@@ -128,6 +131,9 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: internify-platform-dev
* project_icon:
* type: string
* example: code
@@ -216,6 +222,9 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: database-setup
* title:
* type: string
* example: Database Setup
@@ -332,9 +341,15 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: database-setup
* id_project:
* type: integer
* example: 1
* project_slug:
* type: string
* example: internify-platform-dev
* project_name:
* type: string
* example: Internify Platform Dev
@@ -526,7 +541,7 @@ router.get('/get', verifyJWT, projectController.getAllProjects);
* /project-api/get/{id}:
* get:
* summary: Get project detail
* description: Admin can access any project. Intern can only access project where they are active members.
* description: Admin can access any project. Mentor can access their own project. Intern can only access project where they are active members. The path parameter supports project ID or slug.
* tags: [Project]
* security:
* - bearerAuth: []
@@ -534,10 +549,12 @@ router.get('/get', verifyJWT, projectController.getAllProjects);
* - in: path
* name: id
* schema:
* type: integer
* oneOf:
* - type: integer
* - type: string
* required: true
* description: Project ID
* example: 1
* description: Project ID or slug
* example: internify-platform-dev
* responses:
* 200:
* description: Project detail retrieved successfully
@@ -561,7 +578,7 @@ router.get('/get/:id', verifyJWT, projectController.getProjectById);
* /project-api/update/{id}:
* patch:
* summary: Update project
* description: Update project information. Only admin can access this endpoint.
* description: Update project information. Only admin can access this endpoint. The path parameter supports project ID or slug.
* tags: [Project]
* security:
* - bearerAuth: []
@@ -569,10 +586,12 @@ router.get('/get/:id', verifyJWT, projectController.getProjectById);
* - in: path
* name: id
* schema:
* type: integer
* oneOf:
* - type: integer
* - type: string
* required: true
* description: Project ID
* example: 1
* description: Project ID or slug
* example: internify-platform-dev
* requestBody:
* required: true
* content:
@@ -613,7 +632,7 @@ router.patch('/update/:id', verifyJWT, isMentorOrAdmin, projectController.update
* /project-api/delete/{id}:
* delete:
* summary: Archive project
* description: Archive project by changing its status to archived. This endpoint does not hard delete the project.
* description: Archive project by changing its status to archived. This endpoint does not hard delete the project. The path parameter supports project ID or slug.
* tags: [Project]
* security:
* - bearerAuth: []
@@ -621,10 +640,12 @@ router.patch('/update/:id', verifyJWT, isMentorOrAdmin, projectController.update
* - in: path
* name: id
* schema:
* type: integer
* oneOf:
* - type: integer
* - type: string
* required: true
* description: Project ID
* example: 1
* description: Project ID or slug
* example: internify-platform-dev
* responses:
* 200:
* description: Project archived successfully
+95 -18
View File
@@ -23,6 +23,9 @@ const router = express.Router();
* id_project:
* type: integer
* example: 1
* slug:
* type: string
* example: laporan-tugas-2
* title:
* type: string
* example: Laporan Tugas 2
@@ -192,6 +195,9 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: internify-project
* project_name:
* type: string
* example: Internify Project
@@ -232,6 +238,9 @@ const router = express.Router();
* id:
* type: integer
* example: 1
* slug:
* type: string
* example: internify-project
* project_name:
* type: string
* example: Internify Project
@@ -345,7 +354,7 @@ const router = express.Router();
* /task-api/projects/{id_project}/tasks:
* post:
* summary: Create task in project
* description: Create a new task inside a project. Only admin or mentor can access this endpoint. Mentors can only create tasks in projects they own.
* description: Create a new task inside a project. Project can be referenced by ID or slug. Only admin or mentor can access this endpoint. Mentors can only create tasks in projects they own.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -354,9 +363,13 @@ const router = express.Router();
* name: id_project
* required: true
* schema:
* type: integer
* description: Project ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug
* example: internify-project
* requestBody:
* required: true
* content:
@@ -388,7 +401,7 @@ router.post('/projects/:id_project/tasks', verifyJWT, isMentorOrAdmin, taskContr
* /task-api/projects/{id_project}/tasks:
* get:
* summary: Get project tasks
* description: Get all tasks from a project. Admin can access any project task list. Intern can only access tasks from their active project.
* description: Get all tasks from a project. Project can be referenced by ID or slug. Admin can access any project task list. Intern can only access tasks from their active project.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -397,9 +410,13 @@ router.post('/projects/:id_project/tasks', verifyJWT, isMentorOrAdmin, taskContr
* name: id_project
* required: true
* schema:
* type: integer
* description: Project ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug
* example: internify-project
* responses:
* 200:
* description: Tasks retrieved successfully
@@ -423,7 +440,7 @@ router.get('/projects/:id_project/tasks', verifyJWT, taskController.getTasksByPr
* /task-api/tasks/{id}:
* get:
* summary: Get task detail
* description: Get task detail. Admin receives all intern submissions. Intern receives only their own submission.
* description: Get task detail. Admin/mentor receives all intern submissions. Intern receives only their own submission. The path parameter supports task ID. Task slug is also supported when project query is provided.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -432,9 +449,24 @@ router.get('/projects/:id_project/tasks', verifyJWT, taskController.getTasksByPr
* name: id
* required: true
* schema:
* type: integer
* description: Task ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: laporan-tugas-2
* description: Task ID or task slug. If task slug is used, project query parameter is required.
* example: laporan-tugas-2
* - in: query
* name: project
* required: false
* schema:
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug. Required when using task slug instead of numeric task ID.
* example: internify-project
* responses:
* 200:
* description: Task detail retrieved successfully
@@ -538,7 +570,7 @@ router.get('/tasks/:id', verifyJWT, taskController.getTaskById);
* /task-api/tasks/{id}:
* patch:
* summary: Update task
* description: Update task information. Submission type cannot be changed if the task already has submissions. Only admin or mentor can access this endpoint. Mentors can only update tasks in projects they own.
* description: Update task information. Submission type cannot be changed if the task already has submissions. Only admin or mentor can access this endpoint. Mentors can only update tasks in projects they own. The path parameter supports task ID. Task slug is also supported when project query is provided.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -547,9 +579,24 @@ router.get('/tasks/:id', verifyJWT, taskController.getTaskById);
* name: id
* required: true
* schema:
* type: integer
* description: Task ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: laporan-tugas-2
* description: Task ID or task slug. If task slug is used, project query parameter is required.
* example: laporan-tugas-2
* - in: query
* name: project
* required: false
* schema:
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug. Required when using task slug instead of numeric task ID.
* example: internify-project
* requestBody:
* required: true
* content:
@@ -583,7 +630,7 @@ router.patch('/tasks/:id', verifyJWT, isMentorOrAdmin, taskController.updateTask
* /task-api/tasks/{id}:
* delete:
* summary: Delete task
* description: Delete task only if it does not have submissions. Only admin or mentor can access this endpoint. Mentors can only delete tasks in projects they own.
* description: Delete task only if it does not have submissions. Only admin or mentor can access this endpoint. Mentors can only delete tasks in projects they own. The path parameter supports task ID. Task slug is also supported when project query is provided.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -592,9 +639,24 @@ router.patch('/tasks/:id', verifyJWT, isMentorOrAdmin, taskController.updateTask
* name: id
* required: true
* schema:
* type: integer
* description: Task ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: laporan-tugas-2
* description: Task ID or task slug. If task slug is used, project query parameter is required.
* example: laporan-tugas-2
* - in: query
* name: project
* required: false
* schema:
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug. Required when using task slug instead of numeric task ID.
* example: internify-project
* responses:
* 200:
* description: Task deleted successfully
@@ -616,7 +678,7 @@ router.delete('/tasks/:id', verifyJWT, isMentorOrAdmin, taskController.deleteTas
* /task-api/tasks/{id}/submissions:
* post:
* summary: Submit task
* description: Submit a task as an intern. For file_upload tasks, send submission_file. For url_link tasks, send url_link.
* description: Submit a task as an intern. For file_upload tasks, send submission_file. For url_link tasks, send url_link. The path parameter supports task ID. Task slug is also supported when project query is provided.
* tags: [Task]
* security:
* - bearerAuth: []
@@ -625,9 +687,24 @@ router.delete('/tasks/:id', verifyJWT, isMentorOrAdmin, taskController.deleteTas
* name: id
* required: true
* schema:
* type: integer
* description: Task ID
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: laporan-tugas-2
* description: Task ID or task slug. If task slug is used, project query parameter is required.
* example: laporan-tugas-2
* - in: query
* name: project
* required: false
* schema:
* oneOf:
* - type: integer
* example: 1
* - type: string
* example: internify-project
* description: Project ID or slug. Required when using task slug instead of numeric task ID.
* example: internify-project
* requestBody:
* required: false
* content: