backend: add push token API and FCM delivery pipeline

This commit is contained in:
Codex
2026-03-09 23:12:19 +03:00
parent e82178fcc3
commit 74b086b9c8
11 changed files with 296 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Any
from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, Field
class NotificationRequest(BaseModel):
@@ -25,3 +25,15 @@ class PushTaskPayload(BaseModel):
title: str
body: str
data: dict[str, Any]
class PushTokenUpsertRequest(BaseModel):
platform: str = Field(min_length=2, max_length=16)
token: str = Field(min_length=8, max_length=512)
device_id: str | None = Field(default=None, max_length=128)
app_version: str | None = Field(default=None, max_length=64)
class PushTokenDeleteRequest(BaseModel):
platform: str = Field(min_length=2, max_length=16)
token: str = Field(min_length=8, max_length=512)