Skip to content

Commit

Permalink
invert roles
Browse files Browse the repository at this point in the history
  • Loading branch information
OSousa117 committed Oct 30, 2023
1 parent 5fe538c commit 51980f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ private StatusesEntity generateNewEntity(String userID) {
private List<MaterialDemandEntity> fetchDemandsBasedOnRole(UserEntity user, String userID) {
List<MaterialDemandEntity> demands = new ArrayList<>();

if (user.getRole().equals(Role.SUPPLIER)) {
if (user.getRole().equals(Role.CUSTOMER)) {
demands = materialDemandRepository.findAll() //TODO SUPPLIER AQUI findbysupplierID
.stream()
.filter(d -> d.getDemandSeries().stream().allMatch(series -> series.getDemandSeriesValues().stream().allMatch(value -> value.getDemand() == 0)))
.collect(Collectors.toList());
} else if (user.getRole().equals(Role.CUSTOMER)) {
} else if (user.getRole().equals(Role.SUPPLIER)) {
demands = materialDemandRepository.findAll() //TODO CUSTOMER AQUI findbycustomerID
.stream()
.filter(d -> d.getLinkStatus() == EventType.UN_LINKED)
Expand Down

0 comments on commit 51980f2

Please sign in to comment.