-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ api: Add ComplementaryCertification model to enrolment
- Loading branch information
Showing
5 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
api/src/certification/enrolment/domain/models/ComplementaryCertification.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @typedef {import ('../../../shared/domain/models/ComplementaryCertificationKeys.js').ComplementaryCertificationKeys} ComplementaryCertificationKeys | ||
*/ | ||
|
||
export class ComplementaryCertification { | ||
/** | ||
* @param {Object} props | ||
* @param {number} props.id | ||
* @param {string} props.label | ||
* @param {ComplementaryCertificationKeys|string} props.key identifier key | ||
*/ | ||
constructor({ id, label, key } = {}) { | ||
this.id = id; | ||
this.label = label; | ||
this.key = key; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ification/enrolment/infrastructure/repositories/complementary-certification-repository.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
api/tests/certification/enrolment/unit/domain/models/ComplementaryCertification_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ComplementaryCertification } from '../../../../../../src/certification/enrolment/domain/models/ComplementaryCertification.js'; | ||
import { domainBuilder, expect } from '../../../../../test-helper.js'; | ||
|
||
describe('Unit | Certification | Enrolment | Domain | Models | ComplementaryCertification', function () { | ||
it('should return a complementary certification', function () { | ||
// given | ||
const complementaryCertification = | ||
domainBuilder.certification.sessionManagement.buildCertificationSessionComplementaryCertification(); | ||
|
||
// when / then | ||
expect(complementaryCertification).to.deepEqualInstance(new ComplementaryCertification(complementaryCertification)); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
...ts/certification/session-management/unit/domain/models/ComplementaryCertification_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters