feat: agent-12 – Zwei-Stufen-Genehmigung für Abwesenheiten
Optionale zweistufige Freigabe (Feature-Parität mit Urlaubsverwaltung,
Second-Stage-Authority), ohne SSO:
- Firmen-Opt-in companies.two_stage_approval_enabled + two_stage_min_days
(nur Anträge ab X Arbeitstagen brauchen Stufe 2; 0 = alle).
- Ablauf PENDING → FIRST_APPROVED → APPROVED: erste Stufe durch Manager-Rollen,
finale Stufe nur HR/Admin und zwingend eine ANDERE Person als Stufe 1.
- Urlaubs-/FZA-Abzug, CalDAV-Sync und Vertreter-Mail erst bei finaler Genehmigung.
Ablehnen in beiden Stufen möglich; Eigentümer darf FIRST_APPROVED noch stornieren.
- pending_days, Kalender und Reminder-Digest berücksichtigen FIRST_APPROVED.
- Neuer Status-Wert + absences.first_approved_by; System-Kommentar bei Stufe 1.
Frontend: CompanySettingsPage (Toggle + Schwellwert), AbsencesPage
("Endgültig genehmigen"/Ablehnen für HR/Admin ≠ Erstgenehmiger, Status-Badge).
Migration 0038. 190/190 Tests grün. Deployed 137 + 164.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,7 @@ class AbsenceOut(BaseModel):
|
||||
fza_hours: Decimal | None = None
|
||||
status: AbsenceStatus
|
||||
approved_by: uuid.UUID | None
|
||||
first_approved_by: uuid.UUID | None = None
|
||||
substitute_id: uuid.UUID | None
|
||||
note: str | None
|
||||
correction_note: str | None
|
||||
|
||||
@@ -50,6 +50,8 @@ class CompanyOut(BaseModel):
|
||||
vacation_default_days: int = 30
|
||||
vacation_prorate_first_year: bool = True
|
||||
vacation_from_schedule: bool = False
|
||||
two_stage_approval_enabled: bool = False
|
||||
two_stage_min_days: int = 0
|
||||
|
||||
|
||||
class PublicStampTokenStatus(BaseModel):
|
||||
@@ -88,6 +90,8 @@ class CompanyUpdate(BaseModel):
|
||||
vacation_default_days: int | None = Field(None, ge=0, le=365)
|
||||
vacation_prorate_first_year: bool | None = None
|
||||
vacation_from_schedule: bool | None = None
|
||||
two_stage_approval_enabled: bool | None = None
|
||||
two_stage_min_days: int | None = Field(None, ge=0, le=365)
|
||||
|
||||
|
||||
class DepartmentOut(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user