Refactor code structure for improved readability and maintainability

This commit is contained in:
bsiggel
2026-03-26 22:24:07 +00:00
parent 9b2fb5ae4a
commit 1cd8de8574
10 changed files with 265 additions and 1313 deletions

View File

@@ -49,7 +49,7 @@ async def handler(request: ApiRequest, ctx: FlowContext) -> ApiResponse:
ctx.logger.error("❌ Invalid auth token")
ctx.logger.error(f" Expected: Bearer {expected_token[:10]}...")
ctx.logger.error(f" Received: {auth_header[:30]}...")
return ApiResponse(status_code=401, body={"error": "Unauthorized"})
return ApiResponse(status=401, body={"error": "Unauthorized"})
ctx.logger.info("✅ Auth-Token valid")
@@ -75,7 +75,7 @@ async def handler(request: ApiRequest, ctx: FlowContext) -> ApiResponse:
if not aktennummer:
ctx.logger.error("❌ Missing 'aktennummer' in payload")
return ApiResponse(status_code=400, body={"error": "Missing aktennummer"})
return ApiResponse(status=400, body={"error": "Missing aktennummer"})
ctx.logger.info(f"📂 Aktennummer: {aktennummer}")
ctx.logger.info(f"⏰ Timestamp: {timestamp}")
@@ -114,7 +114,7 @@ async def handler(request: ApiRequest, ctx: FlowContext) -> ApiResponse:
ctx.logger.info("=" * 80)
return ApiResponse(
status_code=200,
status=200,
body={
"success": True,
"aktennummer": aktennummer,
@@ -136,7 +136,7 @@ async def handler(request: ApiRequest, ctx: FlowContext) -> ApiResponse:
ctx.logger.error(traceback.format_exc())
return ApiResponse(
status_code=500,
status=500,
body={
"success": False,
"error": str(e),