Create project structure with core models and logging

This commit is contained in:
Rob committed 2026-04-21 15:24:40 +02:00
1 parent a84fd04035
commit e34c491719
11 files changed
+79 -5

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
"""SAB Taetigkeitsnachweis generator package."""
__all__ = [
"models",
"errors",
"logging_utils",
]
+1
View File
@@ -0,0 +1 @@
"""CLI entrypoint and orchestration layer."""
+14
View File
@@ -0,0 +1,14 @@
class TaetigkeitsnachweisError(Exception):
"""Base exception for all domain-specific failures."""
class ConfigurationError(TaetigkeitsnachweisError):
"""Raised when configuration is missing or invalid."""
class ValidationError(TaetigkeitsnachweisError):
"""Raised when source or business validation fails."""
class MatchingError(TaetigkeitsnachweisError):
"""Raised when records cannot be matched uniquely."""
+8
View File
@@ -0,0 +1,8 @@
import logging
def configure_logging(level: int = logging.INFO) -> None:
logging.basicConfig(
level=level,
format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
)
+1
View File
@@ -0,0 +1 @@
"""Record matching logic across allocation and master data."""
+39
View File
@@ -0,0 +1,39 @@
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class AllocationRecord:
employee_name: str
contract_hours_weekly: float
project_key: str
funded_hours_weekly: float
notes: str = ""
@dataclass(frozen=True)
class MasterDataRecord:
record_id: str
antragsnummer: str
name: str
qualifikation: str
stellenanteil_percent: float
funktion: str
taetigkeit: str
@dataclass(frozen=True)
class MatchedAssignment:
allocation: AllocationRecord
masterdata: MasterDataRecord
foerderquote_percent: float
@dataclass(frozen=True)
class ValidationIssue:
code: str
message: str
severity: str = "error"
context: Optional[str] = None
+1
View File
@@ -0,0 +1 @@
"""Parsing and normalization for source workbooks."""
+1
View File
@@ -0,0 +1 @@
"""Shared utility helpers."""
+1
View File
@@ -0,0 +1 @@
"""Source and business rule validation."""
+1
View File
@@ -0,0 +1 @@
"""Template-based output workbook writer."""