krz/hutch-notify

Notification server for Hutch.

clone: git clone https://gitbay.org/krz/hutch-notify.git

main: app/schemas.py · raw

 1from pydantic import BaseModel, Field
 2
 3
 4class DeviceRegisterIn(BaseModel):
 5    user_id: str
 6    apns_token: str = Field(min_length=16)
 7    apns_env: str
 8    bundle_id: str
 9    platform: str = "ios"
10    app_version: str | None = None
11    device_name: str | None = None
12
13
14class DeviceOut(BaseModel):
15    id: int
16    user_id: str
17    bundle_id: str
18    apns_env: str
19    is_enabled: bool
20
21
22class SubscriptionIn(BaseModel):
23    source_type: str
24    source_id: str
25    event_type: str
26    is_enabled: bool = True
27
28
29class SubscriptionUpsertIn(BaseModel):
30    device_id: int
31    subscriptions: list[SubscriptionIn]