feat: nambahin API route untuk generate certificate bagi Admin/Mentor
This commit is contained in:
@@ -114,6 +114,50 @@ const router = express.Router();
|
||||
*/
|
||||
router.post('/claim', verifyJWT, certificateController.claimCertificate);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /certificate-api/generate:
|
||||
* post:
|
||||
* summary: Batch generate certificates (Admin/Mentor only)
|
||||
* description: Mentors or Admins can batch-generate certificates for selected eligible interns of a project.
|
||||
* tags: [Certificate]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - id_project
|
||||
* - id_users
|
||||
* properties:
|
||||
* id_project:
|
||||
* type: integer
|
||||
* example: 2
|
||||
* id_users:
|
||||
* type: array
|
||||
* items:
|
||||
* type: integer
|
||||
* example: [5, 6]
|
||||
* responses:
|
||||
* 201:
|
||||
* description: Certificates generated successfully
|
||||
* 400:
|
||||
* description: Bad request (not eligible or missing parameters)
|
||||
* 401:
|
||||
* description: Unauthorized
|
||||
* 403:
|
||||
* description: Forbidden (only mentors/admins of the project can generate)
|
||||
* 409:
|
||||
* description: Conflict (certificate already generated for one or more interns)
|
||||
* 500:
|
||||
* description: Internal server error
|
||||
*/
|
||||
router.post('/generate', verifyJWT, isMentorOrAdmin, certificateController.generateCertificates);
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /certificate-api/my-certificates:
|
||||
|
||||
Reference in New Issue
Block a user