Skip to content

Commit

Permalink
feat(orga): moved usecases files and changed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
alicegoarnisson committed Dec 13, 2024
1 parent 6adb0a1 commit 4fb86b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
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,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,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';
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit 4fb86b3

Please sign in to comment.