feat: nambahin start_date dan end_date di certificate project

This commit is contained in:
Rafi Athallah
2026-07-15 01:03:23 +07:00
parent 0fbb314007
commit 7526fc07e4
3 changed files with 40 additions and 4 deletions
@@ -129,6 +129,8 @@ class CertificateRepository {
project_name: true,
description: true,
certificate_template: true,
start_date: true,
end_date: true,
},
},
};
@@ -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,
};
}
+28 -3
View File
@@ -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