feat(telegram): include a presigned PDF view link in the admin-review alert

When an MCS-150/USDOT order hits the pre-submission admin-verification gate, the
Telegram FULFILLMENT NEEDED alert now appends a presigned link to the prepared
PDF (via the public minio.performancewest.net endpoint, IP-allowlisted to admin)
so you can review the document straight from the alert before approving. Added
notify_fulfillment_todo(view_url=...) + a _presigned_view_url helper (public
endpoint + explicit region to avoid the region-probe that 403s from the worker).
This commit is contained in:
justin 2026-06-10 12:13:43 -05:00
parent 09d928a582
commit b28dda7c5a
2 changed files with 34 additions and 1 deletions

View file

@ -112,11 +112,14 @@ def notify_fulfillment_todo(
service_slug: str,
priority: str = "normal",
description: str = "",
view_url: str = "",
) -> bool:
"""Operator alert that a fulfillment task needs attention.
Called whenever an admin_todo is created so nothing waits unseen in the
queue. The description is trimmed to keep the message readable.
queue. The description is trimmed to keep the message readable. ``view_url``
(a presigned link to the prepared document) is appended when supplied so the
operator can review the PDF directly from the alert.
"""
icon = {"high": "🔴", "urgent": "🔴", "normal": "🟡", "low": ""}.get(
(priority or "normal").lower(), "🟡"
@ -133,4 +136,6 @@ def notify_fulfillment_todo(
)
if desc:
text += f"\n{desc}"
if view_url:
text += f"\n\n📄 Review the prepared document:\n{view_url}"
return send_telegram(text)