"""Prescription lifecycle policies — Phase 13.6."""
from __future__ import annotations

from app.models.types import PrescriptionLifecycleAction, PrescriptionOrderStatus
from app.validators.pharmacy import ensure_prescription_transition, target_prescription_status


class PrescriptionLifecyclePolicy:
    def ensure_transition(
        self, *, action: PrescriptionLifecycleAction, current: PrescriptionOrderStatus
    ) -> PrescriptionOrderStatus:
        ensure_prescription_transition(action=action, current=current)
        return target_prescription_status(action)
