class EuGrantTransferServiceImpl implements EuGrantTransferService {

    @Override
    @Transactional
    public ServiceResult<Void> deleteGrantAgreement(long applicationId) {
        return findGrantTransferByApplicationId(applicationId).andOnSuccess(grantTransfer -> {
            long fileId = grantTransfer.getGrantAgreement().getId();
            return fileService.deleteFileIgnoreNotFound(fileId).andOnSuccessReturnVoid(() ->
                    grantTransfer.setGrantAgreement(null)
            );
        });
    }

}