import { Criteria } from '../../../../Shared/domain/criteria/Criteria' ; import { ElasticRepository } from '../../../../Shared/infrastructure/persistence/elasticsearch/ElasticRepository' ; import { BackofficeCourse } from '../../domain/BackofficeCourse' ; import { BackofficeCourseRepository } from '../../domain/BackofficeCourseRepository' ; export class ElasticBackofficeCourseRepository extends ElasticRepository < BackofficeCourse > implements BackofficeCourseRepository { async searchAll ( ) { return this . searchAllInElastic ( BackofficeCourse . fromPrimitives ) ; } async save ( course ) { return this . persist ( course . id . value , course ) ; } async matching ( criteria ) { return this . searchByCriteria ( criteria , BackofficeCourse . fromPrimitives ) ; } }