ligbox-ops-platform/projects/ops-desk/api/app/push_service.py
Ligbox Spec Hub 821675ab4a Reorganize monorepo into projects/wizard, ops-desk, finance
Specs stay at repo root (cross-VM). Move deploy and code into logical
projects with README per domain, updated manifest.yaml, and symlinks at
legacy paths for VM122 backward compatibility.
2026-06-19 18:55:03 +00:00

27 lines
832 B
Python

"""Ops push notifications — Spec 007 phase A (onboarding events)."""
from __future__ import annotations
import os
from app import ntfy_notify
OPS_NTFY_TOPIC = os.getenv("DESK_OPS_NTFY_TOPIC", "").strip()
PUSH_ONBOARD_EVENTS = frozenset({
"session.started",
"onboarding.started",
"onboarding.failed",
"integration.gap",
})
def notify_ops_event(event: str, *, domain: str | None = None, detail: str = "") -> bool:
if event not in PUSH_ONBOARD_EVENTS:
return False
if not OPS_NTFY_TOPIC:
return False
dom = domain or "sem domínio"
title = f"Ligbox Ops — {event}"
body = detail or dom
priority = "high" if event in ("onboarding.started", "onboarding.failed", "integration.gap") else "default"
return ntfy_notify.push(OPS_NTFY_TOPIC, title, body, priority=priority)