From 8608fe349b65d6713a5c36bc6ecb28fb7b4680eb Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 10 Apr 2025 15:51:26 +0200 Subject: [PATCH] Remove obsolete controllers and repositories. This commit deletes unused controllers like PremiseController and repos such as NodeRepository. It also introduces new DTOs, services, and updates existing ones for improved modularity and functionality. These changes streamline the codebase and enhance maintainability. --- .../bulk/BulkOperationController.java | 83 ++++++++++++-- .../calculation/CalculationController.java | 92 +++++++++++++++ .../calculation/PremiseController.java | 55 --------- .../ContainerRateController.java | 16 --- .../configuration/CountryController.java | 4 +- .../configuration/MatrixRateController.java | 16 --- .../configuration/NodeController.java | 4 +- .../configuration/PackagingController.java | 6 +- .../configuration/RateController.java | 101 +++++++++++++++++ .../report/ReportingController.java | 31 +++++ .../lcc/controller/users/GroupController.java | 23 +++- .../lcc/controller/users/UserController.java | 37 ++++-- .../lcc/dto/bulk/BulkProcessingType.java | 5 + .../de/avatic/lcc/dto/bulk/BulkStatus.java | 4 + .../lcc/dto/calculation/PremiseDTO.java | 4 - .../lcc/dto/calculation/PremiseState.java | 5 + .../avatic/lcc/dto/calculation/RouteDTO.java | 27 +++++ .../PremiseSearchResultDTO.java} | 18 +-- .../edit/CreateDestinationDTO.java | 30 +++++ .../dto/calculation/edit/DestinationDTO.java | 27 +++++ .../calculation/edit/PremiseDetailDTO.java | 84 ++++++++++++++ .../dto/calculation/edit/SetSupplierDTO.java | 41 +++++++ .../calculation/edit/update/MasterData.java | 4 + .../edit/update/MasterDataUpdateDTO.java | 38 +++++++ .../edit/update/MasterDataUpdateType.java | 5 + .../edit/update/data/AllUpdateDTO.java | 106 ++++++++++++++++++ .../edit/update/data/MaterialUpdateDTO.java | 40 +++++++ .../edit/update/data/PackagingUpdateDTO.java | 42 +++++++ .../edit/update/data/PriceUpdateDTO.java | 39 +++++++ .../dto/calculation/view/PremiseViewDTO.java | 45 ++++++++ ...ntryViewDTO.java => CountryDetailDTO.java} | 2 +- .../matrixrates/MatrixRateDTO.java | 4 + .../{NodeViewDTO.java => NodeDetailDTO.java} | 2 +- .../configuration/rates/ContainerRateDTO.java | 4 + .../avatic/lcc/dto/generic/NodeTypeDTO.java | 4 +- .../de/avatic/lcc/dto/generic/RouteType.java | 5 + .../avatic/lcc/dto/report/ContainerType.java | 5 + .../lcc/dto/report/ReportContainerDTO.java | 68 +++++++++++ .../de/avatic/lcc/dto/report/ReportDTO.java | 38 +++++++ .../avatic/lcc/dto/report/ReportEntryDTO.java | 22 ++++ .../lcc/dto/report/ReportPackagingDTO.java | 91 +++++++++++++++ .../lcc/dto/report/ReportPremisesDTO.java | 70 ++++++++++++ .../lcc/dto/report/ReportQuantityDTO.java | 37 ++++++ .../lcc/dto/report/ReportQuotaShareDTO.java | 51 +++++++++ .../lcc/dto/report/ReportRouteEntryDTO.java | 36 ++++++ .../java/de/avatic/lcc/model/users/Group.java | 4 + .../lcc/repos/CalculationJobRepository.java | 10 -- .../repos/CountryPropertyTypeRepository.java | 8 -- .../avatic/lcc/repos/CountryRepository.java | 9 -- .../lcc/repos/DistanceMatrixRepository.java | 10 -- .../avatic/lcc/repos/MaterialRepository.java | 10 -- .../de/avatic/lcc/repos/NodeRepository.java | 10 -- .../PackagingPropertyTypeRepository.java | 8 -- .../avatic/lcc/repos/PackagingRepository.java | 10 -- .../avatic/lcc/repos/PremissRepository.java | 11 -- .../lcc/repos/PropertySetRepository.java | 8 -- .../avatic/lcc/repos/SysGroupRepository.java | 9 -- .../lcc/repos/SysUserNodeRepository.java | 9 -- .../avatic/lcc/repos/SysUserRepository.java | 13 --- .../repos/SystemPropertyTypeRepository.java | 8 -- .../lcc/repos/ValidityPeriodRepository.java | 9 -- .../repositories/users/GroupRepository.java | 6 +- .../lcc/service/bulk/BulkExportService.java | 4 + .../bulk/BulkFileProcessingService.java | 18 ++- ...CalclationSearchStringAnalyzerService.java | 12 -- .../CalculationCreationService.java | 13 --- .../calculation/PremiseCreationService.java | 13 +++ .../PremiseSearchStringAnalyzerService.java | 12 ++ .../service/calculation/PremisesService.java | 32 +++++- .../configuration/ContainerRateService.java | 28 +++++ .../service/configuration/CountryService.java | 4 +- .../configuration/MatrixRateService.java | 24 ++++ .../service/configuration/NodeService.java | 6 +- .../configuration/StagedChangesService.java | 14 +++ .../country/CountryTransformerService.java | 6 +- .../generic/NodeDTOTransformer.java | 2 +- .../nodes/NodeViewDTOTransformer.java | 8 +- .../lcc/service/users/GroupService.java | 5 +- .../FileFormatNotSupportedException.java | 7 ++ src/main/resources/schema.sql | 4 +- 80 files changed, 1508 insertions(+), 327 deletions(-) create mode 100644 src/main/java/de/avatic/lcc/controller/calculation/CalculationController.java delete mode 100644 src/main/java/de/avatic/lcc/controller/calculation/PremiseController.java delete mode 100644 src/main/java/de/avatic/lcc/controller/configuration/ContainerRateController.java delete mode 100644 src/main/java/de/avatic/lcc/controller/configuration/MatrixRateController.java create mode 100644 src/main/java/de/avatic/lcc/controller/configuration/RateController.java create mode 100644 src/main/java/de/avatic/lcc/dto/bulk/BulkProcessingType.java create mode 100644 src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java delete mode 100644 src/main/java/de/avatic/lcc/dto/calculation/PremiseDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/PremiseState.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java rename src/main/java/de/avatic/lcc/dto/calculation/{SearchDTO.java => create/PremiseSearchResultDTO.java} (58%) create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/CreateDestinationDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/DestinationDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/PremiseDetailDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/SetSupplierDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterData.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateType.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/AllUpdateDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/MaterialUpdateDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PackagingUpdateDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PriceUpdateDTO.java rename src/main/java/de/avatic/lcc/dto/configuration/countries/view/{CountryViewDTO.java => CountryDetailDTO.java} (97%) create mode 100644 src/main/java/de/avatic/lcc/dto/configuration/matrixrates/MatrixRateDTO.java rename src/main/java/de/avatic/lcc/dto/configuration/nodes/view/{NodeViewDTO.java => NodeDetailDTO.java} (98%) create mode 100644 src/main/java/de/avatic/lcc/dto/configuration/rates/ContainerRateDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/generic/RouteType.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ContainerType.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportContainerDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportPackagingDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportPremisesDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportQuantityDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportQuotaShareDTO.java create mode 100644 src/main/java/de/avatic/lcc/dto/report/ReportRouteEntryDTO.java create mode 100644 src/main/java/de/avatic/lcc/model/users/Group.java delete mode 100644 src/main/java/de/avatic/lcc/repos/CalculationJobRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/CountryPropertyTypeRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/CountryRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/DistanceMatrixRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/MaterialRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/NodeRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/PackagingPropertyTypeRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/PackagingRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/PremissRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/PropertySetRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/SysGroupRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/SysUserNodeRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/SysUserRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/SystemPropertyTypeRepository.java delete mode 100644 src/main/java/de/avatic/lcc/repos/ValidityPeriodRepository.java delete mode 100644 src/main/java/de/avatic/lcc/service/calculation/CalclationSearchStringAnalyzerService.java delete mode 100644 src/main/java/de/avatic/lcc/service/calculation/CalculationCreationService.java create mode 100644 src/main/java/de/avatic/lcc/service/calculation/PremiseCreationService.java create mode 100644 src/main/java/de/avatic/lcc/service/calculation/PremiseSearchStringAnalyzerService.java create mode 100644 src/main/java/de/avatic/lcc/service/configuration/ContainerRateService.java create mode 100644 src/main/java/de/avatic/lcc/service/configuration/MatrixRateService.java create mode 100644 src/main/java/de/avatic/lcc/service/configuration/StagedChangesService.java create mode 100644 src/main/java/de/avatic/lcc/util/exception/clienterror/FileFormatNotSupportedException.java diff --git a/src/main/java/de/avatic/lcc/controller/bulk/BulkOperationController.java b/src/main/java/de/avatic/lcc/controller/bulk/BulkOperationController.java index 265d52c..9503761 100644 --- a/src/main/java/de/avatic/lcc/controller/bulk/BulkOperationController.java +++ b/src/main/java/de/avatic/lcc/controller/bulk/BulkOperationController.java @@ -2,6 +2,8 @@ package de.avatic.lcc.controller.bulk; import de.avatic.lcc.dto.bulk.BulkFileType; +import de.avatic.lcc.dto.bulk.BulkProcessingType; +import de.avatic.lcc.dto.bulk.BulkStatus; import de.avatic.lcc.service.bulk.BulkExportService; import de.avatic.lcc.service.bulk.BulkFileProcessingService; import de.avatic.lcc.service.bulk.TemplateGenerationService; @@ -12,6 +14,11 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +/** + * REST controller for handling bulk operations, including file uploads, template generation, + * and export downloads. It provides a comprehensive set of endpoints to manage processing + * operations for supported file types based on defined business requirements. + */ @RestController @RequestMapping("/api/bulk") public class BulkOperationController { @@ -26,37 +33,89 @@ public class BulkOperationController { this.bulkExportService = bulkExportService; } - @GetMapping("/status/{id}") - public ResponseEntity getUploadStatus(@PathVariable Integer id) { - return ResponseEntity.ok().build(); + /** + * Retrieves the current status of a specific bulk processing operation. + * + * @param id The unique identifier of the operation (processing_id) to check its status. + * @return A ResponseEntity with the bulk processing status payload. + */ + @GetMapping("/status/{processing_id}") + public ResponseEntity getUploadStatus(@PathVariable("processing_id") Integer id) { + return ResponseEntity.ok(bulkProcessingService.getStatus(id)); } - @PostMapping("/upload/{type}") - public ResponseEntity uploadFile(@PathVariable String type, @RequestParam("file") MultipartFile file) { - return ResponseEntity.ok().build(); + /** + * Handles the upload of a file for a specific processing type and file type. + * + * @param processingType The processing type ("full" or "append") associated with the upload. + * @param type The file type being uploaded, as defined in {@link BulkFileType}. + * @param file The file to be uploaded, provided as a multipart file. + * @return A ResponseEntity indicating whether the upload was processed successfully. + */ + @PostMapping("/upload/{type}/{processing_type}") + public ResponseEntity uploadFile(@PathVariable("processing_type") BulkProcessingType processingType, @PathVariable BulkFileType type, @RequestParam("file") MultipartFile file) { + return ResponseEntity.ok(bulkProcessingService.processFile(type, processingType, file)); } + /** + * Generates and downloads a template file for the specified file type. + * + * @param type The type of file template to generate, based on the {@link BulkFileType} enumeration. + * @return A ResponseEntity with the generated template as an InputStreamResource. + * The response includes the appropriate Excel MIME type and a Content-Disposition header + * specifying it as a downloadable file. + * @throws IllegalArgumentException if the file type is invalid. + */ @GetMapping("/templates/{type}") - public ResponseEntity generateTemplate(@PathVariable String type) { + public ResponseEntity generateTemplate(@PathVariable BulkFileType type) { HttpHeaders headers = new HttpHeaders(); - headers.add("Content-Disposition", "attachment; filename=lcc_template_"+type.toLowerCase()+".xlsx"); + headers.add("Content-Disposition", "attachment; filename=lcc_template_" + type.name().toLowerCase() + ".xlsx"); return ResponseEntity .ok() .headers(headers) .contentType(MediaType.parseMediaType("application/vnd.ms-excel")) - .body(new InputStreamResource(templateGenerationService.generateTemplate(BulkFileType.valueOf(type.toUpperCase())))); + .body(new InputStreamResource(templateGenerationService.generateTemplate(BulkFileType.valueOf(type.name().toUpperCase())))); } + /** + * Downloads an export file for the specified file type. + * + * @param type The type of file to export, as defined in {@link BulkFileType}. + * @return A ResponseEntity with the exported file as an InputStreamResource. + * The file is served as an Excel document, with proper headers for download. + * @throws IllegalArgumentException if the provided file type is not supported. + */ @GetMapping("/download/{type}") - public ResponseEntity downloadFile(@PathVariable String type) { + public ResponseEntity downloadFile(@PathVariable BulkFileType type) { HttpHeaders headers = new HttpHeaders(); - headers.add("Content-Disposition", "attachment; filename=lcc_export_"+type.toLowerCase()+".xlsx"); + headers.add("Content-Disposition", "attachment; filename=lcc_export_" + type.name().toLowerCase() + ".xlsx"); return ResponseEntity .ok() .headers(headers) .contentType(MediaType.parseMediaType("application/vnd.ms-excel")) - .body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.toUpperCase())))); + .body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.name().toUpperCase())))); + } + + /** + * Downloads an export file for the specified file type, filtered by a validity period. + * + * @param type The type of file to export, according to {@link BulkFileType}. + * @param validityPeriodId The ID of the validity period to apply filtering for the export. + * @return A ResponseEntity containing the exported file as an InputStreamResource. + * The file is served as an Excel document, with appropriate headers for download. + * @throws IllegalArgumentException if the file type or validity period ID is invalid. + */ + @GetMapping("/download/{type}/{validity_period_id}") + public ResponseEntity downloadFile(@PathVariable BulkFileType type, @PathVariable("validity_period_id") Integer validityPeriodId) { + HttpHeaders headers = new HttpHeaders(); + headers.add("Content-Disposition", "attachment; filename=lcc_export_" + type.name().toLowerCase() + ".xlsx"); + + return ResponseEntity + .ok() + .headers(headers) + .contentType(MediaType.parseMediaType("application/vnd.ms-excel")) + .body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.name().toUpperCase()), validityPeriodId))); } } diff --git a/src/main/java/de/avatic/lcc/controller/calculation/CalculationController.java b/src/main/java/de/avatic/lcc/controller/calculation/CalculationController.java new file mode 100644 index 0000000..528effa --- /dev/null +++ b/src/main/java/de/avatic/lcc/controller/calculation/CalculationController.java @@ -0,0 +1,92 @@ +package de.avatic.lcc.controller.calculation; + + +import de.avatic.lcc.dto.calculation.edit.SetSupplierDTO; +import de.avatic.lcc.dto.calculation.create.PremiseSearchResultDTO; +import de.avatic.lcc.dto.calculation.edit.*; +import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateDTO; +import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateType; +import de.avatic.lcc.dto.calculation.view.PremiseViewDTO; +import de.avatic.lcc.service.calculation.PremiseSearchStringAnalyzerService; +import de.avatic.lcc.service.calculation.PremiseCreationService; +import de.avatic.lcc.service.calculation.PremisesService; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; + +@RestController +@RequestMapping("/api/calculation") +public class CalculationController { + + private final PremiseSearchStringAnalyzerService premiseSearchStringAnalyzerService; + private final PremisesService premisesServices; + private final PremiseCreationService premiseCreationService; + + public CalculationController(PremiseSearchStringAnalyzerService premiseSearchStringAnalyzerService, PremisesService premisesServices, PremiseCreationService premiseCreationService) { + this.premiseSearchStringAnalyzerService = premiseSearchStringAnalyzerService; + this.premisesServices = premisesServices; + this.premiseCreationService = premiseCreationService; + } + + @GetMapping("/view") + public ResponseEntity> listPremises(@RequestParam String filter, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer limit, @RequestParam(name = "user", required = false) Integer userId, @RequestParam(required = false) Boolean deleted, @RequestParam(required = false) Boolean archived, @RequestParam(required = false) Boolean done) { + return ResponseEntity.ok(premisesServices.listPremises(filter, page, limit, userId, deleted, archived, done)); + } + + @GetMapping("/search") + public ResponseEntity findMaterialsAndSuppliers(@RequestParam String search) { + return ResponseEntity.ok(premiseSearchStringAnalyzerService.findMaterialAndSuppliers(search)); + } + + @PostMapping("/create") + public ResponseEntity> createPremises(@RequestParam("material") List materialIds, @RequestParam("supplier") List supplierIds, @RequestParam("user_supplier") List userSupplierIds, @RequestParam("from_scratch") boolean createEmpty) { + return ResponseEntity.ok(premiseCreationService.createPremises(materialIds, supplierIds, userSupplierIds, createEmpty)); + } + + @GetMapping("/edit") + public ResponseEntity> getPremises(@RequestParam("premiss_ids") List premissIds) { + return ResponseEntity.ok(premisesServices.getPremises(premissIds)); + } + + // triggers a calculation + @PutMapping("/done") + public ResponseEntity completePremises(@RequestBody List premiseIds) { + return ResponseEntity.ok(premisesServices.startCalculation(premiseIds)); + } + + @PutMapping("/{type}") + public ResponseEntity> updateMasterData(@PathVariable MasterDataUpdateType type, MasterDataUpdateDTO masterDataDTO) { + return ResponseEntity.ok(premisesServices.updateMasterData(type, masterDataDTO)); + } + + @PostMapping("/destination") + public ResponseEntity> createDestination(CreateDestinationDTO createDestinationDTO) { + return ResponseEntity.ok(premisesServices.createDestination(createDestinationDTO)); + } + + @GetMapping("/destination({id}") + public ResponseEntity getDestination(@PathVariable Integer id) { + return ResponseEntity.ok(premisesServices.getDestination(id)); + } + + @PutMapping("/destination({id}") + public ResponseEntity updateDestination(@PathVariable Integer id) { + premisesServices.updateDestination(id); + return ResponseEntity.ok().build(); + } + + @DeleteMapping("/destination({id}") + public ResponseEntity deleteDestination(@PathVariable Integer id) { + premisesServices.deleteDestination(id); + return ResponseEntity.ok().build(); + } + + + @PutMapping("/supplier") + public ResponseEntity> setSupplier(SetSupplierDTO setSupplierDTO) { + return ResponseEntity.ok(premisesServices.setSupplier(setSupplierDTO)); + } + +} diff --git a/src/main/java/de/avatic/lcc/controller/calculation/PremiseController.java b/src/main/java/de/avatic/lcc/controller/calculation/PremiseController.java deleted file mode 100644 index 7a1828b..0000000 --- a/src/main/java/de/avatic/lcc/controller/calculation/PremiseController.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.avatic.lcc.controller.calculation; - - -import de.avatic.lcc.dto.calculation.PremiseDTO; -import de.avatic.lcc.dto.calculation.SearchDTO; -import de.avatic.lcc.dto.calculation.view.PremiseViewDTO; -import de.avatic.lcc.service.calculation.CalclationSearchStringAnalyzerService; -import de.avatic.lcc.service.calculation.CalculationCreationService; -import de.avatic.lcc.service.calculation.PremisesService; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/api/calculation") -public class PremiseController { - - private final CalclationSearchStringAnalyzerService calclationSearchStringAnalyzerService; - private final PremisesService premisesServices; - private final CalculationCreationService calculationCreationService; - - public PremiseController(CalclationSearchStringAnalyzerService calclationSearchStringAnalyzerService, PremisesService premisesServices, CalculationCreationService calculationCreationService) { - this.calclationSearchStringAnalyzerService = calclationSearchStringAnalyzerService; - this.premisesServices = premisesServices; - this.calculationCreationService = calculationCreationService; - } - - @GetMapping("/view") - public ResponseEntity> listPremises(@RequestParam String filter, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer limit, @RequestParam(name = "user", required = false) Integer userId, @RequestParam(required = false) Boolean deleted, @RequestParam(required = false) Boolean archived, @RequestParam(required = false) Boolean done) { - return ResponseEntity.ok(premisesServices.listCalculation(filter, page, limit, userId, deleted, archived, done)); - } - - @GetMapping("/search") - public ResponseEntity findMaterialsAndSuppliers(@RequestParam String search) { - return ResponseEntity.ok(calclationSearchStringAnalyzerService.findMaterialAndSuppliers(search)); - } - - @GetMapping("/create") - public ResponseEntity> createCalculation(@RequestParam("material") List materialIds, @RequestParam("supplier") List supplierIds, @RequestParam("user_supplier") List userSupplierIds, @RequestParam("from_scratch") boolean createEmpty ) { - return ResponseEntity.ok(calculationCreationService.createCalculations(materialIds, supplierIds, userSupplierIds, createEmpty)); - } - - @GetMapping("/edit") - public ResponseEntity> getPremises(@RequestParam("premiss_ids") List premissIds) { - return ResponseEntity.ok(premisesServices.getPremises(premissIds)); - } - - @PutMapping("/edit") - public ResponseEntity savePremises(@RequestBody List premises ) { - premisesServices.savePremises(premises); - return ResponseEntity.ok().build(); - } - -} diff --git a/src/main/java/de/avatic/lcc/controller/configuration/ContainerRateController.java b/src/main/java/de/avatic/lcc/controller/configuration/ContainerRateController.java deleted file mode 100644 index 6249cf6..0000000 --- a/src/main/java/de/avatic/lcc/controller/configuration/ContainerRateController.java +++ /dev/null @@ -1,16 +0,0 @@ -package de.avatic.lcc.controller.configuration; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/api/rates/container") -public class ContainerRateController { - - @GetMapping("/") - public ResponseEntity getRates() { - return "Container rates"; - } -} diff --git a/src/main/java/de/avatic/lcc/controller/configuration/CountryController.java b/src/main/java/de/avatic/lcc/controller/configuration/CountryController.java index 4c61f4a..935d859 100644 --- a/src/main/java/de/avatic/lcc/controller/configuration/CountryController.java +++ b/src/main/java/de/avatic/lcc/controller/configuration/CountryController.java @@ -1,6 +1,6 @@ package de.avatic.lcc.controller.configuration; -import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO; +import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO; import de.avatic.lcc.dto.configuration.countries.update.CountryUpdateDTO; import de.avatic.lcc.dto.generic.CountryDTO; import de.avatic.lcc.repositories.pagination.SearchQueryResult; @@ -36,7 +36,7 @@ public class CountryController { } @GetMapping("/{id}") - public ResponseEntity getCountryDetails(@PathVariable Integer id) { + public ResponseEntity getCountryDetails(@PathVariable Integer id) { return ResponseEntity.ok(countryService.getCountry(id)); } diff --git a/src/main/java/de/avatic/lcc/controller/configuration/MatrixRateController.java b/src/main/java/de/avatic/lcc/controller/configuration/MatrixRateController.java deleted file mode 100644 index eba1ef0..0000000 --- a/src/main/java/de/avatic/lcc/controller/configuration/MatrixRateController.java +++ /dev/null @@ -1,16 +0,0 @@ -package de.avatic.lcc.controller.configuration; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/rates/matrix") -public class MatrixRateController { - - @GetMapping("/") - public String getRates() { - return "Matrix rates"; - } - -} diff --git a/src/main/java/de/avatic/lcc/controller/configuration/NodeController.java b/src/main/java/de/avatic/lcc/controller/configuration/NodeController.java index eca4772..cf5ba4c 100644 --- a/src/main/java/de/avatic/lcc/controller/configuration/NodeController.java +++ b/src/main/java/de/avatic/lcc/controller/configuration/NodeController.java @@ -1,7 +1,7 @@ package de.avatic.lcc.controller.configuration; import de.avatic.lcc.dto.generic.NodeDTO; -import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO; +import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO; import de.avatic.lcc.dto.configuration.nodes.update.NodeUpdateDTO; import de.avatic.lcc.repositories.pagination.SearchQueryResult; import de.avatic.lcc.service.configuration.NodeService; @@ -36,7 +36,7 @@ public class NodeController { } @GetMapping("/{id}") - public ResponseEntity getNode(@PathVariable Integer id) { + public ResponseEntity getNode(@PathVariable Integer id) { return ResponseEntity.ok(nodeService.getNode(id)); } diff --git a/src/main/java/de/avatic/lcc/controller/configuration/PackagingController.java b/src/main/java/de/avatic/lcc/controller/configuration/PackagingController.java index 9f859e7..41067da 100644 --- a/src/main/java/de/avatic/lcc/controller/configuration/PackagingController.java +++ b/src/main/java/de/avatic/lcc/controller/configuration/PackagingController.java @@ -15,12 +15,10 @@ import java.util.List; @RequestMapping("/api/packaging") public class PackagingController { - private final PackagingRepository packagingRepository; - private final PackagingService packagingService; + private final PackagingService packagingService; @Autowired - public PackagingController(PackagingRepository packagingRepository, PackagingService packagingService) { - this.packagingRepository = packagingRepository; + public PackagingController(PackagingService packagingService) { this.packagingService = packagingService; } diff --git a/src/main/java/de/avatic/lcc/controller/configuration/RateController.java b/src/main/java/de/avatic/lcc/controller/configuration/RateController.java new file mode 100644 index 0000000..c6f8306 --- /dev/null +++ b/src/main/java/de/avatic/lcc/controller/configuration/RateController.java @@ -0,0 +1,101 @@ +package de.avatic.lcc.controller.configuration; + +import de.avatic.lcc.dto.configuration.matrixrates.MatrixRateDTO; +import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO; +import de.avatic.lcc.repositories.pagination.SearchQueryResult; +import de.avatic.lcc.service.configuration.ContainerRateService; +import de.avatic.lcc.service.configuration.MatrixRateService; +import de.avatic.lcc.service.configuration.StagedChangesService; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RestController +@RequestMapping("/api/rates") +public class RateController { + + private final MatrixRateService matrixRateService; + private final ContainerRateService containerRateService; + private final StagedChangesService stagedChangesService; + + public RateController(MatrixRateService matrixRateService, ContainerRateService containerRateService, StagedChangesService stagedChangesService) { + this.matrixRateService = matrixRateService; + this.containerRateService = containerRateService; + this.stagedChangesService = stagedChangesService; + } + + @GetMapping("/container") + public ResponseEntity> listContainerRates( + @RequestParam(defaultValue = "20") int limit, + @RequestParam(defaultValue = "0") int page, + @RequestParam(required = false) Integer valid, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime validAt) { + + SearchQueryResult containerRates = null; + + if(validAt != null) { + containerRates = containerRateService.listContainerRates(limit, page, validAt); + } + else if(valid != null) { + containerRates = containerRateService.listContainerRates(limit, page, valid); + } + else { + containerRates = containerRateService.listContainerRates(limit, page); + } + + return ResponseEntity.ok() + .header("X-Total-Count", String.valueOf(containerRates.getTotalElements())) + .header("X-Page-Count", String.valueOf(containerRates.getTotalPages())) + .header("X-Current-Page", String.valueOf(page)) + .body(containerRates.toList()); + } + + @GetMapping("/container/{id}") + public ResponseEntity getContainerRate(@PathVariable Integer id) { + return ResponseEntity.ok(containerRateService.getContainerRate(id)); + } + + @GetMapping("/matrix") + public ResponseEntity> listMatrixRates( + @RequestParam(defaultValue = "20") int limit, + @RequestParam(defaultValue = "0") int page, + @RequestParam(required = false) Integer valid, + @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime validAt) { + + SearchQueryResult rates = null; + + if(validAt != null) { + rates = matrixRateService.listRates(limit, page, validAt); + } + else if(valid != null) { + rates = matrixRateService.listRates(limit, page, valid); + } + else { + rates = matrixRateService.listRates(limit, page); + } + + return ResponseEntity.ok() + .header("X-Total-Count", String.valueOf(rates.getTotalElements())) + .header("X-Page-Count", String.valueOf(rates.getTotalPages())) + .header("X-Current-Page", String.valueOf(page)) + .body(rates.toList()); + } + @GetMapping("/matrix/{id}") + public ResponseEntity getMatrixRate(@PathVariable Integer id) { + return ResponseEntity.ok(matrixRateService.getRate(id)); + } + + @GetMapping("/staged_changes") + public ResponseEntity checkRateDrafts() { + return ResponseEntity.ok(stagedChangesService.hasRateDrafts()); + } + + @PutMapping("/staged_changes") + public ResponseEntity approveRateDrafts() { + stagedChangesService.approveRateDrafts(); + return ResponseEntity.ok().build(); + } +} diff --git a/src/main/java/de/avatic/lcc/controller/report/ReportingController.java b/src/main/java/de/avatic/lcc/controller/report/ReportingController.java index da97127..eba49c9 100644 --- a/src/main/java/de/avatic/lcc/controller/report/ReportingController.java +++ b/src/main/java/de/avatic/lcc/controller/report/ReportingController.java @@ -13,6 +13,10 @@ import org.springframework.web.bind.annotation.*; import java.util.List; +/** + * Rest Controller for managing reports functionality, including viewing, downloading, + * and searching for suppliers related to reporting based on specific materials. + */ @RestController @RequestMapping("/api/reports") public class ReportingController { @@ -21,22 +25,49 @@ public class ReportingController { private final ExcelReportingService excelReportingService; private final ReportFinderService reportFinderService; + /** + * Constructor for ReportingController. + * + * @param reportingService Service used for generating reports. + * @param excelReportingService Service used for generating Excel files for reports. + * @param reportFinderService Service used for finding suppliers for reporting. + */ public ReportingController(ReportingService reportingService, ExcelReportingService excelReportingService, ReportFinderService reportFinderService) { this.reportingService = reportingService; this.excelReportingService = excelReportingService; this.reportFinderService = reportFinderService; } + /** + * Fetches a list of suppliers for reporting purposes, based on material ID. + * + * @param materialId The ID of the material for which suppliers need to be found. + * @return A list of suppliers grouped by categories. + */ @GetMapping("/search") public ResponseEntity>> findSupplierForReporting(@RequestParam(value = "material") Integer materialId) { return ResponseEntity.ok(reportFinderService.findSupplierForReporting(materialId)); } + /** + * Fetches the report for the given material and source nodes. + * + * @param materialId The ID of the material for which the report will be generated. + * @param nodeIds A list of node IDs (sources) to include in the report. + * @return The generated report details. + */ @GetMapping("/view") public ResponseEntity getReport(@RequestParam(value = "material") Integer materialId, @RequestParam(value = "sources") List nodeIds) { return ResponseEntity.ok(reportingService.getReport(materialId, nodeIds)); } + /** + * Downloads an Excel report for the given material and source nodes. + * + * @param materialId The ID of the material for which the report will be downloaded. + * @param nodeIds A list of node IDs (sources) to include in the downloaded report. + * @return The Excel file as an attachment in the response. + */ @GetMapping("/download") public ResponseEntity downloadReport(@RequestParam(value = "material") Integer materialId, @RequestParam(value = "sources") List nodeIds) { diff --git a/src/main/java/de/avatic/lcc/controller/users/GroupController.java b/src/main/java/de/avatic/lcc/controller/users/GroupController.java index 256fa0c..7b0f70c 100644 --- a/src/main/java/de/avatic/lcc/controller/users/GroupController.java +++ b/src/main/java/de/avatic/lcc/controller/users/GroupController.java @@ -8,6 +8,10 @@ import org.springframework.web.bind.annotation.*; import java.util.List; +/** + * REST controller for handling group-related operations. + * Provides endpoints for retrieving and updating group information. + */ @RestController @RequestMapping("/api/groups") public class GroupController { @@ -18,6 +22,14 @@ public class GroupController { this.groupService = groupService; } + /** + * Retrieves a paginated list of groups based on the provided limit and page parameters. + * Also includes pagination metadata in response headers. + * + * @param limit The maximum number of groups to fetch per page. Defaults to 20. + * @param page The index of the page to retrieve. Defaults to 0 (first page). + * @return A ResponseEntity containing the list of groups and pagination headers. + */ @GetMapping("/") public ResponseEntity> listGroups(@RequestParam(defaultValue = "20") int limit, @RequestParam(defaultValue = "0") int page) { @@ -31,9 +43,16 @@ public class GroupController { .body(groups.toList()); } + /** + * Updates the details of an existing group. + * + * @param group The DTO containing the updated group information. + * @return A ResponseEntity indicating the operation status. + */ @PutMapping("/") - public void updateGroup(GroupDTO group) { - return groupService.updateGroup(group); + public ResponseEntity updateGroup(GroupDTO group) { + groupService.updateGroup(group); + return ResponseEntity.ok().build(); } } diff --git a/src/main/java/de/avatic/lcc/controller/users/UserController.java b/src/main/java/de/avatic/lcc/controller/users/UserController.java index dd0f321..21577bd 100644 --- a/src/main/java/de/avatic/lcc/controller/users/UserController.java +++ b/src/main/java/de/avatic/lcc/controller/users/UserController.java @@ -1,7 +1,6 @@ package de.avatic.lcc.controller.users; -import de.avatic.lcc.dto.generic.MaterialDTO; import de.avatic.lcc.dto.users.UserDTO; import de.avatic.lcc.repositories.pagination.SearchQueryResult; import de.avatic.lcc.service.users.UserService; @@ -10,6 +9,10 @@ import org.springframework.web.bind.annotation.*; import java.util.List; +/** + * REST Controller for managing user-related operations. + * This controller provides endpoints for listing users and updating user details. + */ @RestController @RequestMapping("/api/users") public class UserController { @@ -21,22 +24,36 @@ public class UserController { this.userService = userService; } + /** + * Retrieves a paginated list of users. + * + * @param limit The maximum number of users to return, with a default value of 20. + * @param page The page number of the users to retrieve, with a default value of 0. + * @return A ResponseEntity containing the list of users, along with pagination headers. + */ @GetMapping("/") public ResponseEntity> listUsers( - @RequestParam(defaultValue = "20") int limit, - @RequestParam(defaultValue = "0") int page) { + @RequestParam(defaultValue = "20") int limit, + @RequestParam(defaultValue = "0") int page) { - SearchQueryResult users = userService.listUsers(page, limit); + SearchQueryResult users = userService.listUsers(page, limit); - return ResponseEntity.ok() - .header("X-Total-Count", String.valueOf(users.getTotalElements())) - .header("X-Page-Count", String.valueOf(users.getTotalPages())) - .header("X-Current-Page", String.valueOf(page)) - .body(users.toList()); + return ResponseEntity.ok() + .header("X-Total-Count", String.valueOf(users.getTotalElements())) + .header("X-Page-Count", String.valueOf(users.getTotalPages())) + .header("X-Current-Page", String.valueOf(page)) + .body(users.toList()); } + /** + * Updates the details of an existing user. + * + * @param user A UserDTO object containing the updated user details. + * @return A ResponseEntity indicating the operation was successful. + */ @PutMapping("/") - public void udateUser(UserDTO user) { + public ResponseEntity updateUser(UserDTO user) { userService.updateUser(user); + return ResponseEntity.ok().build(); } } diff --git a/src/main/java/de/avatic/lcc/dto/bulk/BulkProcessingType.java b/src/main/java/de/avatic/lcc/dto/bulk/BulkProcessingType.java new file mode 100644 index 0000000..08bb087 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/bulk/BulkProcessingType.java @@ -0,0 +1,5 @@ +package de.avatic.lcc.dto.bulk; + +public enum BulkProcessingType { + FULL, APPEND +} diff --git a/src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java b/src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java new file mode 100644 index 0000000..5e28fd0 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java @@ -0,0 +1,4 @@ +package de.avatic.lcc.dto.bulk; + +public class BulkStatus { +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/PremiseDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/PremiseDTO.java deleted file mode 100644 index 8aac222..0000000 --- a/src/main/java/de/avatic/lcc/dto/calculation/PremiseDTO.java +++ /dev/null @@ -1,4 +0,0 @@ -package de.avatic.lcc.dto.calculation; - -public class PremiseDTO { -} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/PremiseState.java b/src/main/java/de/avatic/lcc/dto/calculation/PremiseState.java new file mode 100644 index 0000000..37d70b0 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/PremiseState.java @@ -0,0 +1,5 @@ +package de.avatic.lcc.dto.calculation; + +public enum PremiseState { + DRAFT, COMPLETED, ARCHIVED, DELETED +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java new file mode 100644 index 0000000..6dc56ac --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java @@ -0,0 +1,27 @@ +package de.avatic.lcc.dto.calculation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.generic.NodeDTO; +import de.avatic.lcc.dto.generic.RouteType; + +import java.util.List; + +public class RouteDTO { + + private Integer id; + + private RouteType type; + + @JsonProperty("is_selected") + private Boolean isSelected; + + @JsonProperty("is_cheapest") + private Boolean isCheapest; + + @JsonProperty("is_fastest") + private Boolean isFastest; + + @JsonProperty("transit_nodes") + private List transitNodes; + +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/SearchDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/create/PremiseSearchResultDTO.java similarity index 58% rename from src/main/java/de/avatic/lcc/dto/calculation/SearchDTO.java rename to src/main/java/de/avatic/lcc/dto/calculation/create/PremiseSearchResultDTO.java index d93d27c..519aa4a 100644 --- a/src/main/java/de/avatic/lcc/dto/calculation/SearchDTO.java +++ b/src/main/java/de/avatic/lcc/dto/calculation/create/PremiseSearchResultDTO.java @@ -1,15 +1,18 @@ -package de.avatic.lcc.dto.calculation; +package de.avatic.lcc.dto.calculation.create; +import com.fasterxml.jackson.annotation.JsonProperty; import de.avatic.lcc.dto.generic.MaterialDTO; import de.avatic.lcc.dto.generic.NodeDTO; import java.util.List; -public class SearchDTO { +public class PremiseSearchResultDTO { private List materials; private List supplier; + @JsonProperty("user_supplier") + private List userSupplier; public List getMaterials() { return materials; @@ -27,14 +30,11 @@ public class SearchDTO { this.supplier = supplier; } - public List getUser_supplier() { - return user_supplier; + public List getUserSupplier() { + return userSupplier; } - public void setUser_supplier(List user_supplier) { - this.user_supplier = user_supplier; + public void setUserSupplier(List userSupplier) { + this.userSupplier = userSupplier; } - - private List user_supplier; - } diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/CreateDestinationDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/CreateDestinationDTO.java new file mode 100644 index 0000000..836f469 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/CreateDestinationDTO.java @@ -0,0 +1,30 @@ +package de.avatic.lcc.dto.calculation.edit; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class CreateDestinationDTO { + + @JsonProperty("premise_id") + List premiseId; + + @JsonProperty("destination_node_id") + Integer destinationNodeId; + + public List getPremiseId() { + return premiseId; + } + + public void setPremiseId(List premiseId) { + this.premiseId = premiseId; + } + + public Integer getDestinationNodeId() { + return destinationNodeId; + } + + public void setDestinationNodeId(Integer destinationNodeId) { + this.destinationNodeId = destinationNodeId; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/DestinationDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/DestinationDTO.java new file mode 100644 index 0000000..5f2cb34 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/DestinationDTO.java @@ -0,0 +1,27 @@ +package de.avatic.lcc.dto.calculation.edit; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.generic.NodeDTO; +import de.avatic.lcc.dto.calculation.RouteDTO; + +import java.util.List; + +public class DestinationDTO { + + private Integer id; + + @JsonProperty("repackaging_costs") + private Number repackingCosts; + + @JsonProperty("handling_costs") + private Number handlingCosts; + + @JsonProperty("disposal_costs") + private Number disposalCosts; + + @JsonProperty("destination_node") + private NodeDTO destinationNode; + + private List routes; + +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/PremiseDetailDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/PremiseDetailDTO.java new file mode 100644 index 0000000..7a96252 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/PremiseDetailDTO.java @@ -0,0 +1,84 @@ +package de.avatic.lcc.dto.calculation.edit; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.generic.DimensionDTO; +import de.avatic.lcc.dto.generic.MaterialDTO; +import de.avatic.lcc.dto.generic.NodeDTO; + +import java.util.List; + +public class PremiseDetailDTO { + + private Integer id; + + private MaterialDTO material; + + private NodeDTO supplier; + + @JsonProperty("handling_unit") + private DimensionDTO dimension; + + @JsonProperty("is_mixable") + private Boolean isMixable; + + @JsonProperty("is_stackable") + private Boolean isStackable; + + private List destinations; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public MaterialDTO getMaterial() { + return material; + } + + public void setMaterial(MaterialDTO material) { + this.material = material; + } + + public NodeDTO getSupplier() { + return supplier; + } + + public void setSupplier(NodeDTO supplier) { + this.supplier = supplier; + } + + public DimensionDTO getDimension() { + return dimension; + } + + public void setDimension(DimensionDTO dimension) { + this.dimension = dimension; + } + + public Boolean getMixable() { + return isMixable; + } + + public void setMixable(Boolean mixable) { + isMixable = mixable; + } + + public Boolean getStackable() { + return isStackable; + } + + public void setStackable(Boolean stackable) { + isStackable = stackable; + } + + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/SetSupplierDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/SetSupplierDTO.java new file mode 100644 index 0000000..5e62b2f --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/SetSupplierDTO.java @@ -0,0 +1,41 @@ +package de.avatic.lcc.dto.calculation.edit; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class SetSupplierDTO { + + @JsonProperty("premise_id") + List premiseId; + + @JsonProperty("update_master_data") + boolean updateMasterData; + + @JsonProperty("supplier_node_id") + Integer supplierNodeId; + + public List getPremiseId() { + return premiseId; + } + + public void setPremiseId(List premiseId) { + this.premiseId = premiseId; + } + + public boolean isUpdateMasterData() { + return updateMasterData; + } + + public void setUpdateMasterData(boolean updateMasterData) { + this.updateMasterData = updateMasterData; + } + + public Integer getSupplierNodeId() { + return supplierNodeId; + } + + public void setSupplierNodeId(Integer supplierNodeId) { + this.supplierNodeId = supplierNodeId; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterData.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterData.java new file mode 100644 index 0000000..93f547b --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterData.java @@ -0,0 +1,4 @@ +package de.avatic.lcc.dto.calculation.edit.update; + +public interface MasterData { +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateDTO.java new file mode 100644 index 0000000..b925aca --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateDTO.java @@ -0,0 +1,38 @@ +package de.avatic.lcc.dto.calculation.edit.update; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import de.avatic.lcc.dto.calculation.edit.update.data.AllUpdateDTO; +import de.avatic.lcc.dto.calculation.edit.update.data.MaterialUpdateDTO; +import de.avatic.lcc.dto.calculation.edit.update.data.PackagingUpdateDTO; +import de.avatic.lcc.dto.calculation.edit.update.data.PriceUpdateDTO; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = MaterialUpdateDTO.class, name = "MATERIAL"), + @JsonSubTypes.Type(value = PackagingUpdateDTO.class, name = "PACKAGING"), + @JsonSubTypes.Type(value = PriceUpdateDTO.class, name = "PRICE"), + @JsonSubTypes.Type(value = AllUpdateDTO.class, name = "ALL"), +}) +public class MasterDataUpdateDTO { + + private MasterDataUpdateType type; + + private MasterData data; + + public MasterDataUpdateType getType() { + return type; + } + + public void setType(MasterDataUpdateType type) { + this.type = type; + } + + public MasterData getData() { + return data; + } + + public void setData(MasterData data) { + this.data = data; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateType.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateType.java new file mode 100644 index 0000000..449b5d2 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/MasterDataUpdateType.java @@ -0,0 +1,5 @@ +package de.avatic.lcc.dto.calculation.edit.update; + +public enum MasterDataUpdateType { + MATERIAL, PRICE, PACKAGING, ALL +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/AllUpdateDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/AllUpdateDTO.java new file mode 100644 index 0000000..615ce15 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/AllUpdateDTO.java @@ -0,0 +1,106 @@ +package de.avatic.lcc.dto.calculation.edit.update.data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.calculation.edit.update.MasterData; +import de.avatic.lcc.dto.generic.DimensionDTO; + +public class AllUpdateDTO implements MasterData { + + private Number price; + + @JsonProperty("oversea_share") + private Number overseaShare; + + @JsonProperty("fca_fee_included") + private Boolean includeFcaFee; + + @JsonProperty("handling_unit") + private DimensionDTO dimensions; + + @JsonProperty("is_mixable") + private Boolean isMixable; + + @JsonProperty("is_stackable") + private Boolean isStackable; + + @JsonProperty("part_number") + private String partNumber; + + @JsonProperty("hs_code") + private String hsCode; + + @JsonProperty("tariff_rate") + private Number tariffRate ; + + public Number getPrice() { + return price; + } + + public void setPrice(Number price) { + this.price = price; + } + + public Number getOverseaShare() { + return overseaShare; + } + + public void setOverseaShare(Number overseaShare) { + this.overseaShare = overseaShare; + } + + public Boolean getIncludeFcaFee() { + return includeFcaFee; + } + + public void setIncludeFcaFee(Boolean includeFcaFee) { + this.includeFcaFee = includeFcaFee; + } + + public DimensionDTO getDimensions() { + return dimensions; + } + + public void setDimensions(DimensionDTO dimensions) { + this.dimensions = dimensions; + } + + public Boolean getMixable() { + return isMixable; + } + + public void setMixable(Boolean mixable) { + isMixable = mixable; + } + + public Boolean getStackable() { + return isStackable; + } + + public void setStackable(Boolean stackable) { + isStackable = stackable; + } + + public String getPartNumber() { + return partNumber; + } + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } + + public String getHsCode() { + return hsCode; + } + + public void setHsCode(String hsCode) { + this.hsCode = hsCode; + } + + public Number getTariffRate() { + return tariffRate; + } + + public void setTariffRate(Number tariffRate) { + this.tariffRate = tariffRate; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/MaterialUpdateDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/MaterialUpdateDTO.java new file mode 100644 index 0000000..2b44928 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/MaterialUpdateDTO.java @@ -0,0 +1,40 @@ +package de.avatic.lcc.dto.calculation.edit.update.data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.calculation.edit.update.MasterData; + +public class MaterialUpdateDTO implements MasterData { + + @JsonProperty("part_number") + private String partNumber; + + @JsonProperty("hs_code") + private String hsCode; + + @JsonProperty("tariff_rate") + private Number tariffRate ; + + public String getPartNumber() { + return partNumber; + } + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } + + public String getHsCode() { + return hsCode; + } + + public void setHsCode(String hsCode) { + this.hsCode = hsCode; + } + + public Number getTariffRate() { + return tariffRate; + } + + public void setTariffRate(Number tariffRate) { + this.tariffRate = tariffRate; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PackagingUpdateDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PackagingUpdateDTO.java new file mode 100644 index 0000000..787d6c2 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PackagingUpdateDTO.java @@ -0,0 +1,42 @@ +package de.avatic.lcc.dto.calculation.edit.update.data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.calculation.edit.update.MasterData; +import de.avatic.lcc.dto.generic.DimensionDTO; + +public class PackagingUpdateDTO implements MasterData { + + @JsonProperty("handling_unit") + private DimensionDTO dimensions; + + @JsonProperty("is_mixable") + private Boolean isMixable; + + @JsonProperty("is_stackable") + private Boolean isStackable; + + + public DimensionDTO getDimensions() { + return dimensions; + } + + public void setDimensions(DimensionDTO dimensions) { + this.dimensions = dimensions; + } + + public Boolean getMixable() { + return isMixable; + } + + public void setMixable(Boolean mixable) { + isMixable = mixable; + } + + public Boolean getStackable() { + return isStackable; + } + + public void setStackable(Boolean stackable) { + isStackable = stackable; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PriceUpdateDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PriceUpdateDTO.java new file mode 100644 index 0000000..745335e --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/calculation/edit/update/data/PriceUpdateDTO.java @@ -0,0 +1,39 @@ +package de.avatic.lcc.dto.calculation.edit.update.data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.dto.calculation.edit.update.MasterData; + +public class PriceUpdateDTO implements MasterData { + + private Number price; + + @JsonProperty("oversea_share") + private Number overseaShare; + + @JsonProperty("fca_fee_included") + private Boolean includeFcaFee; + + public Number getPrice() { + return price; + } + + public void setPrice(Number price) { + this.price = price; + } + + public Number getOverseaShare() { + return overseaShare; + } + + public void setOverseaShare(Number overseaShare) { + this.overseaShare = overseaShare; + } + + public Boolean getIncludeFcaFee() { + return includeFcaFee; + } + + public void setIncludeFcaFee(Boolean includeFcaFee) { + this.includeFcaFee = includeFcaFee; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/calculation/view/PremiseViewDTO.java b/src/main/java/de/avatic/lcc/dto/calculation/view/PremiseViewDTO.java index b6232b8..0fb2103 100644 --- a/src/main/java/de/avatic/lcc/dto/calculation/view/PremiseViewDTO.java +++ b/src/main/java/de/avatic/lcc/dto/calculation/view/PremiseViewDTO.java @@ -1,4 +1,49 @@ package de.avatic.lcc.dto.calculation.view; +import de.avatic.lcc.dto.calculation.PremiseState; +import de.avatic.lcc.dto.generic.MaterialDTO; +import de.avatic.lcc.dto.generic.NodeDTO; + public class PremiseViewDTO { + + private int id; + + private MaterialDTO material; + + private NodeDTO supplier; + + private PremiseState state; + + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public MaterialDTO getMaterial() { + return material; + } + + public void setMaterial(MaterialDTO material) { + this.material = material; + } + + public NodeDTO getSupplier() { + return supplier; + } + + public void setSupplier(NodeDTO supplier) { + this.supplier = supplier; + } + + public PremiseState getState() { + return state; + } + + public void setState(PremiseState state) { + this.state = state; + } } diff --git a/src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryViewDTO.java b/src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryDetailDTO.java similarity index 97% rename from src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryViewDTO.java rename to src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryDetailDTO.java index a9fe943..0a6cda7 100644 --- a/src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryViewDTO.java +++ b/src/main/java/de/avatic/lcc/dto/configuration/countries/view/CountryDetailDTO.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Collection; -public class CountryViewDTO { +public class CountryDetailDTO { private Integer id; diff --git a/src/main/java/de/avatic/lcc/dto/configuration/matrixrates/MatrixRateDTO.java b/src/main/java/de/avatic/lcc/dto/configuration/matrixrates/MatrixRateDTO.java new file mode 100644 index 0000000..8f0b0b7 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/configuration/matrixrates/MatrixRateDTO.java @@ -0,0 +1,4 @@ +package de.avatic.lcc.dto.configuration.matrixrates; + +public class MatrixRateDTO { +} diff --git a/src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeViewDTO.java b/src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeDetailDTO.java similarity index 98% rename from src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeViewDTO.java rename to src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeDetailDTO.java index 63c998e..1525259 100644 --- a/src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeViewDTO.java +++ b/src/main/java/de/avatic/lcc/dto/configuration/nodes/view/NodeDetailDTO.java @@ -9,7 +9,7 @@ import de.avatic.lcc.dto.generic.NodeTypeDTO; import java.util.List; import java.util.Map; -public class NodeViewDTO { +public class NodeDetailDTO { private Integer id; private String name; diff --git a/src/main/java/de/avatic/lcc/dto/configuration/rates/ContainerRateDTO.java b/src/main/java/de/avatic/lcc/dto/configuration/rates/ContainerRateDTO.java new file mode 100644 index 0000000..55a98ba --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/configuration/rates/ContainerRateDTO.java @@ -0,0 +1,4 @@ +package de.avatic.lcc.dto.configuration.rates; + +public class ContainerRateDTO { +} diff --git a/src/main/java/de/avatic/lcc/dto/generic/NodeTypeDTO.java b/src/main/java/de/avatic/lcc/dto/generic/NodeTypeDTO.java index bb494d2..1f3bfde 100644 --- a/src/main/java/de/avatic/lcc/dto/generic/NodeTypeDTO.java +++ b/src/main/java/de/avatic/lcc/dto/generic/NodeTypeDTO.java @@ -2,8 +2,6 @@ package de.avatic.lcc.dto.generic; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; - /** * Represents the various types of nodes that can exist in the system. * A node can be categorized as SINK, SOURCE, or INTERMEDIATE, depending @@ -13,7 +11,7 @@ public enum NodeTypeDTO { /** * Represents a node that consumes resources or products (end-point of flow). */ - SINK("sink"), + DESTINATION("destination"), /** * Represents a node that originates or provides resources or products for a process. diff --git a/src/main/java/de/avatic/lcc/dto/generic/RouteType.java b/src/main/java/de/avatic/lcc/dto/generic/RouteType.java new file mode 100644 index 0000000..7ebc85a --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/generic/RouteType.java @@ -0,0 +1,5 @@ +package de.avatic.lcc.dto.generic; + +public enum RouteType { + RAIL, SEA, D2D, ROAD +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ContainerType.java b/src/main/java/de/avatic/lcc/dto/report/ContainerType.java new file mode 100644 index 0000000..fb40fdf --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ContainerType.java @@ -0,0 +1,5 @@ +package de.avatic.lcc.dto.report; + +public enum ContainerType { + FEU, TEU, HQ +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportContainerDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportContainerDTO.java new file mode 100644 index 0000000..b376218 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportContainerDTO.java @@ -0,0 +1,68 @@ +package de.avatic.lcc.dto.report; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReportContainerDTO { + + private ContainerType type; + + private Number rate; + + @JsonProperty("unit_count") + private Number unitCount; + + @JsonProperty("weight_exceeded") + private Boolean weightExceeded; + + private Number utilization; + + private Boolean mixed; + + public ContainerType getType() { + return type; + } + + public void setType(ContainerType type) { + this.type = type; + } + + public Number getRate() { + return rate; + } + + public void setRate(Number rate) { + this.rate = rate; + } + + public Number getUnitCount() { + return unitCount; + } + + public void setUnitCount(Number unitCount) { + this.unitCount = unitCount; + } + + public Boolean getWeightExceeded() { + return weightExceeded; + } + + public void setWeightExceeded(Boolean weightExceeded) { + this.weightExceeded = weightExceeded; + } + + public Number getUtilization() { + return utilization; + } + + public void setUtilization(Number utilization) { + this.utilization = utilization; + } + + public Boolean getMixed() { + return mixed; + } + + public void setMixed(Boolean mixed) { + this.mixed = mixed; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportDTO.java index e1086f4..d4d6a72 100644 --- a/src/main/java/de/avatic/lcc/dto/report/ReportDTO.java +++ b/src/main/java/de/avatic/lcc/dto/report/ReportDTO.java @@ -1,4 +1,42 @@ package de.avatic.lcc.dto.report; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.HashMap; + public class ReportDTO { + + @JsonProperty("costs") + public HashMap cost; + + @JsonProperty("risk") + public HashMap risk; + + @JsonProperty("premises") + public ReportPremisesDTO premises; + + + public HashMap getCost() { + return cost; + } + + public void setCost(HashMap cost) { + this.cost = cost; + } + + public HashMap getRisk() { + return risk; + } + + public void setRisk(HashMap risk) { + this.risk = risk; + } + + public ReportPremisesDTO getPremises() { + return premises; + } + + public void setPremises(ReportPremisesDTO premises) { + this.premises = premises; + } } diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java new file mode 100644 index 0000000..a4863a8 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java @@ -0,0 +1,22 @@ +package de.avatic.lcc.dto.report; + +public class ReportEntryDTO { + public Number total; + public Number percentage; + + public Number getTotal() { + return total; + } + + public void setTotal(Number total) { + this.total = total; + } + + public Number getPercentage() { + return percentage; + } + + public void setPercentage(Number percentage) { + this.percentage = percentage; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportPackagingDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportPackagingDTO.java new file mode 100644 index 0000000..ce07066 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportPackagingDTO.java @@ -0,0 +1,91 @@ +package de.avatic.lcc.dto.report; + +import com.fasterxml.jackson.annotation.JsonProperty; +import de.avatic.lcc.model.utils.DimensionUnit; +import de.avatic.lcc.model.utils.WeightUnit; + +public class ReportPackagingDTO { + + private Double width; + + private Double height; + + private Double length; + + private Double weight; + + @JsonProperty("dimension_unit") + private DimensionUnit dimensionUnit; + + @JsonProperty("weight_unit") + private WeightUnit weightUnit; + + @JsonProperty("unit_count") + private Integer unitCount; + + private Integer layer; + + public Double getWidth() { + return width; + } + + public void setWidth(Double width) { + this.width = width; + } + + public Double getHeight() { + return height; + } + + public void setHeight(Double height) { + this.height = height; + } + + public Double getLength() { + return length; + } + + public void setLength(Double length) { + this.length = length; + } + + public Double getWeight() { + return weight; + } + + public void setWeight(Double weight) { + this.weight = weight; + } + + public DimensionUnit getDimensionUnit() { + return dimensionUnit; + } + + public void setDimensionUnit(DimensionUnit dimensionUnit) { + this.dimensionUnit = dimensionUnit; + } + + public WeightUnit getWeightUnit() { + return weightUnit; + } + + public void setWeightUnit(WeightUnit weightUnit) { + this.weightUnit = weightUnit; + } + + public Integer getUnitCount() { + return unitCount; + } + + public void setUnitCount(Integer unitCount) { + this.unitCount = unitCount; + } + + public Integer getLayer() { + return layer; + } + + public void setLayer(Integer layer) { + this.layer = layer; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportPremisesDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportPremisesDTO.java new file mode 100644 index 0000000..7a1b3a0 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportPremisesDTO.java @@ -0,0 +1,70 @@ +package de.avatic.lcc.dto.report; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class ReportPremisesDTO { + List quantities; + + @JsonProperty("hs_code") + private String hsCode; + + @JsonProperty("tariff_rate") + private Number tariffRate; + + private ReportContainerDTO container; + + private ReportPackagingDTO packaging; + + @JsonProperty("quota_share") + private ReportQuotaShareDTO quotaShare; + + public List getQuantities() { + return quantities; + } + + public void setQuantities(List quantities) { + this.quantities = quantities; + } + + public String getHsCode() { + return hsCode; + } + + public void setHsCode(String hsCode) { + this.hsCode = hsCode; + } + + public Number getTariffRate() { + return tariffRate; + } + + public void setTariffRate(Number tariffRate) { + this.tariffRate = tariffRate; + } + + public ReportContainerDTO getContainer() { + return container; + } + + public void setContainer(ReportContainerDTO container) { + this.container = container; + } + + public ReportPackagingDTO getPackaging() { + return packaging; + } + + public void setPackaging(ReportPackagingDTO packaging) { + this.packaging = packaging; + } + + public ReportQuotaShareDTO getQuotaShare() { + return quotaShare; + } + + public void setQuotaShare(ReportQuotaShareDTO quotaShare) { + this.quotaShare = quotaShare; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportQuantityDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportQuantityDTO.java new file mode 100644 index 0000000..ffb8b07 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportQuantityDTO.java @@ -0,0 +1,37 @@ +package de.avatic.lcc.dto.report; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class ReportQuantityDTO { + + private String destination; + private Number quantity; + + private List route; + + public String getDestination() { + return destination; + } + + public void setDestination(String destination) { + this.destination = destination; + } + + public Number getQuantity() { + return quantity; + } + + public void setQuantity(Number quantity) { + this.quantity = quantity; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportQuotaShareDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportQuotaShareDTO.java new file mode 100644 index 0000000..d835568 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportQuotaShareDTO.java @@ -0,0 +1,51 @@ +package de.avatic.lcc.dto.report; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReportQuotaShareDTO { + + @JsonProperty("oversea_share") + private Double overseaShare; + + @JsonProperty("air_freight_share") + private Double airFreightShare; + + @JsonProperty("transport_time") + private Double transportTime; + + @JsonProperty("safety_stock") + private Double safetyStock; + + + public Double getOverseaShare() { + return overseaShare; + } + + public void setOverseaShare(Double overseaShare) { + this.overseaShare = overseaShare; + } + + public Double getAirFreightShare() { + return airFreightShare; + } + + public void setAirFreightShare(Double airFreightShare) { + this.airFreightShare = airFreightShare; + } + + public Double getTransportTime() { + return transportTime; + } + + public void setTransportTime(Double transportTime) { + this.transportTime = transportTime; + } + + public Double getSafetyStock() { + return safetyStock; + } + + public void setSafetyStock(Double safetyStock) { + this.safetyStock = safetyStock; + } +} diff --git a/src/main/java/de/avatic/lcc/dto/report/ReportRouteEntryDTO.java b/src/main/java/de/avatic/lcc/dto/report/ReportRouteEntryDTO.java new file mode 100644 index 0000000..99245c1 --- /dev/null +++ b/src/main/java/de/avatic/lcc/dto/report/ReportRouteEntryDTO.java @@ -0,0 +1,36 @@ +package de.avatic.lcc.dto.report; + +import de.avatic.lcc.dto.generic.RouteType; + +public class ReportRouteEntryDTO { + + private String name; + private RouteType type; + + private ReportEntryDTO cost; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RouteType getType() { + return type; + } + + public void setType(RouteType type) { + this.type = type; + } + + public ReportEntryDTO getCost() { + return cost; + } + + public void setCost(ReportEntryDTO cost) { + this.cost = cost; + } +} diff --git a/src/main/java/de/avatic/lcc/model/users/Group.java b/src/main/java/de/avatic/lcc/model/users/Group.java new file mode 100644 index 0000000..5ccdc1e --- /dev/null +++ b/src/main/java/de/avatic/lcc/model/users/Group.java @@ -0,0 +1,4 @@ +package de.avatic.lcc.model.users; + +public class Group { +} diff --git a/src/main/java/de/avatic/lcc/repos/CalculationJobRepository.java b/src/main/java/de/avatic/lcc/repos/CalculationJobRepository.java deleted file mode 100644 index 926bcfb..0000000 --- a/src/main/java/de/avatic/lcc/repos/CalculationJobRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.calculations.CalculationJob; -import org.springframework.data.repository.CrudRepository; - - -public interface CalculationJobRepository extends CrudRepository { - - -} diff --git a/src/main/java/de/avatic/lcc/repos/CountryPropertyTypeRepository.java b/src/main/java/de/avatic/lcc/repos/CountryPropertyTypeRepository.java deleted file mode 100644 index cb730ec..0000000 --- a/src/main/java/de/avatic/lcc/repos/CountryPropertyTypeRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.properties.CountryPropertyType; -import org.springframework.data.repository.CrudRepository; - - -public interface CountryPropertyTypeRepository extends CrudRepository { -} diff --git a/src/main/java/de/avatic/lcc/repos/CountryRepository.java b/src/main/java/de/avatic/lcc/repos/CountryRepository.java deleted file mode 100644 index 8ed23be..0000000 --- a/src/main/java/de/avatic/lcc/repos/CountryRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.country.Country; -import org.springframework.data.repository.CrudRepository; - - -public interface CountryRepository extends CrudRepository { - -} diff --git a/src/main/java/de/avatic/lcc/repos/DistanceMatrixRepository.java b/src/main/java/de/avatic/lcc/repos/DistanceMatrixRepository.java deleted file mode 100644 index c2ae091..0000000 --- a/src/main/java/de/avatic/lcc/repos/DistanceMatrixRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.nodes.DistanceMatrix; -import org.springframework.data.repository.CrudRepository; - - -public interface DistanceMatrixRepository extends CrudRepository { - - -} diff --git a/src/main/java/de/avatic/lcc/repos/MaterialRepository.java b/src/main/java/de/avatic/lcc/repos/MaterialRepository.java deleted file mode 100644 index 950a751..0000000 --- a/src/main/java/de/avatic/lcc/repos/MaterialRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.materials.Material; -import org.springframework.data.repository.CrudRepository; - - -public interface MaterialRepository extends CrudRepository { - - -} diff --git a/src/main/java/de/avatic/lcc/repos/NodeRepository.java b/src/main/java/de/avatic/lcc/repos/NodeRepository.java deleted file mode 100644 index 77fd5a3..0000000 --- a/src/main/java/de/avatic/lcc/repos/NodeRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.nodes.Node; -import org.springframework.data.repository.CrudRepository; - - -public interface NodeRepository extends CrudRepository { - - -} diff --git a/src/main/java/de/avatic/lcc/repos/PackagingPropertyTypeRepository.java b/src/main/java/de/avatic/lcc/repos/PackagingPropertyTypeRepository.java deleted file mode 100644 index 74f02ac..0000000 --- a/src/main/java/de/avatic/lcc/repos/PackagingPropertyTypeRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.packaging.PackagingPropertyType; -import org.springframework.data.repository.CrudRepository; - - -public interface PackagingPropertyTypeRepository extends CrudRepository { -} diff --git a/src/main/java/de/avatic/lcc/repos/PackagingRepository.java b/src/main/java/de/avatic/lcc/repos/PackagingRepository.java deleted file mode 100644 index dcebedc..0000000 --- a/src/main/java/de/avatic/lcc/repos/PackagingRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.packaging.Packaging; -import org.springframework.data.repository.CrudRepository; - - -public interface PackagingRepository extends CrudRepository { - - -} diff --git a/src/main/java/de/avatic/lcc/repos/PremissRepository.java b/src/main/java/de/avatic/lcc/repos/PremissRepository.java deleted file mode 100644 index ba6a471..0000000 --- a/src/main/java/de/avatic/lcc/repos/PremissRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.premisses.Premiss; -import org.springframework.data.repository.CrudRepository; - - -public interface PremissRepository extends CrudRepository { - - - -} diff --git a/src/main/java/de/avatic/lcc/repos/PropertySetRepository.java b/src/main/java/de/avatic/lcc/repos/PropertySetRepository.java deleted file mode 100644 index 35e8c82..0000000 --- a/src/main/java/de/avatic/lcc/repos/PropertySetRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.properties.PropertySet; -import org.springframework.data.repository.CrudRepository; - - -public interface PropertySetRepository extends CrudRepository { -} diff --git a/src/main/java/de/avatic/lcc/repos/SysGroupRepository.java b/src/main/java/de/avatic/lcc/repos/SysGroupRepository.java deleted file mode 100644 index f4ef784..0000000 --- a/src/main/java/de/avatic/lcc/repos/SysGroupRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.user.SysGroup; -import org.springframework.data.repository.CrudRepository; - - -public interface SysGroupRepository extends CrudRepository { - -} diff --git a/src/main/java/de/avatic/lcc/repos/SysUserNodeRepository.java b/src/main/java/de/avatic/lcc/repos/SysUserNodeRepository.java deleted file mode 100644 index f5fa2c3..0000000 --- a/src/main/java/de/avatic/lcc/repos/SysUserNodeRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.user.SysUserNode; -import org.springframework.data.repository.CrudRepository; - - -public interface SysUserNodeRepository extends CrudRepository { - -} diff --git a/src/main/java/de/avatic/lcc/repos/SysUserRepository.java b/src/main/java/de/avatic/lcc/repos/SysUserRepository.java deleted file mode 100644 index 7678a0b..0000000 --- a/src/main/java/de/avatic/lcc/repos/SysUserRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.user.SysUser; -import org.springframework.data.repository.CrudRepository; - - -public interface SysUserRepository extends CrudRepository { - - boolean existsByWorkdayIdIgnoreCase(String workdayId); - - boolean existsByEmailIgnoreCase(String email); - -} diff --git a/src/main/java/de/avatic/lcc/repos/SystemPropertyTypeRepository.java b/src/main/java/de/avatic/lcc/repos/SystemPropertyTypeRepository.java deleted file mode 100644 index f8ec1ab..0000000 --- a/src/main/java/de/avatic/lcc/repos/SystemPropertyTypeRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.properties.SystemPropertyType; -import org.springframework.data.repository.CrudRepository; - - -public interface SystemPropertyTypeRepository extends CrudRepository { -} diff --git a/src/main/java/de/avatic/lcc/repos/ValidityPeriodRepository.java b/src/main/java/de/avatic/lcc/repos/ValidityPeriodRepository.java deleted file mode 100644 index 66ff7e6..0000000 --- a/src/main/java/de/avatic/lcc/repos/ValidityPeriodRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.avatic.lcc.repos; - -import de.avatic.lcc.model.rates.ValidityPeriod; -import org.springframework.data.repository.CrudRepository; - - -public interface ValidityPeriodRepository extends CrudRepository { - -} diff --git a/src/main/java/de/avatic/lcc/repositories/users/GroupRepository.java b/src/main/java/de/avatic/lcc/repositories/users/GroupRepository.java index a4d9fc8..e38e0ab 100644 --- a/src/main/java/de/avatic/lcc/repositories/users/GroupRepository.java +++ b/src/main/java/de/avatic/lcc/repositories/users/GroupRepository.java @@ -1,9 +1,13 @@ package de.avatic.lcc.repositories.users; +import de.avatic.lcc.model.users.Group; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public class GroupRepository { - public listGroups() { + public List listGroups() { + } } diff --git a/src/main/java/de/avatic/lcc/service/bulk/BulkExportService.java b/src/main/java/de/avatic/lcc/service/bulk/BulkExportService.java index eb2b25f..f3fd3ab 100644 --- a/src/main/java/de/avatic/lcc/service/bulk/BulkExportService.java +++ b/src/main/java/de/avatic/lcc/service/bulk/BulkExportService.java @@ -9,4 +9,8 @@ public class BulkExportService { public InputStreamSource generateExport(BulkFileType bulkFileType) { return null; } + + public InputStreamSource generateExport(BulkFileType bulkFileType, Integer validityPeriodId) { + return null; + } } diff --git a/src/main/java/de/avatic/lcc/service/bulk/BulkFileProcessingService.java b/src/main/java/de/avatic/lcc/service/bulk/BulkFileProcessingService.java index 2ba9994..f053954 100644 --- a/src/main/java/de/avatic/lcc/service/bulk/BulkFileProcessingService.java +++ b/src/main/java/de/avatic/lcc/service/bulk/BulkFileProcessingService.java @@ -1,13 +1,27 @@ package de.avatic.lcc.service.bulk; import de.avatic.lcc.dto.bulk.BulkFileType; -import org.springframework.core.io.InputStreamSource; +import de.avatic.lcc.dto.bulk.BulkProcessingType; +import de.avatic.lcc.dto.bulk.BulkStatus; +import de.avatic.lcc.util.exception.clienterror.FileFormatNotSupportedException; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; @Service public class BulkFileProcessingService { - public InputStreamSource generateExport(BulkFileType type) { + public Integer processFile(BulkFileType type, BulkProcessingType processingType, MultipartFile file) { + + String contentType = file.getContentType(); + if (!"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".equals(contentType) && + !"application/vnd.ms-excel".equals(contentType)) { + throw new FileFormatNotSupportedException(contentType); + } + + return null; + } + + public BulkStatus getStatus(Integer id) { return null; } } diff --git a/src/main/java/de/avatic/lcc/service/calculation/CalclationSearchStringAnalyzerService.java b/src/main/java/de/avatic/lcc/service/calculation/CalclationSearchStringAnalyzerService.java deleted file mode 100644 index f0f4941..0000000 --- a/src/main/java/de/avatic/lcc/service/calculation/CalclationSearchStringAnalyzerService.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.avatic.lcc.service.calculation; - -import de.avatic.lcc.dto.calculation.SearchDTO; -import org.springframework.stereotype.Service; - -@Service -public class CalclationSearchStringAnalyzerService { - - public SearchDTO findMaterialAndSuppliers(String search) { - return null; - } -} diff --git a/src/main/java/de/avatic/lcc/service/calculation/CalculationCreationService.java b/src/main/java/de/avatic/lcc/service/calculation/CalculationCreationService.java deleted file mode 100644 index 5ade25f..0000000 --- a/src/main/java/de/avatic/lcc/service/calculation/CalculationCreationService.java +++ /dev/null @@ -1,13 +0,0 @@ -package de.avatic.lcc.service.calculation; - -import de.avatic.lcc.dto.calculation.view.PremiseViewDTO; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class CalculationCreationService { - public List createCalculations(List materialIds, List supplierIds, List userSupplierIds, boolean createEmpty) { - return null; - } -} diff --git a/src/main/java/de/avatic/lcc/service/calculation/PremiseCreationService.java b/src/main/java/de/avatic/lcc/service/calculation/PremiseCreationService.java new file mode 100644 index 0000000..a56579e --- /dev/null +++ b/src/main/java/de/avatic/lcc/service/calculation/PremiseCreationService.java @@ -0,0 +1,13 @@ +package de.avatic.lcc.service.calculation; + +import de.avatic.lcc.dto.calculation.edit.PremiseDetailDTO; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PremiseCreationService { + public List createPremises(List materialIds, List supplierIds, List userSupplierIds, boolean createEmpty) { + return null; + } +} diff --git a/src/main/java/de/avatic/lcc/service/calculation/PremiseSearchStringAnalyzerService.java b/src/main/java/de/avatic/lcc/service/calculation/PremiseSearchStringAnalyzerService.java new file mode 100644 index 0000000..6f280f6 --- /dev/null +++ b/src/main/java/de/avatic/lcc/service/calculation/PremiseSearchStringAnalyzerService.java @@ -0,0 +1,12 @@ +package de.avatic.lcc.service.calculation; + +import de.avatic.lcc.dto.calculation.create.PremiseSearchResultDTO; +import org.springframework.stereotype.Service; + +@Service +public class PremiseSearchStringAnalyzerService { + + public PremiseSearchResultDTO findMaterialAndSuppliers(String search) { + return null; + } +} diff --git a/src/main/java/de/avatic/lcc/service/calculation/PremisesService.java b/src/main/java/de/avatic/lcc/service/calculation/PremisesService.java index 7d58fdc..c808453 100644 --- a/src/main/java/de/avatic/lcc/service/calculation/PremisesService.java +++ b/src/main/java/de/avatic/lcc/service/calculation/PremisesService.java @@ -1,23 +1,47 @@ package de.avatic.lcc.service.calculation; -import de.avatic.lcc.dto.calculation.PremiseDTO; +import de.avatic.lcc.dto.calculation.edit.*; +import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateDTO; +import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateType; import de.avatic.lcc.dto.calculation.view.PremiseViewDTO; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; @Service public class PremisesService { - public List listCalculation(String filter, Integer page, Integer limit, Integer userId, Boolean deleted, Boolean archived, Boolean done) { + public List listPremises(String filter, Integer page, Integer limit, Integer userId, Boolean deleted, Boolean archived, Boolean done) { return null; }; - public List getPremises(List premissIds) { + public List getPremises(List premissIds) { return null; } - public void savePremises(List premises) { + public Integer startCalculation(List premises) { } + + public HashMap updateMasterData(MasterDataUpdateType type, MasterDataUpdateDTO dto) { + } + + public HashMap createDestination(CreateDestinationDTO createDestinationDTO) { + return null; + } + + public DestinationDTO getDestination(Integer id) { + return null; + } + + public void updateDestination(Integer id) { + } + + public void deleteDestination(Integer id) { + } + + public List setSupplier(SetSupplierDTO setSupplierDTO) { + return null; + } } diff --git a/src/main/java/de/avatic/lcc/service/configuration/ContainerRateService.java b/src/main/java/de/avatic/lcc/service/configuration/ContainerRateService.java new file mode 100644 index 0000000..8e01711 --- /dev/null +++ b/src/main/java/de/avatic/lcc/service/configuration/ContainerRateService.java @@ -0,0 +1,28 @@ +package de.avatic.lcc.service.configuration; + +import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO; +import de.avatic.lcc.repositories.pagination.SearchQueryResult; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class ContainerRateService { + + + public SearchQueryResult listContainerRates(int limit, int page, LocalDateTime validAt) { + return null; + } + + public SearchQueryResult listContainerRates(int limit, int page, Integer valid) { + return null; + } + + public SearchQueryResult listContainerRates(int limit, int page) { + return null; + } + + public ContainerRateDTO getContainerRate(Integer id) { + return null; + } +} diff --git a/src/main/java/de/avatic/lcc/service/configuration/CountryService.java b/src/main/java/de/avatic/lcc/service/configuration/CountryService.java index 6d816f4..7d730bc 100644 --- a/src/main/java/de/avatic/lcc/service/configuration/CountryService.java +++ b/src/main/java/de/avatic/lcc/service/configuration/CountryService.java @@ -1,6 +1,6 @@ package de.avatic.lcc.service.configuration; -import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO; +import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO; import de.avatic.lcc.dto.configuration.countries.update.CountryUpdateDTO; import de.avatic.lcc.dto.generic.CountryDTO; import de.avatic.lcc.model.properties.CountryProperty; @@ -40,7 +40,7 @@ public class CountryService { } @Transactional - public CountryViewDTO getCountry(Integer id) { + public CountryDetailDTO getCountry(Integer id) { List properties = countryPropertiesRepository.listByCountryId(id); return countryTransformerService.convertToCountryGetDTO(countryRepository.getById(id), properties).orElseThrow(); } diff --git a/src/main/java/de/avatic/lcc/service/configuration/MatrixRateService.java b/src/main/java/de/avatic/lcc/service/configuration/MatrixRateService.java new file mode 100644 index 0000000..3bcf97e --- /dev/null +++ b/src/main/java/de/avatic/lcc/service/configuration/MatrixRateService.java @@ -0,0 +1,24 @@ +package de.avatic.lcc.service.configuration; + +import de.avatic.lcc.dto.configuration.matrixrates.MatrixRateDTO; +import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO; +import de.avatic.lcc.repositories.pagination.SearchQueryResult; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class MatrixRateService { + public SearchQueryResult listRates(int limit, int page, LocalDateTime validAt) { + } + + public SearchQueryResult listRates(int limit, int page, Integer valid) { + } + + public SearchQueryResult listRates(int limit, int page) { + } + + public MatrixRateDTO getRate(Integer id) { + return null; + } +} diff --git a/src/main/java/de/avatic/lcc/service/configuration/NodeService.java b/src/main/java/de/avatic/lcc/service/configuration/NodeService.java index 911f67b..27bef52 100644 --- a/src/main/java/de/avatic/lcc/service/configuration/NodeService.java +++ b/src/main/java/de/avatic/lcc/service/configuration/NodeService.java @@ -1,7 +1,7 @@ package de.avatic.lcc.service.configuration; import de.avatic.lcc.dto.generic.NodeDTO; -import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO; +import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO; import de.avatic.lcc.dto.configuration.nodes.update.NodeUpdateDTO; import de.avatic.lcc.repositories.NodeRepository; import de.avatic.lcc.repositories.pagination.SearchQueryPagination; @@ -31,11 +31,11 @@ public class NodeService { return SearchQueryResult.map(nodeRepository.listNodes(filter, true, new SearchQueryPagination(page, limit)), nodeDTOTransformer::toNodeDTO); } - public SearchQueryResult listNodesView(String filter, int page, int limit) { + public SearchQueryResult listNodesView(String filter, int page, int limit) { return SearchQueryResult.map(nodeRepository.listNodes(filter, true, new SearchQueryPagination(page, limit)), nodeViewDTOTransformer::toNodeViewDTO); } - public NodeViewDTO getNode(Integer id) { + public NodeDetailDTO getNode(Integer id) { return nodeViewDTOTransformer.toNodeViewDTO(nodeRepository.getById(id).orElseThrow(() -> new NodeNotFoundException(id))); } diff --git a/src/main/java/de/avatic/lcc/service/configuration/StagedChangesService.java b/src/main/java/de/avatic/lcc/service/configuration/StagedChangesService.java new file mode 100644 index 0000000..5f599fd --- /dev/null +++ b/src/main/java/de/avatic/lcc/service/configuration/StagedChangesService.java @@ -0,0 +1,14 @@ +package de.avatic.lcc.service.configuration; + +import org.springframework.stereotype.Service; + +@Service +public class StagedChangesService { + public Boolean hasRateDrafts() { + return false; + } + + public void approveRateDrafts() { + + } +} diff --git a/src/main/java/de/avatic/lcc/service/transformer/country/CountryTransformerService.java b/src/main/java/de/avatic/lcc/service/transformer/country/CountryTransformerService.java index 63f39f1..b6ae640 100644 --- a/src/main/java/de/avatic/lcc/service/transformer/country/CountryTransformerService.java +++ b/src/main/java/de/avatic/lcc/service/transformer/country/CountryTransformerService.java @@ -1,7 +1,7 @@ package de.avatic.lcc.service.transformer.country; -import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO; +import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO; import de.avatic.lcc.dto.configuration.countries.view.CountryViewPropertyDTO; import de.avatic.lcc.model.country.Country; import de.avatic.lcc.model.properties.CountryProperty; @@ -15,11 +15,11 @@ import java.util.Optional; public class CountryTransformerService { - public Optional convertToCountryGetDTO(Optional country, List properties) { + public Optional convertToCountryGetDTO(Optional country, List properties) { if (country.isEmpty()) return Optional.empty(); - CountryViewDTO dto = new CountryViewDTO(); + CountryDetailDTO dto = new CountryDetailDTO(); Country entity = country.get(); dto.setIsoCode(entity.getIsoCode().getCode()); diff --git a/src/main/java/de/avatic/lcc/service/transformer/generic/NodeDTOTransformer.java b/src/main/java/de/avatic/lcc/service/transformer/generic/NodeDTOTransformer.java index cadd260..6a27d22 100644 --- a/src/main/java/de/avatic/lcc/service/transformer/generic/NodeDTOTransformer.java +++ b/src/main/java/de/avatic/lcc/service/transformer/generic/NodeDTOTransformer.java @@ -25,7 +25,7 @@ public class NodeDTOTransformer { NodeDTO dto = new NodeDTO(); ArrayList types = new ArrayList<>(); - if (entity.getSink()) types.add(NodeTypeDTO.SINK); + if (entity.getSink()) types.add(NodeTypeDTO.DESTINATION); if (entity.getSource()) types.add(NodeTypeDTO.SOURCE); if (entity.getIntermediate()) types.add(NodeTypeDTO.INTERMEDIATE); diff --git a/src/main/java/de/avatic/lcc/service/transformer/nodes/NodeViewDTOTransformer.java b/src/main/java/de/avatic/lcc/service/transformer/nodes/NodeViewDTOTransformer.java index bd8f861..733a278 100644 --- a/src/main/java/de/avatic/lcc/service/transformer/nodes/NodeViewDTOTransformer.java +++ b/src/main/java/de/avatic/lcc/service/transformer/nodes/NodeViewDTOTransformer.java @@ -2,7 +2,7 @@ package de.avatic.lcc.service.transformer.nodes; import de.avatic.lcc.dto.generic.NodeDTO; import de.avatic.lcc.dto.generic.NodeTypeDTO; -import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO; +import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO; import de.avatic.lcc.model.nodes.Node; import de.avatic.lcc.repositories.CountryRepository; import de.avatic.lcc.repositories.NodeRepository; @@ -32,8 +32,8 @@ public class NodeViewDTOTransformer { this.nodeRepository = nodeRepository; } - public NodeViewDTO toNodeViewDTO(Node node) { - NodeViewDTO dto = new NodeViewDTO(); + public NodeDetailDTO toNodeViewDTO(Node node) { + NodeDetailDTO dto = new NodeDetailDTO(); Map predecessors = new HashMap<>(); @@ -55,7 +55,7 @@ public class NodeViewDTOTransformer { private ArrayList toNodeTypeArrayList(Node entity) { ArrayList types = new ArrayList<>(); - if (entity.getSink()) types.add(NodeTypeDTO.SINK); + if (entity.getSink()) types.add(NodeTypeDTO.DESTINATION); if (entity.getSource()) types.add(NodeTypeDTO.SOURCE); if (entity.getIntermediate()) types.add(NodeTypeDTO.INTERMEDIATE); return types; diff --git a/src/main/java/de/avatic/lcc/service/users/GroupService.java b/src/main/java/de/avatic/lcc/service/users/GroupService.java index 5ecfe1f..23dc2e4 100644 --- a/src/main/java/de/avatic/lcc/service/users/GroupService.java +++ b/src/main/java/de/avatic/lcc/service/users/GroupService.java @@ -23,6 +23,9 @@ public class GroupService { } public SearchQueryResult listGroups(int page, int limit) { - groupRepository.listGroups() + + groupRepository.listGroups(); + //todo translate + return null; } } diff --git a/src/main/java/de/avatic/lcc/util/exception/clienterror/FileFormatNotSupportedException.java b/src/main/java/de/avatic/lcc/util/exception/clienterror/FileFormatNotSupportedException.java new file mode 100644 index 0000000..ab6de7c --- /dev/null +++ b/src/main/java/de/avatic/lcc/util/exception/clienterror/FileFormatNotSupportedException.java @@ -0,0 +1,7 @@ +package de.avatic.lcc.util.exception.clienterror; + +public class FileFormatNotSupportedException extends InvalidArgumentException{ + public FileFormatNotSupportedException(String fileType) { + super("Unsupported file type", fileType); + } +} diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 062956b..bda299d 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -328,7 +328,7 @@ CREATE TABLE IF NOT EXISTS premiss is_fca_enabled BOOLEAN DEFAULT FALSE, oversea_share DECIMAL(7, 4), hs_code CHAR(8), - custom_rate DECIMAL(7, 4), + tariff_rate DECIMAL(7, 4), state CHAR(10) DEFAULT 'DRAFT', individual_hu_length INT UNSIGNED COMMENT 'user entered dimensions in mm (if system-wide packaging is used, packaging dimensions are copied here after creation)', individual_hu_height INT UNSIGNED COMMENT 'user entered dimensions in mm (if system-wide packaging is used, packaging dimensions are copied here after creation)', @@ -516,7 +516,7 @@ CREATE TABLE IF NOT EXISTS calculation_job_custom id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, custom_value DECIMAL(15, 2) NOT NULL,-- Zollwert, custom_duties DECIMAL(15, 2) NOT NULL,-- Zollabgaben, - custom_rate DECIMAL(7, 4) NOT NULL,-- Zollsatz, + tariff_rate DECIMAL(7, 4) NOT NULL,-- Zollsatz, annual_cost DECIMAL(15, 2) NOT NULL-- Zollabgaben inkl. Einmalkosten, );