Skip to content

Commit

Permalink
Merge branch 'fixing/dcmfoss72' into DCMFOSS/72_Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Bailonis committed Oct 9, 2023
2 parents 486b991 + 84b1a45 commit 70c86e3
Show file tree
Hide file tree
Showing 7 changed files with 2,557 additions and 2,360 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import lombok.*;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.converters.ListToStringConverter;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.CapacityGroupStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* *******************************************************************************
* Copyright (c) 2023 BMW AG
* Copyright (c) 2023 Contributors to the Eclipse Foundation
Expand All @@ -24,7 +24,9 @@

import eclipse.tractusx.demand_capacity_mgmt_specification.model.*;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -75,6 +77,7 @@ public CapacityGroupResponse createCapacityGroup(CapacityGroupRequest capacityGr
@Override
public CapacityGroupResponse getCapacityGroupById(String capacityGroupId) {
CapacityGroupEntity capacityGroupEntity = getCapacityGroupEntity(capacityGroupId);

return convertCapacityGroupDto(capacityGroupEntity);
}

Expand Down Expand Up @@ -190,7 +193,7 @@ private CapacityGroupEntity enrichCapacityGroup(CapacityGroupRequest capacityGro
.map(
capacityRequest ->
enrichCapacityTimeSeries(
DataConverterUtil.convertFromString(capacityRequest.getCalendarWeek()),
LocalDate.parse(capacityRequest.getCalendarWeek()).atStartOfDay(),
capacityRequest.getActualCapacity().doubleValue(),
capacityRequest.getMaximumCapacity().doubleValue()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public FavoriteResponse updateFavorite(UUID id, FavoriteType type, FavoriteReque
entity.setType(FavoriteType.valueOf(favoriteRequest.getfType()));
favoriteRepository.saveAndFlush(entity);
return convertFavoriteResponse(entity);
} else {
throw new NotFoundException(
404,
"Entity to update was not found in DB." + "\n" + "Did you meant to create?",
new ArrayList<>(List.of("provided UUID did not match any records. - " + id))
);
}

} else throw new NotFoundException(
404,
"Demand category not found",
new ArrayList<>(List.of("provided UUID did not match any records. - " + id))
);

}

@Override
Expand All @@ -102,4 +102,4 @@ private FavoriteEntity generateFavoriteEntity(FavoriteRequest request, String co
.type(FavoriteType.valueOf(request.getfType()))
.build();
}
}
}
31 changes: 28 additions & 3 deletions demand-capacity-mgmt-frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,34 @@ function App() {
}


//Import Default always visible components.
import TopMenu from "./components/common/TopMenu";
import { InfoMenuProvider } from './contexts/InfoMenuContextProvider';
import QuickAcessItems from "./components/common/QuickAcessItems";
//Import Context Providers
import DemandContextProvider from "../src/contexts/DemandContextProvider";
// Import your components for different routes
import Home from "./components/pages/CapacityGroupPage";
import CapacityGroupDetailsPage from "./components/pages/CapacityGroupDetailsPage";
import CapacityGroupsProvider from './contexts/CapacityGroupsContextProvider';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<>
<App/>
</>
<>
<InfoMenuProvider>
<TopMenu></TopMenu>
</InfoMenuProvider>

<Router>
<Routes>
<Route path="/" element={<Home/>} />
<Route path="/details/:id" element={<CapacityGroupsProvider><CapacityGroupDetailsPage/></CapacityGroupsProvider>} />
<Route path="/contact" />
</Routes>
</Router>
<DemandContextProvider>
<QuickAcessItems></QuickAcessItems>
</DemandContextProvider>
</>

);
Loading

0 comments on commit 70c86e3

Please sign in to comment.