"""다른 서비스가 트리거하는 웹훅 — 현재 lotto-backend → 텔레그램 푸시."""
from typing import List
from fastapi import APIRouter
from pydantic import BaseModel
from ..notifiers.telegram_lotto import send_prize_alert

router = APIRouter(prefix="/api/agent-office/notify")


class LottoPrizeEvent(BaseModel):
    draw_no: int
    match_count: int
    numbers: List[int]
    purchase_id: int


@router.post("/lotto-prize")
async def lotto_prize(body: LottoPrizeEvent):
    await send_prize_alert(body.model_dump())
    return {"ok": True}
