Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Feat/docker images #34

Closed
wants to merge 174 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
4b77854
merge events table files
OSousa117 Oct 6, 2023
b4ce755
remove testes temporarily
OSousa117 Oct 6, 2023
5d2e747
remove info menu temp
OSousa117 Oct 6, 2023
9ca4f9c
Merge branch 'DCMFOSS/72_Fixed' into 62_63_merged
OSousa117 Oct 6, 2023
29fb538
Merge branch 'feature/DCMFOSS-74' into 62_63_merged
OSousa117 Oct 6, 2023
45836bf
synch repos
OSousa117 Oct 9, 2023
e88e2ed
refactored statuses service class
sajaadem Oct 9, 2023
7f73064
Login / Logout fixes
OSousa117 Oct 9, 2023
7a320a5
top menu info
OSousa117 Oct 9, 2023
e97ce3a
small lint
OSousa117 Oct 9, 2023
27bed38
Merge branch 'feature/DCMFOSS-67-copy2' into 62_63_74_synch
OSousa117 Oct 9, 2023
ff4a5a8
MERGE 67
OSousa117 Oct 9, 2023
0659c07
status integration fix
OSousa117 Oct 9, 2023
2177c5b
remove logs
OSousa117 Oct 9, 2023
c378f38
Front end routing fix
Ruskyy Oct 9, 2023
1d84f39
Quick page fix, for menus
Ruskyy Oct 9, 2023
2b8d852
Merge branch 'refactoring-statuses-service' into statuses_demo_requir…
sajaadem Oct 10, 2023
b179817
commit sql inits
OSousa117 Oct 10, 2023
edebc3c
fixed Initial DB issue
OSousa117 Oct 10, 2023
00b1bf8
NEEDS FIX IN HERE
OSousa117 Oct 10, 2023
9b9f564
added link_status param
sajaadem Oct 10, 2023
aaec3e0
Naming Fix
Ruskyy Oct 10, 2023
0262fd8
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 10, 2023
c31d99a
Merge remote-tracking branch 'origin/statuses_demo_requirment' into D…
OSousa117 Oct 10, 2023
9ca3730
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 10, 2023
ce360bc
fixed sql
OSousa117 Oct 10, 2023
6180df6
fix linkage
OSousa117 Oct 10, 2023
2a2cbc6
Login Form improvement + Fonts and SVG
Ruskyy Oct 10, 2023
a1d64be
DIf loader animation
Ruskyy Oct 10, 2023
52479cd
Username bugfix, events table and Imports
Ruskyy Oct 11, 2023
8ec9c70
Error Page Implementation
Ruskyy Oct 11, 2023
1e462e5
EasterEgg
Ruskyy Oct 11, 2023
1ddc08e
Update Auth.css
Ruskyy Oct 11, 2023
36a467d
Cors filter on top
OSousa117 Oct 11, 2023
043fd6c
Quick UI fix
Ruskyy Oct 11, 2023
439434c
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 11, 2023
0fd7fdc
remove cookies.
OSousa117 Oct 11, 2023
f87d524
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 11, 2023
7c131b3
push bearer token flow
OSousa117 Oct 12, 2023
5789e17
push fixes
OSousa117 Oct 12, 2023
41b400a
fixed storage
OSousa117 Oct 12, 2023
cfe67b5
remove anoying console logs
OSousa117 Oct 12, 2023
dcc25a6
Event Log
Ruskyy Oct 12, 2023
66e9c47
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 12, 2023
68edc50
Events on capacity groups
Ruskyy Oct 12, 2023
f98dc1e
fix: Interface SingleCapacityGroup Modified
Bailonis Oct 12, 2023
cdfb354
add: SingleCapacityGroup and CapacityBody json Added to openapi.yaml
Bailonis Oct 12, 2023
d5956e9
Refresh mechanism
Ruskyy Oct 12, 2023
68ab044
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 12, 2023
c69f0eb
Menu Animation
Ruskyy Oct 12, 2023
29b1b7a
Quick fix + Front end session fix
Ruskyy Oct 12, 2023
638b71c
Update DemandsOverview.tsx
Ruskyy Oct 12, 2023
4c53443
Add to existing.. UI fix
Ruskyy Oct 12, 2023
637440b
Demands add message fix
Ruskyy Oct 12, 2023
0ecd3da
update token convention
OSousa117 Oct 13, 2023
3bf9433
Events Search by List and User Input
Ruskyy Oct 13, 2023
bbea6f0
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 13, 2023
3c280ca
add nomenclature to tokens and refresh tokens
OSousa117 Oct 13, 2023
8d50ce5
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 13, 2023
4b8762d
Archive and Navigate
Ruskyy Oct 13, 2023
f6124b8
refresh session
OSousa117 Oct 13, 2023
554d076
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 13, 2023
f84f034
fix: Capacitygroup connection to backend
Bailonis Oct 13, 2023
542c22d
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Bailonis Oct 13, 2023
ac93108
Root Container Fix
Ruskyy Oct 13, 2023
611cd88
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 13, 2023
ed2804b
Fix height
Ruskyy Oct 13, 2023
9a7d88a
fix: small changes
Bailonis Oct 13, 2023
c74c5e5
Alerts Up Down A B A B Select Start
Ruskyy Oct 13, 2023
bb0fd3d
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 13, 2023
cdb7589
Layout Fix
Ruskyy Oct 13, 2023
03252fb
feat: added capacityGroup conection frontend with backend
Bailonis Oct 13, 2023
e4cb6af
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Bailonis Oct 13, 2023
e372e22
Autofocus.. and spell casting
Ruskyy Oct 14, 2023
6b0cb77
Voldemort has been killed
Ruskyy Oct 14, 2023
587e505
Working !
Ruskyy Oct 14, 2023
3817d2d
Demo Ready
Ruskyy Oct 14, 2023
561b3be
Multiple Sums on CCO, and LinkStatus on all Tables
Ruskyy Oct 15, 2023
d237ab9
Units of Measure, and sucess creation message..
Ruskyy Oct 15, 2023
da6fcf4
status service refactor
sajaadem Oct 17, 2023
8573167
Merge remote-tracking branch 'origin/statuses_demo_requirment' into D…
OSousa117 Oct 17, 2023
84c04f8
merge statuses
OSousa117 Oct 17, 2023
cbdbd8c
refactored statuses branch alterations
OSousa117 Oct 17, 2023
0a762a8
remove comment
OSousa117 Oct 17, 2023
89344c3
BRANCH-92 FIX
OSousa117 Oct 17, 2023
44e42d6
Merge remote-tracking branch 'upstream/main' into Demo_branch
OSousa117 Oct 17, 2023
22ef94c
de-lambdify
OSousa117 Oct 17, 2023
051b455
various fixes
OSousa117 Oct 17, 2023
08b43ee
small alignement
OSousa117 Oct 17, 2023
91f336f
commit db fix
OSousa117 Oct 19, 2023
b7378aa
fix user log creation setting
OSousa117 Oct 19, 2023
f70c768
post logs link
OSousa117 Oct 19, 2023
d829e9c
Linked Fixed.
Ruskyy Oct 19, 2023
b91547c
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 19, 2023
98325c6
fix event type
OSousa117 Oct 19, 2023
b3c1d34
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 19, 2023
788422e
made status tables script
OSousa117 Oct 19, 2023
7669521
Add and eslint warning cleanup
Ruskyy Oct 19, 2023
1a7492f
Favorites backbone reestructre
OSousa117 Oct 19, 2023
55b6360
backend crash fix
OSousa117 Oct 20, 2023
d8815c8
more fix
OSousa117 Oct 20, 2023
bae5157
fix crash
OSousa117 Oct 20, 2023
ee181b0
favorites data view
OSousa117 Oct 20, 2023
9887fc3
fixed statuses issues
sajaadem Oct 20, 2023
debbe21
fixed todo word
sajaadem Oct 20, 2023
50e53a4
Merge branch 'statuses-fixes' into Demo_branch
OSousa117 Oct 20, 2023
737f490
Global fixes and alignements
OSousa117 Oct 20, 2023
719fbd7
TopMenu Auto Refresh
Ruskyy Oct 20, 2023
02749d8
fixed statuses imporovement and degradation
sajaadem Oct 20, 2023
68b237f
InfoMenu update fix.
Ruskyy Oct 21, 2023
5f0caa4
general fixes
OSousa117 Oct 21, 2023
ce1148a
fix status not updating
OSousa117 Oct 21, 2023
2d6fc4b
Info menu and CG Demand List Status
Ruskyy Oct 21, 2023
6b0eefd
Status rework
OSousa117 Oct 22, 2023
aef2fe6
placeholder calculus status
OSousa117 Oct 22, 2023
2e885f0
Delta, Sums and Todo Filter
Ruskyy Oct 22, 2023
73a0c29
Order fixing and Chart colors
Ruskyy Oct 23, 2023
7fb93e2
statuses v1
OSousa117 Oct 24, 2023
bc98213
Dropdown menus structure + Handle Edit
Ruskyy Oct 25, 2023
b222793
favorites demand table
OSousa117 Oct 26, 2023
e1849dc
Add form Required handling and Optimization
Ruskyy Oct 26, 2023
d861b89
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 26, 2023
e8ae575
modal favorites
OSousa117 Oct 26, 2023
1563fc7
events favorites
OSousa117 Oct 26, 2023
5bfa8f4
fix logs stuff
OSousa117 Oct 26, 2023
a579dbf
Edit form Css and AppComponents
Ruskyy Oct 26, 2023
4d2ae90
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 26, 2023
bf6e97e
favs fix
OSousa117 Oct 26, 2023
f510fe5
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 26, 2023
dae5242
Favorites Integration on UI
Ruskyy Oct 26, 2023
8172396
refactored favorites and company counters
OSousa117 Oct 27, 2023
d91f4f7
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
OSousa117 Oct 27, 2023
9c3d706
Favorites Tables and Implementation
Ruskyy Oct 27, 2023
1d1087f
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 27, 2023
5700899
add missing table
OSousa117 Oct 27, 2023
4fbe007
cgID
OSousa117 Oct 27, 2023
5dd9b16
commit average and top companies
OSousa117 Oct 27, 2023
83d9524
Top Companies
Ruskyy Oct 27, 2023
d6175a8
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 27, 2023
143e4cd
Fixes and Wizard
Ruskyy Oct 29, 2023
74e4492
update status manager
OSousa117 Oct 30, 2023
304502d
favorite status
OSousa117 Oct 30, 2023
049dac2
update status machine calculus
OSousa117 Oct 30, 2023
0ad17f9
fix statues
OSousa117 Oct 30, 2023
aa7227c
updates to status
OSousa117 Oct 30, 2023
86d8b39
pushed statuses todos and favorite counts
OSousa117 Oct 30, 2023
debce57
push login fix and fetch fix
OSousa117 Oct 30, 2023
5fe538c
fix roles stuff
OSousa117 Oct 30, 2023
51980f2
invert roles
OSousa117 Oct 30, 2023
b4e4dfc
admin role fixes
OSousa117 Oct 31, 2023
63dff94
Admin Dashboard
Ruskyy Oct 31, 2023
281e058
Merge branch 'Demo_branch' of https://github.com/catenax-ng/tx-demand…
Ruskyy Oct 31, 2023
619895c
fix maven error
OSousa117 Oct 31, 2023
0e0514c
Admin Panel
Ruskyy Oct 31, 2023
7da4931
Address book table script
OSousa117 Nov 3, 2023
0a55208
Classes
OSousa117 Nov 6, 2023
e79a4c7
Console Log cleanup
Ruskyy Nov 6, 2023
8d019a7
fix: resolved typo in InfoMenuContextProvider
Bailonis Nov 7, 2023
0e6cd6c
v0.9
OSousa117 Nov 8, 2023
bad61e1
address book crud
OSousa117 Nov 8, 2023
660ad2b
Role based access
OSousa117 Nov 8, 2023
971c56c
Admin Help File
Ruskyy Nov 9, 2023
333fe26
addressBook fixes
OSousa117 Nov 10, 2023
0c8c71f
-UserRoles an rights
Ruskyy Nov 14, 2023
c9e6fb8
user edit + keycloak fix
OSousa117 Nov 14, 2023
cf46afa
Merge branch 'DCMFOSS_42_43' into Demo_branch
OSousa117 Nov 15, 2023
115ea41
fetch by company ID on customer side.
OSousa117 Nov 15, 2023
ded6246
get all users
OSousa117 Nov 15, 2023
cdf8bd1
user company fix
OSousa117 Nov 15, 2023
4ad8f83
Search and Pagination fixed - Usernames too
Ruskyy Nov 15, 2023
98d51d2
Minor Changes
Ruskyy Nov 16, 2023
3ea3d9a
fix: Build - Docker image workflow
Bailonis Nov 16, 2023
240aac0
Delete Dockerfile
Bailonis Nov 16, 2023
93b8542
Create Dockerfile
Bailonis Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions .github/workflows/build-master-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@
# ********************************************************************************


