feat: agent-11 PR1 – Vertretung, Storno-Re-Genehmigung, Kommentare

Abwesenheits-Modul abgerundet (Feature-Parität mit Urlaubsverwaltung):

- Vertretung: Overlap-Warnung beim Anlegen, E-Mail an Vertretung bei
  Genehmigung, GET /absences/?as_substitute=true, neuer schlanker
  GET /users/colleagues (alle Rollen, RLS-gefenced) für die Auswahl;
  Vertreter-Dropdown + Anzeige in der Liste.
- Stornierung mit Re-Genehmigung: neuer Status CANCELLATION_REQUESTED,
  POST /absences/{id}/request-cancellation; Manager genehmigt/lehnt über
  bestehende approve/reject ab (Urlaub + FZA-Rückbuchung via _apply_cancellation).
- Kommentare: Model AbsenceComment (company_id-RLS), GET/POST comments,
  System-Kommentare bei Statuswechsel, AbsenceCommentsModal.
- Fix: CalDAV fire-and-forget nutzte die Request-Session weiter (in Tests
  geteilt -> "another operation in progress"); jetzt sync_*_bg mit eigener
  Session + RLS-Bypass.

Migration 0035. 178/178 Tests grün. Deployed auf 137 + 164.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 11:47:47 +02:00
co-authored by Claude Opus 4.8
parent be22a51805
commit 6fa66b8c13
18 changed files with 793 additions and 27 deletions
+22
View File
@@ -122,6 +122,28 @@ class AbsenceReject(BaseModel):
rejection_reason: str = Field(min_length=1)
class CancellationRequest(BaseModel):
reason: str | None = Field(None, max_length=1000)
# ── Kommentare ────────────────────────────────────────────────────────────────
class AbsenceCommentOut(BaseModel):
model_config = {"from_attributes": True}
id: uuid.UUID
absence_id: uuid.UUID
author_id: uuid.UUID | None
author_name: str | None = None
body: str
is_system: bool
created_at: datetime
class AbsenceCommentCreate(BaseModel):
body: str = Field(min_length=1, max_length=2000)
class AbsenceListResponse(BaseModel):
total: int
items: list[AbsenceOut]