Skip to content

Commit

Permalink
♻️ refactor(api): move session summaries usecase to src
Browse files Browse the repository at this point in the history
  • Loading branch information
yaf committed Dec 17, 2024
1 parent 0cd941b commit dab22cd
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as divisionSerializer from '../../../src/prescription/campaign/infrastr
import * as certificationCenterMembershipSerializer from '../../../src/shared/infrastructure/serializers/jsonapi/certification-center-membership.serializer.js';
import { usecases as teamUsecases } from '../../../src/team/domain/usecases/index.js';
import { usecases } from '../../domain/usecases/index.js';
import * as sessionSummarySerializer from '../../infrastructure/serializers/jsonapi/session-summary-serializer.js';
import * as studentCertificationSerializer from '../../infrastructure/serializers/jsonapi/student-certification-serializer.js';

const getStudents = async function (request) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { usecases } from '../domain/usecases/index.js';
import * as sessionSummarySerializer from '../infrastructure/serializers/session-summary-serializer.js';
import { usecases } from '../../../../lib/domain/usecases/index.js';

const findPaginatedSessionSummaries = async function (request) {
const certificationCenterId = request.params.id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Joi from 'joi';

import { certificationCenterController } from '../../../../lib/application/certification-centers/certification-center-controller.js';
import { certificationCenterController } from '../../../../src/certification/session-management/application/certification-centers-session-summaries-controller.js';
import { identifiersType } from '../../../shared/domain/types/identifiers-type.js';

const register = async function (server) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForbiddenAccess } from '../../../src/shared/domain/errors.js';
import { ForbiddenAccess } from '../../../../../src/shared/domain/errors.js';

const findPaginatedCertificationCenterSessionSummaries = async function ({
userId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { certificationCenterController } from '../../../../../src/certification/session-management/application/certification-centers-session-summaries-controller.js';
import { usecases } from '../../../../../lib/domain/usecases/index.js';
import { usecases } from '../../../../../src/certification/session-management/domain/usecases/index.js';
import { domainBuilder, expect, hFake, sinon } from '../../../../test-helper.js';

describe('Unit | Controller | certifications-center-controller', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { certificationCenterController } from '../../../../../lib/application/certification-centers/certification-center-controller.js';
import * as moduleUnderTest from '../../../../../src/certification/session-management/application/certification-centers-session-summaries.route.js';
import { certificationCenterController } from '../../../../../src/certification/session-management/application/certification-centers-session-summaries-controller.js';
import * as moduleUnderTest from '../../../../../src/certification/session-management/application/certification-centers-session-summaries-route.js';
import { expect, HttpTestServer, sinon } from '../../../../test-helper.js';

describe('Certification | Session-management | Unit | Application | Routes | session-summaries', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { findPaginatedCertificationCenterSessionSummaries } from '../../../../lib/domain/usecases/find-paginated-certification-center-session-summaries.js';
import { ForbiddenAccess } from '../../../../src/shared/domain/errors.js';
import { catchErr, domainBuilder, expect, sinon } from '../../../test-helper.js';
import { findPaginatedCertificationCenterSessionSummaries } from '../../../../../../src/certification/session-management/domain/usecases/find-paginated-certification-center-session-summaries.js';
import { ForbiddenAccess } from '../../../../../../src/shared/domain/errors.js';
import { catchErr, domainBuilder, expect, sinon } from '../../../../../test-helper.js';

describe('Unit | Domain | Use Cases | find-paginated-certification-center-session-summaries', function () {
const sessionSummaryRepository = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { certificationCenterController } from '../../../../lib/application/certification-centers/certification-center-controller.js';
import * as moduleUnderTest from '../../../../src/certification/session-management/application/certification-centers-session-summaries.route.js';
import * as moduleUnderTest from '../../../../lib/application/certification-centers/index.js';
import { securityPreHandlers } from '../../../../src/shared/application/security-pre-handlers.js';
import { expect, HttpTestServer, sinon } from '../../../test-helper.js';

Expand Down

0 comments on commit dab22cd

Please sign in to comment.