class ProjectTeamServiceImpl extends AbstractProjectServiceImpl implements ProjectTeamService {

    @Override
    @Transactional
    public ServiceResult<Void> removeUser(ProjectUserCompositeId composite) {
        return getProject(composite.getProjectId()).andOnSuccess(
                project -> validateUserNotPm(project, composite.getUserId()).andOnSuccess(
                        () -> validateUserNotFc(project, composite.getUserId()).andOnSuccess(
                                () -> validateUserNotRemovingThemselves(composite.getUserId()).andOnSuccess(
                                        () -> migrateProcessesFromUserIfNecessary(composite.getUserId(), project).andOnSuccess(
                                                migratedProject -> removeUserFromProject(composite.getUserId(), migratedProject)))
                        )));
    }

    public  ProjectTeamServiceImpl();

}