diff --git a/api/src/prescription/campaign-participation/domain/usecases/index.js b/api/src/prescription/campaign-participation/domain/usecases/index.js index d7290905314..bf522dbdd49 100644 --- a/api/src/prescription/campaign-participation/domain/usecases/index.js +++ b/api/src/prescription/campaign-participation/domain/usecases/index.js @@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url'; import * as badgeAcquisitionRepository from '../../../../../lib/infrastructure/repositories/badge-acquisition-repository.js'; import * as badgeForCalculationRepository from '../../../../../lib/infrastructure/repositories/badge-for-calculation-repository.js'; +import { campaignParticipationResultRepository } from '../../../../../lib/infrastructure/repositories/campaign-participation-result-repository.js'; import * as campaignRepository from '../../../../../lib/infrastructure/repositories/campaign-repository.js'; import * as knowledgeElementRepository from '../../../../../lib/infrastructure/repositories/knowledge-element-repository.js'; import * as learningContentRepository from '../../../../../lib/infrastructure/repositories/learning-content-repository.js'; @@ -96,6 +97,7 @@ const dependencies = { campaignParticipantRepository: campaignRepositories.campaignParticipantRepository, campaignParticipationOverviewRepository, campaignParticipationRepository, + campaignParticipationResultRepository, campaignProfileRepository, campaignRepository, targetProfileRepository, diff --git a/api/lib/domain/usecases/send-shared-participation-results-to-pole-emploi.js b/api/src/prescription/campaign-participation/domain/usecases/send-shared-participation-results-to-pole-emploi.js similarity index 80% rename from api/lib/domain/usecases/send-shared-participation-results-to-pole-emploi.js rename to api/src/prescription/campaign-participation/domain/usecases/send-shared-participation-results-to-pole-emploi.js index 294fb74a3f4..0e2f4bc2acb 100644 --- a/api/lib/domain/usecases/send-shared-participation-results-to-pole-emploi.js +++ b/api/src/prescription/campaign-participation/domain/usecases/send-shared-participation-results-to-pole-emploi.js @@ -1,8 +1,8 @@ -import { PoleEmploiSending } from '../../../src/prescription/campaign-participation/domain/models/PoleEmploiSending.js'; -import { PoleEmploiPayload } from '../../../src/prescription/campaign-participation/infrastructure/externals/pole-emploi/PoleEmploiPayload.js'; -import { logger } from '../../../src/shared/infrastructure/utils/logger.js'; -import * as httpErrorsHelper from '../../infrastructure/http/errors-helper.js'; -import { httpAgent } from '../../infrastructure/http/http-agent.js'; +import * as httpErrorsHelper from '../../../../../lib/infrastructure/http/errors-helper.js'; +import { httpAgent } from '../../../../../lib/infrastructure/http/http-agent.js'; +import { logger } from '../../../../shared/infrastructure/utils/logger.js'; +import { PoleEmploiPayload } from '../../infrastructure/externals/pole-emploi/PoleEmploiPayload.js'; +import { PoleEmploiSending } from '../models/PoleEmploiSending.js'; const sendSharedParticipationResultsToPoleEmploi = async ({ campaignParticipationId, diff --git a/api/tests/prescription/campaign-participation/integration/send-shared-participation-results-to-pole-emploi_test.js b/api/tests/prescription/campaign-participation/integration/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js similarity index 90% rename from api/tests/prescription/campaign-participation/integration/send-shared-participation-results-to-pole-emploi_test.js rename to api/tests/prescription/campaign-participation/integration/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js index 2ea5b3f270c..912e6bf74d5 100644 --- a/api/tests/prescription/campaign-participation/integration/send-shared-participation-results-to-pole-emploi_test.js +++ b/api/tests/prescription/campaign-participation/integration/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js @@ -1,5 +1,5 @@ -import { usecases } from '../../../../lib/domain/usecases/index.js'; -import * as poleEmploiNotifier from '../../../../src/prescription/campaign-participation/infrastructure/externals/pole-emploi/pole-emploi-notifier.js'; +import { usecases } from '../../../../../../src/prescription/campaign-participation/domain/usecases/index.js'; +import * as poleEmploiNotifier from '../../../../../../src/prescription/campaign-participation/infrastructure/externals/pole-emploi/pole-emploi-notifier.js'; import { databaseBuilder, expect, @@ -7,7 +7,7 @@ import { learningContentBuilder, mockLearningContent, sinon, -} from '../../../test-helper.js'; +} from '../../../../../test-helper.js'; describe('Integration | Domain | UseCases | send-shared-participation-results-to-pole-emploi', function () { let campaignParticipationId, userId, responseCode; diff --git a/api/tests/prescription/campaign/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js b/api/tests/prescription/campaign/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js index d697496e37a..99ff65223b2 100644 --- a/api/tests/prescription/campaign/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js +++ b/api/tests/prescription/campaign/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js @@ -1,4 +1,4 @@ -import { sendSharedParticipationResultsToPoleEmploi } from '../../../../../../lib/domain/usecases/send-shared-participation-results-to-pole-emploi.js'; +import { usecases } from '../../../../../../src/prescription/campaign/domain/usecases/index.js'; import { PoleEmploiSending } from '../../../../../../src/prescription/campaign-participation/domain/models/PoleEmploiSending.js'; import { PoleEmploiPayload } from '../../../../../../src/prescription/campaign-participation/infrastructure/externals/pole-emploi/PoleEmploiPayload.js'; import { config } from '../../../../../../src/shared/config.js'; @@ -216,7 +216,7 @@ describe('Unit | Domain | UseCase | send-shared-participation-results-to-pole-em .returns(poleEmploiSending); // when - await sendSharedParticipationResultsToPoleEmploi({ + await usecases.sendSharedParticipationResultsToPoleEmploi({ ...dependencies, campaignParticipationId, }); @@ -248,7 +248,7 @@ describe('Unit | Domain | UseCase | send-shared-participation-results-to-pole-em it('should not notify to Pole Emploi', async function () { // when - await sendSharedParticipationResultsToPoleEmploi({ + await usecases.sendSharedParticipationResultsToPoleEmploi({ ...dependencies, campaignParticipationId, }); @@ -278,7 +278,7 @@ describe('Unit | Domain | UseCase | send-shared-participation-results-to-pole-em it('should not notify to Pole Emploi', async function () { // when - await sendSharedParticipationResultsToPoleEmploi({ + await usecases.sendSharedParticipationResultsToPoleEmploi({ ...dependencies, campaignParticipationId, });