Add owner work order approval page
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
VPN SaaS Dev
2026-05-16 10:51:05 +09:00
parent ac5845d5a0
commit 545f4d088d
12 changed files with 1066 additions and 48 deletions

View File

@@ -191,6 +191,8 @@ async def create_service_notification(
appointment_id: int | None = None,
send_telegram: bool = True,
idempotency_key: str | None = None,
web_app_url: str | None = None,
button_text: str = "Открыть",
) -> ServiceNotification:
if idempotency_key:
existing = (
@@ -214,7 +216,8 @@ async def create_service_notification(
user = await session.get(User, recipient_user_id)
if user is not None:
notification.status = "processing"
delivered = await notify_user(user, f"{title}\n{body}" if body else title)
message = f"{title}\n{body}" if body else title
delivered = await notify_user(user, message, web_app_url=web_app_url, button_text=button_text)
if delivered:
notification.status = "sent"
notification.sent_at = datetime.now(UTC)