name: build-and-push-image-backend
name: Build - Docker image (SemVer)

on:
push:
paths:
- 'demand-capacity-mgmt-backend/**'
- 'demand-capacity-mgmt-specification/**'
branches:
- 'main'
- main
tags:
- 'v*.*.*'
- 'v*.*.*-*'
pull_request:
branches:
- main

env:
IMAGE_NAME: 'demand-capacity-mgmt-backend'
REGISTRY: 'docker.io'
IMAGE_NAMESPACE: 'tractusx'


Expand All @@ -49,46 +48,49 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Run Tests
run: ./demand-capacity-mgmt-backend/mvnw -B test

- name: Build
run: mvn -B package

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver ,pattern={{major}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push Docker image
uses: docker/build-push-action@v4
- name: DockerHub login
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
# Use existing DockerHub credentials present as secrets
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./build/backend/Dockerfile
#push: ${{ github.event_name != 'pull_request' }}
push: true
# build tag :latest
tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.meta.outputs.tags }},
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}


# https://github.com/peter-evans/dockerhub-description
# Important step to push image description to DockerHub
- name: Update Docker Hub description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
# readme-filepath defaults to toplevel README.md, Only necessary if you have a dedicated file with your 'Notice for docker images'
readme-filepath: DOCKER_NOTICE.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
87 changes: 0 additions & 87 deletions .github/workflows/build-master-frontend.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ target/

