import { Criteria } from '../../../../Shared/domain/criteria/Criteria' ; import { Filters } from '../../../../Shared/domain/criteria/Filters' ; import { Order } from '../../../../Shared/domain/criteria/Order' ; import { BackofficeCourseRepository } from '../../domain/BackofficeCourseRepository' ; import { BackofficeCoursesResponse } from '../BackofficeCoursesResponse' ; export class CoursesByCriteriaSearcher { constructor ( private repository ) { } async run ( filters , order , limit ? , offset ? ) { const criteria = new Criteria ( filters , order , limit , offset ) ; const courses = await this . repository . matching ( criteria ) ; return new BackofficeCoursesResponse ( courses ) ; } }