Skip to content

Commit

Permalink
fix: removed unused entitys
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusvieirah committed Aug 24, 2023
1 parent 26318b7 commit 74c7eac
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 349 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,25 @@
package org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.impl;

import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedCapacityGroupRequest;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.CustomerEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.SupplierEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedCapacityGroupEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.jsonEntities.Capacity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.jsonEntities.DemandCategory;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.jsonEntities.LikedDemandSeries;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.jsonEntities.WeekBasedCapacityGroup;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.BadRequestException;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.CustomerRepository;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.WeekBasedCapacityGroupRepository;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedCapacityGroupService;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@RequiredArgsConstructor
@Service
public class WeekBasedCapacityGroupServiceImpl implements WeekBasedCapacityGroupService {

private final WeekBasedCapacityGroupRepository weekBasedCapacityGroupRepository;

private final CustomerRepository customerRepository;

@Override
public void createWeekBasedCapacityGroup(List<WeekBasedCapacityGroupRequest> weekBasedCapacityGroupRequestList) {
weekBasedCapacityGroupRequestList.forEach(
Expand All @@ -75,19 +65,21 @@ public void receiveWeekBasedCapacityGroup() {

@Override
public void sendWeekBasedCapacityGroup() {
Optional<CustomerEntity> supplierEntityOpt = customerRepository.findById(1l);

//TODO we still dont have defined the demand or the capacity structure yet, this is just an example of the flux
if (supplierEntityOpt.isPresent()) {
CustomerEntity supplierEntity = supplierEntityOpt.get();

//todo put this part of the code in the ConsumerHTTP class
RestTemplate restTemplate = new RestTemplate();
String fooResourceUrl = supplierEntity.getEdcUrl();

//TODO create the Actual Demand and send to the supplier
ResponseEntity<String> response = restTemplate.getForEntity(fooResourceUrl, String.class);
}
// Optional<CustomerEntity> supplierEntityOpt = customerRepository.findById(1l);
//
// //TODO we still dont have defined the demand or the capacity structure yet, this is just an example of the flux
// if (supplierEntityOpt.isPresent()) {
// //todo change this to company entity
// //CustomerEntity supplierEntity = supplierEntityOpt.get();
//
// //todo put this part of the code in the ConsumerHTTP class
// RestTemplate restTemplate = new RestTemplate();
//
// //String fooResourceUrl = supplierEntity.getEdcUrl();
//
// //TODO create the Actual Demand and send to the supplier
// ResponseEntity<String> response = restTemplate.getForEntity("", String.class);
// }
}

private void validateFields(WeekBasedCapacityGroupRequest weekBasedCapacityGroupRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,17 @@

import eclipse.tractusx.demand_capacity_mgmt_specification.model.WeekBasedMaterialDemandRequestDto;
import java.util.List;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.MaterialDemandEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.SupplierEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.WeekBasedMaterialDemandEntity;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.exceptions.BadRequestException;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.SupplierRepository;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.repositories.WeekBasedMaterialDemandRepository;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.LinkDemandService;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.WeekBasedMaterialService;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.DataConverterUtil;
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.utils.UUIDUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@RequiredArgsConstructor
@Service
Expand All @@ -48,7 +43,6 @@ public class WeekBasedMaterialServiceImpl implements WeekBasedMaterialService {

private final WeekBasedMaterialDemandRepository weekBasedMaterialDemandRepository;

private final SupplierRepository supplierRepository;

private final LinkDemandService linkDemandService;

Expand All @@ -68,16 +62,17 @@ public void createWeekBasedMaterial(List<WeekBasedMaterialDemandRequestDto> week

@Override
public void sendWeekBasedMaterial() {
Optional<SupplierEntity> supplierEntityOpt = supplierRepository.findById(1l);

if (supplierEntityOpt.isPresent()) {
SupplierEntity supplierEntity = supplierEntityOpt.get();
RestTemplate restTemplate = new RestTemplate();
String fooResourceUrl = supplierEntity.getEdcUrl();

//TODO create the Actual Demand and send to the supplier
ResponseEntity<String> response = restTemplate.getForEntity(fooResourceUrl, String.class);
}
// Optional<SupplierEntity> supplierEntityOpt = supplierRepository.findById(1l);
//
// if (supplierEntityOpt.isPresent()) {
// SupplierEntity supplierEntity = supplierEntityOpt.get();
// RestTemplate restTemplate = new RestTemplate();
// String fooResourceUrl = supplierEntity.getEdcUrl();
//
// //TODO create the Actual Demand and send to the supplier
// ResponseEntity<String> response = restTemplate.getForEntity(fooResourceUrl, String.class);
// }
}

@Override
Expand Down
Loading

0 comments on commit 74c7eac

Please sign in to comment.