Skip to content

Commit f99c82f

Browse files
♻️ refactor: rename to specify OrganizationLearners
Co-Authored-By: Aurélie Crouillebois <[email protected]>
1 parent 7f626c1 commit f99c82f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

api/src/prescription/organization-learner/domain/usecases/find-paginated-filtered-participants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function _addOralizationInformationToParticipants({
7070
organizationParticipants,
7171
organizationLearnerFeatureRepository,
7272
}) {
73-
const learnersWithOralizationFeature = await organizationLearnerFeatureRepository.getLearnersByFeature({
73+
const learnersWithOralizationFeature = await organizationLearnerFeatureRepository.getOrganizationLearnersByFeature({
7474
organizationId,
7575
featureKey: ORGANIZATION_FEATURE.ORALIZATION.key,
7676
});

api/src/prescription/organization-learner/infrastructure/repositories/organization-learner-feature-repository.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DomainTransaction } from '../../../../../lib/infrastructure/DomainTransaction.js';
22
import { OrganizationLearner } from '../../domain/read-models/OrganizationLearner.js';
33

4-
async function getLearnersByFeature({ organizationId, featureKey }) {
4+
async function getOrganizationLearnersByFeature({ organizationId, featureKey }) {
55
const knexConn = DomainTransaction.getConnection();
66
const rawOrganizationLearnerFeatures = await knexConn
77
.select('organization-learners.*')
@@ -19,4 +19,4 @@ async function getLearnersByFeature({ organizationId, featureKey }) {
1919
);
2020
}
2121

22-
export { getLearnersByFeature };
22+
export { getOrganizationLearnersByFeature };

api/tests/prescription/organization-learner/integration/infrastructure/organization-learner-feature-repository_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import * as organizationLearnerFeatureRepository from '../../../../../src/prescr
33
import { databaseBuilder, expect } from '../../../../test-helper.js';
44

55
describe('Prescription | OrganizationLearner | Integration | Infrastructure | OrganizationLearnerFeatureRepository', function () {
6-
describe('#getLearnersByFeature', function () {
6+
describe('#getOrganizationLearnersByFeature', function () {
77
it('returns empty array when feature is unknown', async function () {
88
const organizationId = databaseBuilder.factory.buildOrganization().id;
99
const featureKey = 'AN_UNKNOWN_FEATURE';
1010

1111
await databaseBuilder.commit();
1212

13-
const result = await organizationLearnerFeatureRepository.getLearnersByFeature({ organizationId, featureKey });
13+
const result = await organizationLearnerFeatureRepository.getOrganizationLearnersByFeature({ organizationId, featureKey });
1414

1515
expect(result).to.deep.equal([]);
1616
});
@@ -23,7 +23,7 @@ describe('Prescription | OrganizationLearner | Integration | Infrastructure | Or
2323

2424
await databaseBuilder.commit();
2525

26-
const result = await organizationLearnerFeatureRepository.getLearnersByFeature({ organizationId, featureKey });
26+
const result = await organizationLearnerFeatureRepository.getOrganizationLearnersByFeature({ organizationId, featureKey });
2727

2828
expect(result).to.deep.equal([]);
2929
});
@@ -63,7 +63,7 @@ describe('Prescription | OrganizationLearner | Integration | Infrastructure | Or
6363

6464
const learner = new OrganizationLearner({ ...organizationLearner });
6565

66-
const result = await organizationLearnerFeatureRepository.getLearnersByFeature({ organizationId, featureKey });
66+
const result = await organizationLearnerFeatureRepository.getOrganizationLearnersByFeature({ organizationId, featureKey });
6767

6868
expect(result).to.deep.equal([learner]);
6969
});

api/tests/prescription/organization-learner/unit/domain/usecases/find-paginated-filtered-participants_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Unit | UseCases | find-paginated-participants', function () {
4040
};
4141

4242
organizationLearnerFeatureRepository = {
43-
getLearnersByFeature: sinon.stub(),
43+
getOrganizationLearnersByFeature: sinon.stub(),
4444
};
4545
});
4646

@@ -157,7 +157,7 @@ describe('Unit | UseCases | find-paginated-participants', function () {
157157
organizationParticipants: [participantWithOralization, participantWithoutOralization],
158158
meta: {},
159159
});
160-
organizationLearnerFeatureRepository.getLearnersByFeature.resolves([learnerWithOralization]);
160+
organizationLearnerFeatureRepository.getOrganizationLearnersByFeature.resolves([learnerWithOralization]);
161161

162162
// when
163163
const result = await findPaginatedFilteredParticipants({

0 commit comments

Comments
 (0)