diff --git a/api/lib/domain/events/index.js b/api/lib/domain/events/index.js index 78faecb4427..44ace1bb343 100644 --- a/api/lib/domain/events/index.js +++ b/api/lib/domain/events/index.js @@ -35,7 +35,6 @@ import * as eventBusBuilder from '../../infrastructure/events/EventBusBuilder.js import { EventDispatcher } from '../../infrastructure/events/EventDispatcher.js'; import { EventDispatcherLogger } from '../../infrastructure/events/EventDispatcherLogger.js'; import * as badgeAcquisitionRepository from '../../infrastructure/repositories/badge-acquisition-repository.js'; -import * as campaignParticipationResultRepository from '../../infrastructure/repositories/campaign-participation-result-repository.js'; import * as campaignRepository from '../../infrastructure/repositories/campaign-repository.js'; import * as complementaryCertificationCourseResultRepository from '../../infrastructure/repositories/complementary-certification-course-result-repository.js'; import * as complementaryCertificationScoringCriteriaRepository from '../../infrastructure/repositories/complementary-certification-scoring-criteria-repository.js'; @@ -53,7 +52,6 @@ const dependencies = { authenticationMethodRepository, badgeAcquisitionRepository, campaignRepository, - campaignParticipationResultRepository, certificationAssessmentHistoryRepository, certificationAssessmentRepository, certificationCenterRepository, diff --git a/api/lib/domain/usecases/index.js b/api/lib/domain/usecases/index.js index 41f5d85debb..3b06b7e9ed0 100644 --- a/api/lib/domain/usecases/index.js +++ b/api/lib/domain/usecases/index.js @@ -128,7 +128,6 @@ import * as passwordGenerator from '../../domain/services/password-generator.js' import * as verifyCertificateCodeService from '../../domain/services/verify-certificate-code-service.js'; import * as badgeAcquisitionRepository from '../../infrastructure/repositories/badge-acquisition-repository.js'; import * as badgeForCalculationRepository from '../../infrastructure/repositories/badge-for-calculation-repository.js'; -import { campaignParticipationResultRepository } from '../../infrastructure/repositories/campaign-participation-result-repository.js'; import * as campaignRepository from '../../infrastructure/repositories/campaign-repository.js'; import * as certifiableProfileForLearningContentRepository from '../../infrastructure/repositories/certifiable-profile-for-learning-content-repository.js'; import * as complementaryCertificationCourseResultRepository from '../../infrastructure/repositories/complementary-certification-course-result-repository.js'; @@ -212,7 +211,6 @@ const dependencies = { campaignManagementRepository, participationCompletedJobRepository, campaignParticipationRepository, - campaignParticipationResultRepository, campaignProfileRepository, campaignRepository, centerRepository, diff --git a/api/scripts/prod/insert-missing-pole-emploi-sending-from-date.js b/api/scripts/prod/insert-missing-pole-emploi-sending-from-date.js index 9f3e741d040..85ef64a1b95 100644 --- a/api/scripts/prod/insert-missing-pole-emploi-sending-from-date.js +++ b/api/scripts/prod/insert-missing-pole-emploi-sending-from-date.js @@ -4,7 +4,6 @@ import dayjs from 'dayjs'; import { disconnect, knex } from '../../db/knex-database-connection.js'; import * as badgeAcquisitionRepository from '../../lib/infrastructure/repositories/badge-acquisition-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 targetProfileRepository from '../../lib/infrastructure/repositories/target-profile-repository.js'; import * as badgeRepository from '../../src/evaluation/infrastructure/repositories/badge-repository.js'; @@ -12,6 +11,7 @@ import * as userRepository from '../../src/identity-access-management/infrastruc 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 * as campaignParticipationRepository from '../../src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-repository.js'; +import { campaignParticipationResultRepository } from '../../src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-result-repository.js'; import * as poleEmploiSendingRepository from '../../src/prescription/campaign-participation/infrastructure/repositories/pole-emploi-sending-repository.js'; import { CampaignParticipationStatuses } from '../../src/prescription/shared/domain/constants.js'; import { Assessment } from '../../src/shared/domain/models/Assessment.js'; diff --git a/api/src/prescription/campaign-participation/application/jobs/participation-shared-job-controller.js b/api/src/prescription/campaign-participation/application/jobs/participation-shared-job-controller.js index 97fbc985801..38910d18546 100644 --- a/api/src/prescription/campaign-participation/application/jobs/participation-shared-job-controller.js +++ b/api/src/prescription/campaign-participation/application/jobs/participation-shared-job-controller.js @@ -1,6 +1,6 @@ -import { usecases } from '../../../../../lib/domain/usecases/index.js'; import { JobController } from '../../../../shared/application/jobs/job-controller.js'; import { ParticipationSharedJob } from '../../domain/models/ParticipationSharedJob.js'; +import { usecases } from '../../domain/usecases/index.js'; export class ParticipationSharedJobController extends JobController { constructor() { diff --git a/api/src/prescription/campaign-participation/domain/usecases/index.js b/api/src/prescription/campaign-participation/domain/usecases/index.js index d7290905314..d596c0845dc 100644 --- a/api/src/prescription/campaign-participation/domain/usecases/index.js +++ b/api/src/prescription/campaign-participation/domain/usecases/index.js @@ -31,6 +31,7 @@ import * as campaignAssessmentParticipationRepository from '../../infrastructure import * as campaignAssessmentParticipationResultRepository from '../../infrastructure/repositories/campaign-assessment-participation-result-repository.js'; import * as campaignParticipationOverviewRepository from '../../infrastructure/repositories/campaign-participation-overview-repository.js'; import * as campaignParticipationRepository from '../../infrastructure/repositories/campaign-participation-repository.js'; +import { campaignParticipationResultRepository } from '../../infrastructure/repositories/campaign-participation-result-repository.js'; import * as campaignProfileRepository from '../../infrastructure/repositories/campaign-profile-repository.js'; import { repositories as campaignRepositories } from '../../infrastructure/repositories/index.js'; // needed to includes organizationFeatureAPI from another BC import { participationResultCalculationJobRepository } from '../../infrastructure/repositories/jobs/participation-result-calculation-job-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/lib/infrastructure/repositories/campaign-participation-result-repository.js b/api/src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-result-repository.js similarity index 55% rename from api/lib/infrastructure/repositories/campaign-participation-result-repository.js rename to api/src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-result-repository.js index 3f85b4f400c..195730b062d 100644 --- a/api/lib/infrastructure/repositories/campaign-participation-result-repository.js +++ b/api/src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-result-repository.js @@ -1,10 +1,10 @@ -import { CampaignParticipationResult } from '../../../src/shared/domain/models/CampaignParticipationResult.js'; -import * as areaRepository from '../../../src/shared/infrastructure/repositories/area-repository.js'; -import * as assessmentRepository from '../../../src/shared/infrastructure/repositories/assessment-repository.js'; -import * as competenceRepository from '../../../src/shared/infrastructure/repositories/competence-repository.js'; -import * as campaignParticipationRepository from './../../../src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-repository.js'; -import * as campaignRepository from './campaign-repository.js'; -import * as knowledgeElementRepository from './knowledge-element-repository.js'; +import * as campaignRepository from '../../../../../lib/infrastructure/repositories/campaign-repository.js'; +import * as knowledgeElementRepository from '../../../../../lib/infrastructure/repositories/knowledge-element-repository.js'; +import { CampaignParticipationResult } from '../../../../shared/domain/models/CampaignParticipationResult.js'; +import * as areaRepository from '../../../../shared/infrastructure/repositories/area-repository.js'; +import * as assessmentRepository from '../../../../shared/infrastructure/repositories/assessment-repository.js'; +import * as competenceRepository from '../../../../shared/infrastructure/repositories/competence-repository.js'; +import * as campaignParticipationRepository from './campaign-participation-repository.js'; const campaignParticipationResultRepository = { async getByParticipationId(campaignParticipationId) { diff --git a/api/tests/integration/domain/usecases/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/integration/domain/usecases/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/integration/domain/usecases/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/integration/infrastructure/repositories/campaign-participation-result-repository_test.js b/api/tests/prescription/campaign-participation/integration/infrastructure/repositories/campaign-participation-result-repository_test.js similarity index 96% rename from api/tests/integration/infrastructure/repositories/campaign-participation-result-repository_test.js rename to api/tests/prescription/campaign-participation/integration/infrastructure/repositories/campaign-participation-result-repository_test.js index 8fb8c4e4187..8698c02ef24 100644 --- a/api/tests/integration/infrastructure/repositories/campaign-participation-result-repository_test.js +++ b/api/tests/prescription/campaign-participation/integration/infrastructure/repositories/campaign-participation-result-repository_test.js @@ -1,7 +1,7 @@ -import { campaignParticipationResultRepository } from '../../../../lib/infrastructure/repositories/campaign-participation-result-repository.js'; -import { CampaignParticipationStatuses } from '../../../../src/prescription/shared/domain/constants.js'; -import { KnowledgeElement } from '../../../../src/shared/domain/models/KnowledgeElement.js'; -import { databaseBuilder, expect } from '../../../test-helper.js'; +import { campaignParticipationResultRepository } from '../../../../../../src/prescription/campaign-participation/infrastructure/repositories/campaign-participation-result-repository.js'; +import { CampaignParticipationStatuses } from '../../../../../../src/prescription/shared/domain/constants.js'; +import { KnowledgeElement } from '../../../../../../src/shared/domain/models/KnowledgeElement.js'; +import { databaseBuilder, expect } from '../../../../../test-helper.js'; const { STARTED } = CampaignParticipationStatuses; diff --git a/api/tests/prescription/campaign-participation/unit/application/jobs/participation-shared-job-controller_test.js b/api/tests/prescription/campaign-participation/unit/application/jobs/participation-shared-job-controller_test.js index 1dfd19d4fb3..2f4ad7bd721 100644 --- a/api/tests/prescription/campaign-participation/unit/application/jobs/participation-shared-job-controller_test.js +++ b/api/tests/prescription/campaign-participation/unit/application/jobs/participation-shared-job-controller_test.js @@ -1,5 +1,5 @@ -import { usecases } from '../../../../../../lib/domain/usecases/index.js'; import { ParticipationSharedJobController } from '../../../../../../src/prescription/campaign-participation/application/jobs/participation-shared-job-controller.js'; +import { usecases } from '../../../../../../src/prescription/campaign-participation/domain/usecases/index.js'; import { expect, sinon } from '../../../../../test-helper.js'; describe('Unit | Prescription | Application | Jobs | participationSharedJobController', function () { diff --git a/api/tests/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js b/api/tests/prescription/campaign-participation/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js similarity index 94% rename from api/tests/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js rename to api/tests/prescription/campaign-participation/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js index a70b7ceb6b3..286a820a5fa 100644 --- a/api/tests/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js +++ b/api/tests/prescription/campaign-participation/unit/domain/usecases/send-shared-participation-results-to-pole-emploi_test.js @@ -1,8 +1,8 @@ -import { sendSharedParticipationResultsToPoleEmploi } from '../../../../lib/domain/usecases/send-shared-participation-results-to-pole-emploi.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'; -import { domainBuilder, expect, sinon } from '../../../test-helper.js'; +import { PoleEmploiSending } from '../../../../../../src/prescription/campaign-participation/domain/models/PoleEmploiSending.js'; +import { sendSharedParticipationResultsToPoleEmploi } from '../../../../../../src/prescription/campaign-participation/domain/usecases/send-shared-participation-results-to-pole-emploi.js'; +import { PoleEmploiPayload } from '../../../../../../src/prescription/campaign-participation/infrastructure/externals/pole-emploi/PoleEmploiPayload.js'; +import { config } from '../../../../../../src/shared/config.js'; +import { domainBuilder, expect, sinon } from '../../../../../test-helper.js'; describe('Unit | Domain | UseCase | send-shared-participation-results-to-pole-emploi', function () { let dependencies, expectedResults;