Skip to content

Commit

Permalink
:sparkless: feat(api) add competence level to certif result
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Coin <[email protected]>

Co-Authored-By: GUL <[email protected]>
  • Loading branch information
yaf and HEYGUL authored Dec 30, 2024
1 parent 234310f commit d062ac8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const buildCertificationResult = function ({
status,
pixScore,
certificationDate,
competenceId,
competenceLevel,
} = {}) {
const values = {
national_student_id: nationalStudentId,
Expand All @@ -19,6 +21,8 @@ const buildCertificationResult = function ({
status,
pix_score: pixScore,
certification_date: certificationDate,
competence_id: competenceId,
competence_level: competenceLevel,
};

datamartBuffer.pushInsertable({
Expand Down
13 changes: 12 additions & 1 deletion api/src/parcoursup/domain/read-models/CertificationResult.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
class CertificationResult {
constructor({ ine, organizationUai, lastName, firstName, birthdate, status, pixScore, certificationDate }) {
constructor({
ine,
organizationUai,
lastName,
firstName,
birthdate,
status,
pixScore,
certificationDate,
competences,
}) {
this.ine = ine;
this.organizationUai = organizationUai;
this.lastName = lastName;
Expand All @@ -8,6 +18,7 @@ class CertificationResult {
this.status = status;
this.pixScore = pixScore;
this.certificationDate = certificationDate;
this.competences = competences;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const get = async ({ ine }) => {
status: certificationResultDto.status,
pixScore: certificationResultDto.pix_score,
certificationDate: certificationResultDto.certification_date,
competences: [
{
id: certificationResultDto.competence_id,
level: certificationResultDto.competence_level,
},
],
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ describe('Parcoursup | Acceptance | Application | certification-route', function
status: 'validated',
pixScore: 327,
certificationDate: '2024-11-22T09:39:54Z',
competenceId: 'xzef1223443',
competenceLevel: 3,
});
await datamartBuilder.commit();

Expand All @@ -56,6 +58,13 @@ describe('Parcoursup | Acceptance | Application | certification-route', function
status: 'validated',
pixScore: 327,
certificationDate: new Date('2024-11-22T09:39:54Z'),
competences: [
{
// TODO ask DataTeam to add code and label (1.1 Mener une recherche et une veille d’information)
id: 'xzef1223443',
level: 3,
},
],
};

// when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('Parcoursup | Infrastructure | Integration | Repositories | certificati
status: 'validated',
pixScore: 327,
certificationDate: '2024-11-22T09:39:54',
competenceId: 'xzef1223443',
competenceLevel: 3,
});
await datamartBuilder.commit();

Expand All @@ -33,6 +35,12 @@ describe('Parcoursup | Infrastructure | Integration | Repositories | certificati
status: 'validated',
pixScore: 327,
certificationDate: new Date('2024-11-22T09:39:54Z'),
competences: [
{
id: 'xzef1223443',
level: 3,
},
],
});
expect(result).to.deep.equal(expectedCertification);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const buildCertificationResult = function ({
status,
pixScore,
certificationDate,
competences,
}) {
return new CertificationResult({
ine,
Expand All @@ -19,6 +20,7 @@ const buildCertificationResult = function ({
status,
pixScore,
certificationDate,
competences,
});
};

Expand Down

0 comments on commit d062ac8

Please sign in to comment.