Skip to content

Commit

Permalink
[TECH] Migrer les résultats partagés et complétés à Pôle Emploi vers …
Browse files Browse the repository at this point in the history
…le contexte Prescription (Pix-15339)

 #10813
  • Loading branch information
pix-service-auto-merge authored Dec 16, 2024
2 parents 70c5490 + 3871eb6 commit f8fa855
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 31 deletions.
2 changes: 0 additions & 2 deletions api/lib/domain/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -53,7 +52,6 @@ const dependencies = {
authenticationMethodRepository,
badgeAcquisitionRepository,
campaignRepository,
campaignParticipationResultRepository,
certificationAssessmentHistoryRepository,
certificationAssessmentRepository,
certificationCenterRepository,
Expand Down
2 changes: 0 additions & 2 deletions api/lib/domain/usecases/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -212,7 +211,6 @@ const dependencies = {
campaignManagementRepository,
participationCompletedJobRepository,
campaignParticipationRepository,
campaignParticipationResultRepository,
campaignProfileRepository,
campaignRepository,
centerRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ 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';
import * as userRepository from '../../src/identity-access-management/infrastructure/repositories/user.repository.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 * 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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -96,6 +97,7 @@ const dependencies = {
campaignParticipantRepository: campaignRepositories.campaignParticipantRepository,
campaignParticipationOverviewRepository,
campaignParticipationRepository,
campaignParticipationResultRepository,
campaignProfileRepository,
campaignRepository,
targetProfileRepository,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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,
knex,
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit f8fa855

Please sign in to comment.