Merge pull request #38 from internship-humic/feat/certificate-api
feat: nambahin start_date dan end_date di certificate project
This commit is contained in:
@@ -129,6 +129,8 @@ class CertificateRepository {
|
|||||||
project_name: true,
|
project_name: true,
|
||||||
description: true,
|
description: true,
|
||||||
certificate_template: true,
|
certificate_template: true,
|
||||||
|
start_date: true,
|
||||||
|
end_date: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -286,7 +286,14 @@ class CertificateService {
|
|||||||
return data({
|
return data({
|
||||||
uuid: certificate.uuid,
|
uuid: certificate.uuid,
|
||||||
intern_name: certificate.user ? certificate.user.full_name : null,
|
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,
|
created_at: certificate.issued_at,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -354,6 +361,8 @@ class CertificateService {
|
|||||||
project_name: cert.project.project_name,
|
project_name: cert.project.project_name,
|
||||||
description: cert.project.description,
|
description: cert.project.description,
|
||||||
certificate_template: cert.project.certificate_template,
|
certificate_template: cert.project.certificate_template,
|
||||||
|
start_date: cert.project.start_date,
|
||||||
|
end_date: cert.project.end_date,
|
||||||
} : null,
|
} : null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ const router = express.Router();
|
|||||||
* description:
|
* description:
|
||||||
* type: string
|
* type: string
|
||||||
* example: "Project to develop features of the Internify web app"
|
* 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:
|
* CertificateClaimRequest:
|
||||||
* type: object
|
* type: object
|
||||||
* required:
|
* required:
|
||||||
@@ -365,9 +373,26 @@ router.get('/project/:id_project', verifyJWT, isMentorOrAdmin, certificateContro
|
|||||||
* intern_name:
|
* intern_name:
|
||||||
* type: string
|
* type: string
|
||||||
* example: "Rafi Athallah"
|
* example: "Rafi Athallah"
|
||||||
* project_name:
|
* project:
|
||||||
* type: string
|
* type: object
|
||||||
* example: "Internify Platform Dev"
|
* 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:
|
* created_at:
|
||||||
* type: string
|
* type: string
|
||||||
* format: date-time
|
* format: date-time
|
||||||
|
|||||||
Reference in New Issue
Block a user