24 lines
547 B
Python
24 lines
547 B
Python
"""Delivery channel interface."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Protocol
|
|
|
|
from us2kr.models import BriefingResult
|
|
|
|
|
|
class DeliveryError(RuntimeError):
|
|
pass
|
|
|
|
|
|
class Deliverer(Protocol):
|
|
name: str
|
|
|
|
def deliver(self, result: BriefingResult) -> str:
|
|
"""Send the briefing. Return a short receipt string (message id / path). Raise DeliveryError."""
|
|
...
|
|
|
|
def notify_error(self, subject: str, detail: str) -> None:
|
|
"""Operator alert for pipeline failures. Must never raise."""
|
|
...
|