Skip to content

Commit

Permalink
[TECH] Migrer les usecases de copie des badges et paliers d'un profil…
Browse files Browse the repository at this point in the history
… cible (PIX-15675).

 #10788
  • Loading branch information
pix-service-auto-merge authored Dec 12, 2024
2 parents 72437c6 + 67221e4 commit e4ed3b1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dayjs from 'dayjs';

import { usecases } from '../../../../lib/domain/usecases/index.js';
import { evaluationUsecases } from '../../../evaluation/domain/usecases/index.js';
import * as organizationSerializer from '../../../organizational-entities/infrastructure/serializers/jsonapi/organization-serializer.js';
import { withTransaction } from '../../../shared/domain/DomainTransaction.js';
import { DomainTransaction } from '../../../shared/domain/DomainTransaction.js';
Expand Down Expand Up @@ -158,11 +158,11 @@ const copyTargetProfile = withTransaction(async (request) => {
targetProfileId: targetProfileIdToCopy,
});
await Promise.all([
await usecases.copyTargetProfileBadges({
await evaluationUsecases.copyTargetProfileBadges({
originTargetProfileId: targetProfileIdToCopy,
destinationTargetProfileId: copiedTargetProfileId,
}),
await usecases.copyTargetProfileStages({
await evaluationUsecases.copyTargetProfileStages({
originTargetProfileId: targetProfileIdToCopy,
destinationTargetProfileId: copiedTargetProfileId,
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { copyTargetProfileBadges } from '../../../../lib/domain/usecases/copy-target-profile-badges.js';
import * as badgeCriteriaRepository from '../../../../src/evaluation/infrastructure/repositories/badge-criteria-repository.js';
import * as badgeRepository from '../../../../src/evaluation/infrastructure/repositories/badge-repository.js';
import { withTransaction } from '../../../../src/shared/domain/DomainTransaction.js';
import { SCOPES } from '../../../../src/shared/domain/models/BadgeDetails.js';
import { catchErr, databaseBuilder, expect, knex } from '../../../test-helper.js';
import { copyTargetProfileBadges } from '../../../../../src/evaluation/domain/usecases/copy-target-profile-badges.js';
import * as badgeCriteriaRepository from '../../../../../src/evaluation/infrastructure/repositories/badge-criteria-repository.js';
import * as badgeRepository from '../../../../../src/evaluation/infrastructure/repositories/badge-repository.js';
import { withTransaction } from '../../../../../src/shared/domain/DomainTransaction.js';
import { SCOPES } from '../../../../../src/shared/domain/models/BadgeDetails.js';
import { catchErr, databaseBuilder, expect, knex } from '../../../../test-helper.js';

describe('Integration | UseCases | copy-badges', function () {
describe('when there are badges to copy for a target profile', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { copyTargetProfileStages } from '../../../../lib/domain/usecases/copy-target-profile-stages.js';
import * as stageRepository from '../../../../src/evaluation/infrastructure/repositories/stage-repository.js';
import { databaseBuilder, expect, knex } from '../../../test-helper.js';
import { copyTargetProfileStages } from '../../../../../src/evaluation/domain/usecases/copy-target-profile-stages.js';
import * as stageRepository from '../../../../../src/evaluation/infrastructure/repositories/stage-repository.js';
import { databaseBuilder, expect, knex } from '../../../../test-helper.js';

describe('Integration | UseCases | copy-stages', function () {
describe('Evaluation | Integration | Domain | UseCases | copy-stages', function () {
describe('when there are stages to copy from an origin to a destination target profile', function () {
it('should copy the stages', async function () {
// given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { copyTargetProfileBadges } from '../../../../lib/domain/usecases/copy-target-profile-badges.js';
import { domainBuilder, expect, sinon } from '../../../test-helper.js';
import { copyTargetProfileBadges } from '../../../../../src/evaluation/domain/usecases/copy-target-profile-badges.js';
import { domainBuilder, expect, sinon } from '../../../../test-helper.js';

describe('Unit | UseCase | copy-badges', function () {
let badgeRepositoryStub;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { copyTargetProfileStages } from '../../../../lib/domain/usecases/copy-target-profile-stages.js';
import { domainBuilder, expect, sinon } from '../../../test-helper.js';
import { copyTargetProfileStages } from '../../../../../src/evaluation/domain/usecases/copy-target-profile-stages.js';
import { domainBuilder, expect, sinon } from '../../../../test-helper.js';

describe('Unit | UseCase | copy-stages', function () {
describe('Evaluation | Unit | Domain | UseCase | copy-stages', function () {
let stageRepositoryStub;

beforeEach(function () {
Expand Down

0 comments on commit e4ed3b1

Please sign in to comment.