class SpendProfileServiceImpl extends BaseTransactionalService implements SpendProfileService {

    @Override
    @Transactional
    public ServiceResult<Void> deleteSpendProfile(Long projectId) {
        List<SpendProfile> spendProfiles = spendProfileRepository.findByProjectId(projectId);

        Project project = getProject(projectId).getSuccess();
        project.getSpendProfiles().removeAll(spendProfiles);
        project.setSpendProfileSubmittedDate(null);

        spendProfileRepository.deleteAll(spendProfiles);
        spendProfileWorkflowHandler.spendProfileDeleted(getProject(projectId).getSuccess(), getCurrentlyLoggedInUser().getSuccess());
        return serviceSuccess();
    }

}