from __future__ import annotations


class FinalizationPolicy:
    def __init__(self, *, call_end_grace_s: float) -> None:
        self.call_end_grace_s = call_end_grace_s

    def should_skip(self, *, finalized: bool) -> bool:
        return finalized

    def should_finalize_room_empty(self, *, remote_participants: int, finalized: bool) -> bool:
        return remote_participants == 0 and not finalized

    def is_done_stage(self, stage: str) -> bool:
        return (stage or "").upper() == "DONE"
