-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ calling rescoring synchronously without eventDispatcher
Co-authored-by: Andreia Pena <[email protected]>
- Loading branch information
1 parent
d33d490
commit 5c5c109
Showing
8 changed files
with
91 additions
and
49 deletions.
There are no files selected for viewing
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
7 changes: 3 additions & 4 deletions
7
api/src/certification/session-management/application/cancellation-controller.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
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
15 changes: 15 additions & 0 deletions
15
...tion/session-management/infrastructure/repositories/certification-rescoring-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @typedef {import('../../../../../lib/domain/events/CertificationCancelled.js'} CertificationCancelled | ||
* @typedef {import('./index.js'.LibServices} LibServices | ||
*/ | ||
|
||
/** | ||
* @param {Object} params | ||
* @param {CertificationCancelled} params.certificationCancelledEvent | ||
* @param {LibServices} params.libServices | ||
*/ | ||
export const execute = async ({ certificationCancelledEvent, libServices }) => { | ||
return libServices.handleCertificationRescoring({ | ||
event: certificationCancelledEvent, | ||
}); | ||
}; |
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
26 changes: 26 additions & 0 deletions
26
...gement/integration/infrastructure/repositories/certification-rescoring-repository_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,26 @@ | ||
import CertificationCancelled from '../../../../../../lib/domain/events/CertificationCancelled.js'; | ||
import { sessionRepositories } from '../../../../../../src/certification/session-management/infrastructure/repositories/index.js'; | ||
import { NotFoundError } from '../../../../../../src/shared/domain/errors.js'; | ||
import { catchErr, expect } from '../../../../../test-helper.js'; | ||
|
||
describe('Integration | Repository | certification-rescoring-repository', function () { | ||
describe('#execute', function () { | ||
it('should trigger a rescoring', async function () { | ||
// given | ||
const certificationCancelledEvent = new CertificationCancelled({ certificationCourseId: 444, juryId: 555 }); | ||
sessionRepositories; | ||
|
||
// when | ||
const error = await catchErr(sessionRepositories.certificationRescoringRepository.execute)({ | ||
certificationCancelledEvent, | ||
}); | ||
|
||
// then | ||
expect(error).to.deepEqualInstance( | ||
new NotFoundError( | ||
`L'assessment de certification avec un certificationCourseId de ${certificationCancelledEvent.certificationCourseId} n'existe pas ou son accès est restreint`, | ||
), | ||
); | ||
}); | ||
}); | ||
}); |
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
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