fix: agent-08 Kiosk-Härtung + 24h-Zeiteintrag-Bug

- fix: worked_minutes nutzt jetzt Sekunden statt Minuten für Overnight-Vergleich
  (end < start statt end <= start) – verhindert 24h-Anzeige bei Schnell-Stempel
  in derselben Minute (z.B. 23:34:46 → 23:34:48)
- fix: _check_arbzg() gleicher Sec-basierter Fix
- fix: KioskDeviceStatus Enum values_callable → kiosk list crasht nicht mehr
- feat: kiosk rotate-key CLI-Kommando (Status→pending, Re-Enrollment)
- feat: Kiosk-Settings in CompanyOut/CompanyUpdate Schema (require_approval,
  track_current_user, heartbeat_interval_sec)
- feat: Kiosk-Terminal-Einstellungsblock in CompanySettingsPage (🖥️)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 01:42:08 +02:00
parent eae0f6f9b4
commit e83a3fbbdd
7 changed files with 267 additions and 12 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class KioskDevice(Base):
# ── Ed25519-Auth (löst token_hash + is_active ab) ─────────────────────────
status: Mapped[KioskDeviceStatus] = mapped_column(
Enum(KioskDeviceStatus, name="kioskdevicestatus"),
Enum(KioskDeviceStatus, name="kioskdevicestatus", values_callable=lambda x: [e.value for e in x]),
nullable=False,
default=KioskDeviceStatus.REVOKED,
)
+12 -5
View File
@@ -66,11 +66,18 @@ class TimeEntry(Base):
"""Gearbeitete Minuten (ohne Pausen), None wenn noch offen."""
if self.end_time is None:
return None
start_total = self.start_time.hour * 60 + self.start_time.minute
end_total = self.end_time.hour * 60 + self.end_time.minute
if end_total <= start_total:
end_total += 24 * 60 # overnight shift
return max(0, end_total - start_total - self.break_minutes)
# Sekunden einbeziehen um Sub-Minuten-Einträge korrekt zu behandeln
# (z.B. Einstemp+Ausstemp in derselben Minute → soll 0h zeigen, nicht 24h)
start_secs = (self.start_time.hour * 3600
+ self.start_time.minute * 60
+ self.start_time.second)
end_secs = (self.end_time.hour * 3600
+ self.end_time.minute * 60
+ self.end_time.second)
if end_secs < start_secs:
end_secs += 24 * 3600 # Nachtschicht (Ende am nächsten Tag)
total_mins = (end_secs - start_secs) // 60
return max(0, total_mins - self.break_minutes)
@property
def worked_hours(self) -> float | None: