class QuestionFileSetupCompetitionServiceImpl implements QuestionFileSetupCompetitionService {

    @Override
    @Transactional
    public ServiceResult<Void> deleteTemplateFile(long questionId) {
        return findFormInputByQuestionId(questionId).andOnSuccess(formInput -> {
            long fileId = formInput.getFile().getId();
            return fileService.deleteFileIgnoreNotFound(fileId).andOnSuccessReturnVoid(() -> {
                formInput.setFile(null);
            });
        });
    }

}