class ProjectDetailsServiceImpl extends AbstractProjectServiceImpl implements ProjectDetailsService {

    @Override
    @Transactional
    public ServiceResult<Void> updateProjectDuration(long projectId, long durationInMonths) {
        return getProject(projectId).andOnSuccess(project ->
            validateProjectDuration(durationInMonths).
            andOnSuccess(() -> validateIfProjectDurationCanBeChanged(project)).
            andOnSuccessReturnVoid(() -> project.setDurationInMonths(durationInMonths)));
    }

}