Commit graph

303 commits

Author SHA1 Message Date
Jan
ce6b8dd9b0 Integrated tariff rate calculations and customs API:
- **Backend**: Introduced `EUTaxationApiService` for TARIC data retrieval and integrated tariff rate lookup functionality. Added supporting DTOs and updated services to handle custom measures and updated logic for material and supplier changes.
- **Frontend**: Enhanced mass and single edit calculation components to include tariff rate lookup functionality and warnings. Introduced `useCustomsStore` for state management of customs data.
- **Database**: Added `nomenclature` table for storing HS code-related information.
- **Other**: Configured SOAP client for TARIC API and added logging for debugging.
2025-11-06 17:35:41 +01:00
Jan
be1ef5091b Refined distance calculations and enhanced reporting layout:
- **Backend**: Adjusted `getDistance` implementation to retrieve distances via `DistanceApiService`, with fallback to `fast` algorithm. Updated `DistanceService` to utilize API responses for more accurate calculations. Enhanced `ExcelReportingService` handling for main run containers and mixed premises logic.
- **Frontend**: Improved `Report.vue` structure for better readability and modularity. Added logic to conditionally display container details based on the main run's existence.
2025-11-01 13:27:12 +01:00
Jan
f7efc9eb81 Refined actuator endpoint security rules:
- Allowed public access to `/actuator/health`.
- Enforced authentication for other `/actuator/**` endpoints in production.
- Allowed all `/actuator/**` endpoints in development.
2025-10-30 21:56:35 +01:00
Jan
f62cfbfb66 Fixing API access through external APPs 2025-10-30 21:36:10 +01:00
Jan
d06aa74029 Fixing the redirect loop in the entra id authentication 2025-10-30 18:38:14 +01:00
Jan
9bf148a09f Added csrf protection matcher to exclude bearer token calls from csfr 2025-10-30 17:04:33 +01:00
Jan
98e69164ed Added custom BearerTokenResolver to stop oauth2ResourceServer from evaluating requests with jwt token (API) 2025-10-30 16:37:52 +01:00
Jan
a3563449c8 Refined production CORS configuration and streamlined /oauth2/token settings:
- Centralized CORS logic with distinct configuration for `/oauth2/token`.
- Improved handling of allowed methods, headers, credentials, and max age.
2025-10-30 15:18:57 +01:00
Jan
a289cce805 Enhanced CORS configuration for OAuth2 and role-based tab visibility in frontend:
- **Backend**: Added separate CORS settings for `/oauth2/token` endpoint with enhanced origin handling based on new `lcc.allowed_oauth_token_cors` property.
- **Frontend**: Updated `Config.vue` to conditionally display `nodesTab` and `bulkOperationsTab` based on user roles.
2025-10-30 15:05:12 +01:00
Jan
e1791942cb Updated CORS configuration to handle empty allowed origins and added placeholder property. 2025-10-30 14:25:09 +01:00
Jan
5486c25603 Added production VITE environment file and renamed development environment file 2025-10-30 14:02:51 +01:00
Jan
a7ea4d97d2 Enhanced owner validation and property checks in services:
- **Backend**:
  - Check ownership before execution in DestinationService and PremisesService
  - Added Valid period check in pre flight check
  - Fixed allowed headers in cors config
  - added user groups to migration
2025-10-30 13:39:59 +01:00
Jan
302967e645 Enhanced error handling and route saving mechanism, improved UI modal behavior:
- **Frontend**: Updated `CalculationAssistant.vue` modal to disable backdrop closing via `:close-on-backdrop="false"`.
- **Backend**:
  - Adjusted error message processing in `CalculationExecutionService` to handle potential `null` values gracefully.
  - Improved route saving in `DestinationService` by correcting source node logic and refining `RouteIds` assignments.
2025-10-28 21:35:30 +01:00
Jan
e1c1b2918f Updated Air Freight Share Properties logic:
- Modified V4 migration to calculate `AIR_SHARE` as `0.03` for countries with `SAFETY_STOCK` value of 55, otherwise `0`.
- Refactored SQL to use `CASE` expression and JOIN for safety stock lookup within property set constraints.
2025-10-28 18:40:06 +01:00
Jan
d840b05da2 Enhanced OAuth2 API Tester tool, updated validation and improved CORS configuration:
- Improved OAuth2 Tester UI/UX: added support for multiple HTTP methods, query parameters, request body validation, collapsible result sections, and dynamic input handling.
- Enhanced `UserController` with validation annotations for `UserDTO` in API requests.
- Updated `UserDTO` to include stricter validation constraints (`@NotNull`, `@NotBlank`, `@Email`).
- Adjusted CORS configuration to allow all origins for OAuth endpoints.
2025-10-28 18:01:21 +01:00
Jan
42913045b3 Merge remote-tracking branch 'origin/main' 2025-10-28 15:58:26 +01:00
Jan
7ff657ba0a Added OAuth2 API Tester tool and improved CORS/OAuth support:
- Introduced `OAuth2 API Tester` (HTML+JS) in `/tools`.
- Updated security configuration:
  - Added comprehensive CORS configurations for OAuth endpoints.
  - Enhanced CSRF handling to exclude `/oauth2/token`.
  - Adjusted role handling to ensure case-insensitivity.
