diff --git a/src/modules/certificate/repositories/certificate.repository.js b/src/modules/certificate/repositories/certificate.repository.js index 62f1deb..e3c3c37 100644 --- a/src/modules/certificate/repositories/certificate.repository.js +++ b/src/modules/certificate/repositories/certificate.repository.js @@ -129,6 +129,8 @@ class CertificateRepository { project_name: true, description: true, certificate_template: true, + start_date: true, + end_date: true, }, }, }; diff --git a/src/modules/certificate/services/certificate.service.js b/src/modules/certificate/services/certificate.service.js index 52de155..0d3d69a 100644 --- a/src/modules/certificate/services/certificate.service.js +++ b/src/modules/certificate/services/certificate.service.js @@ -286,7 +286,14 @@ class CertificateService { return data({ uuid: certificate.uuid, intern_name: certificate.user ? certificate.user.full_name : null, - project_name: certificate.project ? certificate.project.project_name : null, + project: certificate.project ? { + id: certificate.project.id, + project_name: certificate.project.project_name, + description: certificate.project.description, + certificate_template: certificate.project.certificate_template, + start_date: certificate.project.start_date, + end_date: certificate.project.end_date, + } : null, created_at: certificate.issued_at, }); } catch (err) { @@ -354,6 +361,8 @@ class CertificateService { project_name: cert.project.project_name, description: cert.project.description, certificate_template: cert.project.certificate_template, + start_date: cert.project.start_date, + end_date: cert.project.end_date, } : null, }; } diff --git a/src/routes/certificate.routes.js b/src/routes/certificate.routes.js index 0cb75e1..6e31947 100644 --- a/src/routes/certificate.routes.js +++ b/src/routes/certificate.routes.js @@ -55,6 +55,14 @@ const router = express.Router(); * description: * type: string * example: "Project to develop features of the Internify web app" + * start_date: + * type: string + * format: date + * example: "2026-07-10" + * end_date: + * type: string + * format: date + * example: "2026-08-10" * CertificateClaimRequest: * type: object * required: @@ -365,9 +373,26 @@ router.get('/project/:id_project', verifyJWT, isMentorOrAdmin, certificateContro * intern_name: * type: string * example: "Rafi Athallah" - * project_name: - * type: string - * example: "Internify Platform Dev" + * project: + * type: object + * properties: + * id: + * type: integer + * example: 2 + * project_name: + * type: string + * example: "Internify Platform Dev" + * description: + * type: string + * example: "Project to develop features of the Internify web app" + * start_date: + * type: string + * format: date + * example: "2026-07-10" + * end_date: + * type: string + * format: date + * example: "2026-08-10" * created_at: * type: string * format: date-time