import CreateRequestUseCase from '@core/domain/request/usecase/CreateRequestUseCase' ; import { EventBus } from '@core/infrastructure/event/index' ; import CreateRequestEvent from './CreateRequestEvent' ; class CreateRequestEventHandler { useCase : CreateRequestUseCase ; constructor ( createRequestUseCase , eventBus ) { this . useCase = createRequestUseCase ; eventBus . on ( CreateRequestEvent . name ( ) , this . handleEvent . bind ( this ) ) ; } private handleEvent ( { id , url , validFrom } ) { this . useCase . createRequest ( id , url , validFrom ) ; } } export default CreateRequestEventHandler ;