- Fixed `RIGHT-MANAGEMENT` role in `UserController`.
- Replaced logo asset in frontend.
2025-10-28 15:58:15 +01:00
Anja Guenther
9604d342d7 Merge branch 'main' of git.avatic.de:avatic/lcc_tool
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2025-10-26 21:52:17 +01:00
Anja Guenther
562764561e Merge branch 'main' of git.avatic.de:avatic/lcc_tool 2025-10-26 21:50:59 +01:00
Anja Guenther
4c6b0e5fe2 Container Berechnung limiting factor korrigiert,
Migration für materialien vollständig,
Safety target für countries geändert
2025-10-26 21:50:01 +01:00
Jan
68b688673c Added AppGroupItem Vue component for displaying group information with selection functionality 2025-10-26 17:22:32 +01:00
Jan
6acfbe1602 Introduced app management functionality:
- Added Vue components (`AppListItem`, `AddApp`, `Apps`) for app management.
- Implemented Vuex stores for apps and groups.
- Enhanced backend:
  - CRUD operations for apps and group mappings.
  - Introduced a new service for app-related logic.
  - Updated database schema and DTO structure.
- Adjusted security and CORS configurations.
- Updated docker-compose to align service dependencies.
2025-10-26 17:19:46 +01:00
Jan
f75b20830c Extended role-based access in MaterialController to include additional roles. 2025-10-26 12:37:11 +01:00
Jan
932b42d926 Cleanup application.properties and .env, added vite .env to repository 2025-10-25 18:52:54 +02:00
Jan
55daec064c Commented out dynamic OAuth2 redirection configuration in SecurityConfig. 2025-10-25 17:19:06 +02:00
Jan
7a4d1bf465 Added same-site attribute for session cookies and updated application.properties. 2025-10-25 17:16:11 +02:00
Jan
d190b69664 Marked session cookies as secure in application.properties. 2025-10-25 16:45:43 +02:00
Jan
8cb922a88d Updated properties and enhanced SecurityConfig
- Changed `server.forward-headers-strategy` to `native` in `application.properties`.
- Added exclusion for `/login/oauth2/code/**` in CSRF configuration.
2025-10-25 16:45:01 +02:00
Jan
3f0644c1e9 Set dynamic redirect URI in SecurityConfig and updated properties 2025-10-25 16:17:56 +02:00
Jan
b33e28a248 Removed Azure redirect URI 2025-10-25 11:47:22 +02:00
Jan
e7ba98bdd7 Added Azure redirect URI in properties and dynamic backend URL in frontend configuration 2025-10-24 20:14:24 +02:00
Jan
2b83bfe956 Replaced Material data with dummy data & restored dockerfile
because flyway does not execute successfully with the contained duplicates etc.
2025-10-24 08:06:33 +02:00
Jan
f982bc4629 Replaced Material data with dummy data
because flyway does not execute successfully with the contained duplicates etc.
2025-10-24 06:31:36 +02:00
Jan
e79db9e1b7 Introduced Flyway 2025-10-24 06:21:11 +02:00
Jan
a83ee4dacd - added actuator
- optimized dockerfile
2025-10-23 20:59:48 +02:00
Jan
c071609eb2 Refactor & Enhancements:
- Refactored `validateApp` in `AppsService` to return `Optional<App>` instead of `null`.
- Updated `JwtTokenService` to handle `expiration` parameter and use `App` object for token creation.
- Improved `TokenController` to work with the updated service layer.
- Fixed typo in `Report.vue` ("Airfreight" to "Air freight").
- Updated application properties to use `SPRING_PROFILES_ACTIVE`.
- Added `.dockerignore`, `dockerfile`, and `docker-compose.yml`, enabling Docker support.
- Removed unused Maven plugins and updated `vite.config.js` build directory.
- Introduced Gitea CI workflows for building and pushing Docker images.
2025-10-23 14:52:28 +02:00
Jan
0c51bf7c3d Add version to exec-maven-plugin and enforce role-based access for user and group endpoints 2025-10-21 21:34:20 +02:00
Jan
a76de8e53c - Refactoring: put all models in subdirectories under model:
* model/db -> entities
  * model/excel -> excel parsing
  * model/calulation -> for logistic cost calculation
  * model/azuremaps -> geocding

- added endpoints & service & repo to manage external apps.
- added jwt issuer service & oauth/token endpoint for external apps.
2025-10-21 21:23:27 +02:00
Jan
23ee5fad79 Bugfix: improve geocoding logic for Azure Maps API; enhance validation and address mapping in batch processing 2025-10-21 13:09:56 +02:00
Jan
2aaf820bdc Bugfix:
- taking the newest validity tuple, when fetching reports
- risk and changes are only calculated for main run (and not all sections)
2025-10-19 21:56:32 +02:00
Jan
0c88c5ed0f Bugfix: takes property set into account when collecting comparable reports. 2025-10-19 19:55:19 +02:00
Jan
67fc5607e3 Bugfix: creates a copy of all matrix rates if only container rates are updated and vice versa 2025-10-19 19:06:11 +02:00
Jan
d10f301b3d Bugfix: change risk only for none matrix rates. 2025-10-19 17:31:16 +02:00
Jan
b19e16fbb0 Bugfix: fixed reporting for user generated nodes 2025-10-19 17:24:23 +02:00
Jan
a2e0029dfe Bugfix: update url, when remove line from mass edit view 2025-10-19 15:27:30 +02:00
Jan
de896cea30 Bugfix: price mass edit 2025-10-19 15:06:55 +02:00
Jan
3d3a4dbfab Bugfix: user supplier "source"-type bugfix 2025-10-19 14:55:54 +02:00
Jan
c573d7647f - fixed bug in material mass edit
- removed geocoding from bulk import (temporarly)
2025-10-19 13:47:40 +02:00
Jan
108e89195c - fixed pagination error on delete etc. 2025-10-19 13:39:53 +02:00
Jan
3b05befa92 added missing changes to perious commit 2025-10-19 13:05:00 +02:00