class ConvocationService {

    public void cancelConvocation(Convocation convocation) {

        if (convocation.isCancelled()) {
            LOGGER.error("Try to cancel an already cancelled convocation : {}", convocation.getUuid());
            throw new ConvocationCancelledException();
        }
        convocation.setCancelled(true);
        convocation.setCancellationDate(LocalDateTime.now());
        convocationRepository.save(convocation);
        addHistory(convocation, HistoryType.CANCELLED);
        applicationEventPublisher.publishEvent(new ConvocationCancelledEvent(this, convocation));
    }

    @Autowired public  ConvocationService(
            ConvocationRepository convocationRepository,
            LocalAuthorityService localAuthorityService,
            StorageService storageService,
            ExternalRestService externalRestService,
            LocalesService localesService,
            TagService tagService,
            RecipientResponseRepository recipientResponseRepository,
            QuestionResponseRepository questionResponseRepository,
            AttachmentRepository attachmentRepository,
            ApplicationEventPublisher applicationEventPublisher,
            PdfGeneratorUtil pdfGeneratorUtil);

}