Create project structure with core models and logging
This commit is contained in:
1 parent
a84fd04035
commit
e34c491719
11 files changed
+79
-5
No files matched your search
@@ -0,0 +1,7 @@
|
||||
"""SAB Taetigkeitsnachweis generator package."""
|
||||
|
||||
__all__ = [
|
||||
"models",
|
||||
"errors",
|
||||
"logging_utils",
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
"""CLI entrypoint and orchestration layer."""
|
||||
@@ -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."""
|
||||
@@ -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",
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
"""Record matching logic across allocation and master data."""
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
"""Parsing and normalization for source workbooks."""
|
||||
@@ -0,0 +1 @@
|
||||
"""Shared utility helpers."""
|
||||
@@ -0,0 +1 @@
|
||||
"""Source and business rule validation."""
|
||||
@@ -0,0 +1 @@
|
||||
"""Template-based output workbook writer."""
|
||||
Reference in new issue
Block a user