"""Appointment lifecycle policies — Phase 13.1."""
from __future__ import annotations

from app.models.types import AppointmentLifecycleAction, AppointmentStatus
from app.validators.appointments import ensure_appointment_lifecycle_transition, target_status_for


class AppointmentLifecyclePolicy:
    def ensure_transition(
        self, *, action: AppointmentLifecycleAction, current: AppointmentStatus
    ) -> AppointmentStatus:
        ensure_appointment_lifecycle_transition(action=action, current=current)
        return target_status_for(action)
