Implement foerderquote calculation logic

This commit is contained in:
Rob committed 2026-04-21 15:29:56 +02:00
1 parent f2da062c49
commit 88d7f81723
2 files changed
+19 -4

No files matched your search

+4 -4
View File
@@ -42,9 +42,9 @@ Projekt vollstaendig umsetzen: aus PS_PW.xlsx und Stellenbeschreibungen.xlsx mon
- [x] Mehrfache Eintraege je Name korrekt behalten - [x] Mehrfache Eintraege je Name korrekt behalten
## Phase 4 - Matching und Fachlogik ## Phase 4 - Matching und Fachlogik
- [ ] T7: Foerderquote berechnen - [x] T7: Foerderquote berechnen
- [ ] Formel: funded_weekly_hours / contract_weekly_hours * 100 - [x] Formel: funded_weekly_hours / contract_weekly_hours * 100
- [ ] Rundungs-/Vergleichsregeln definieren - [x] Rundungs-/Vergleichsregeln definieren
- [ ] T8: Matching-Engine bauen - [ ] T8: Matching-Engine bauen
- [ ] Primaerschluessel Name anwenden - [ ] Primaerschluessel Name anwenden
- [ ] Kandidaten via Stellenanteil/Foerderquote aufloesen - [ ] Kandidaten via Stellenanteil/Foerderquote aufloesen
@@ -111,4 +111,4 @@ Projekt vollstaendig umsetzen: aus PS_PW.xlsx und Stellenbeschreibungen.xlsx mon
8. T15 -> T16 -> T17 8. T15 -> T16 -> T17
## Aktueller Startpunkt ## Aktueller Startpunkt
- [ ] Naechste aktive Aufgabe: T7 (Foerderquote berechnen) - [ ] Naechste aktive Aufgabe: T8 (Matching-Engine bauen)
+15
View File
@@ -1 +1,16 @@
"""Record matching logic across allocation and master data.""" """Record matching logic across allocation and master data."""
from __future__ import annotations
from .errors import ValidationError
from .models import AllocationRecord
def calculate_foerderquote_percent(allocation: AllocationRecord, precision: int = 2) -> float:
if allocation.contract_hours_weekly <= 0:
raise ValidationError(
"contract_hours_weekly must be greater than 0 for foerderquote calculation."
)
raw_share = (allocation.funded_hours_weekly / allocation.contract_hours_weekly) * 100.0
return round(raw_share, precision)