demand-capacity-mgmt-backend/.mvn/wrapper/maven-wrapper.jar
.env
keycloak/generate-secret.sh
keycloak/init-db.sql
keycloak/realm-export.json
keycloak/

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ USER root
RUN microdnf install -y jq wget

# Copy the scripts to the container
COPY keycloak/generate-secret.sh /config/generate-secret.sh
#COPY keycloak/generate-secret.sh /config/generate-secret.sh

# Make the scripts executable
RUN chmod +x /config/generate-secret.sh
#RUN chmod +x /config/generate-secret.sh

# Switch back to the jboss user
USER jboss
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* ******************************************************************************
* Copyright (c) 2023 BMW AG
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
* *******************************************************************************
*/

package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.controllers;

import eclipse.tractusx.demand_capacity_mgmt_specification.api.AddressBookApi;
import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookRequest;
import eclipse.tractusx.demand_capacity_mgmt_specification.model.AddressBookResponse;
import jakarta.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.AddressBookService;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@AllArgsConstructor
public class AddressBookController implements AddressBookApi {

private final AddressBookService service;
private HttpServletRequest request;

@Override
public ResponseEntity<Void> deleteAddressBook(AddressBookRequest addressBookRequest) throws Exception {
if(UserUtil.getUserRole(request).equals(Role.ADMIN)){
service.deleteRecord(addressBookRequest);
return ResponseEntity.status(201).build();
}
return ResponseEntity.status(401).build();

}

@Override
public ResponseEntity<AddressBookResponse> getAddressBook(AddressBookRequest addressBookRequest) throws Exception {
return ResponseEntity.status(200).body(service.getRecord(addressBookRequest));
}

@Override
public ResponseEntity<List<AddressBookResponse>> getAllAddressBooks() throws Exception {
return ResponseEntity.status(200).body(service.getRecords());
}

@Override
public ResponseEntity<AddressBookResponse> postAddressBook(AddressBookRequest addressBookRequest) throws Exception {
return ResponseEntity.status(200).body(service.postRecord(addressBookRequest));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,49 @@

import eclipse.tractusx.demand_capacity_mgmt_specification.api.CapacityGroupApi;
import eclipse.tractusx.demand_capacity_mgmt_specification.model.*;
import java.util.List;
import jakarta.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.Role;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CapacityGroupService;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UserUtil;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@AllArgsConstructor
public class CapacityGroupsController implements CapacityGroupApi {

private CapacityGroupService service;
private HttpServletRequest request;

@Override
public ResponseEntity<List<CapacityGroupDefaultViewResponse>> getCapacityGroups() {
List<CapacityGroupDefaultViewResponse> capacityGroupDefaultViewResponses = service.getAll();
String userID = UserUtil.getUserID(request);
Role userRole = UserUtil.getUserRole(request);
List<CapacityGroupDefaultViewResponse> capacityGroupDefaultViewResponses = service.getAll(userID,userRole);
return ResponseEntity.status(HttpStatus.OK).body(capacityGroupDefaultViewResponses);
}

@Override
public ResponseEntity<CapacityGroupResponse> getCapacityGroupById(String capacityGroupId) {
CapacityGroupResponse capacityGroupResponse = service.getCapacityGroupById(capacityGroupId);
public ResponseEntity<SingleCapacityGroup> getCapacityGroupById(String capacityGroupId) {
SingleCapacityGroup capacityGroupResponse = service.getCapacityGroupById(capacityGroupId);
return ResponseEntity.status(HttpStatus.OK).body(capacityGroupResponse);
}

@Override
public ResponseEntity<CapacityGroupResponse> postCapacityGroup(CapacityGroupRequest capacityGroupRequest) {
CapacityGroupResponse capacityGroupResponse = service.createCapacityGroup(capacityGroupRequest);
String userID = UserUtil.getUserID(request);
CapacityGroupResponse capacityGroupResponse = service.createCapacityGroup(capacityGroupRequest, userID);
return ResponseEntity.status(HttpStatus.OK).body(capacityGroupResponse);
}

@Override
public ResponseEntity<Void> postLinkedCapacityGroupDemand(LinkCGDSRequest linkCGDSRequest) throws Exception {
service.linkCapacityGroupToMaterialDemand(linkCGDSRequest);
String userID = UserUtil.getUserID(request);
service.linkCapacityGroupToMaterialDemand(linkCGDSRequest, userID);
return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import eclipse.tractusx.demand_capacity_mgmt_specification.api.CompanyApi;
import eclipse.tractusx.demand_capacity_mgmt_specification.model.CompanyDto;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import java.util.List;
import lombok.AllArgsConstructor;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.CompanyService;
Expand All @@ -43,4 +42,10 @@ public ResponseEntity<List<CompanyDto>> getCompany() throws Exception {
List<CompanyDto> companyDtoList = companyService.getAllCompany();
return ResponseEntity.status(HttpStatus.OK).body(companyDtoList);
}

@Override
public ResponseEntity<List<CompanyDto>> getTopCompanies() throws Exception {
List<CompanyDto> companyDtoList = companyService.getTopCompanies();
return ResponseEntity.status(HttpStatus.OK).body(companyDtoList);
}
}
Loading
Loading