Implement complete metering data management for energy communities: - MeteringData entity with unique constraint (metering_point_id, interval_start, data_type) - Bulk upload via JSON or XLSX (multipart) with validation - XLSX parser using Apache POI with comma-decimal support - Ownership check on GET endpoints (userId must match metering point owner) - Deduplication: existing records overwritten on re-upload - DataSource tracking (EMAIL_XLSX, API, MANUAL) - Query endpoints: by metering point, by type, by upload batch Additional fixes: - MapStruct annotation processor: add to execution-level annotationProcessorPaths (Spring Boot parent POM was overriding plugin-level config) - EnergyCommunityMapper + MeteringDataMapper: componentModel=spring - UserMapper: ignore passwordResetToken/Expiry (unmapped target policy ERROR) - TariffService: add TariffInviteRepository dependency + invitation check - TariffServiceTest: add missing @Mock for TariffInviteRepository - SecurityConfig: permit /actuator/health and /actuator/info - pom.xml: add poi-ooxml, postgresql, spring-boot-starter-actuator - .gitignore: add *.log, survey/, backend.log Tests: 137/137 passing
63 lines
1.5 KiB
Bash
63 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# ============================================================
|
|
# EEG Portal - Deploy Script for Hetzner Cloud
|
|
# ============================================================
|
|
|
|
set -e
|
|
|
|
echo "=== EEG Portal Deployment ==="
|
|
echo ""
|
|
|
|
# Check if .env exists
|
|
if [ ! -f .env ]; then
|
|
echo "ERROR: .env file not found!"
|
|
echo "Please copy .env.example to .env and fill in the values."
|
|
echo ""
|
|
echo " cp .env.example .env"
|
|
echo " nano .env"
|
|
exit 1
|
|
fi
|
|
|
|
# Check required variables
|
|
source .env
|
|
|
|
if [ -z "$JWT_SECRET" ] || [ "$JWT_SECRET" = "your-super-secret-jwt-key-change-this" ]; then
|
|
echo "ERROR: JWT_SECRET must be set in .env"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$POSTGRES_PASSWORD" ] || [ "$POSTGRES_PASSWORD" = "your-strong-db-password-change-this" ]; then
|
|
echo "ERROR: POSTGRES_PASSWORD must be set in .env"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$APP_FRONTEND_URL" ] || [ "$APP_FRONTEND_URL" = "https://your-domain.at" ]; then
|
|
echo "ERROR: APP_FRONTEND_URL must be set in .env"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Configuration OK!"
|
|
echo ""
|
|
|
|
# Stop existing containers
|
|
echo "Stopping existing containers..."
|
|
docker compose down
|
|
|
|
# Build and start
|
|
echo "Building and starting services..."
|
|
docker compose up -d --build
|
|
|
|
echo ""
|
|
echo "=== Deployment complete! ==="
|
|
echo ""
|
|
echo "Services:"
|
|
echo " - Frontend: http://localhost:${APP_PORT:-80}"
|
|
echo " - Backend: http://localhost:8080"
|
|
echo " - Database: localhost:5432"
|
|
echo ""
|
|
echo "To view logs:"
|
|
echo " docker compose logs -f"
|
|
echo ""
|
|
echo "To stop:"
|
|
echo " docker compose down"
|