summaryrefslogtreecommitdiff
path: root/app/schemas.py
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-08 14:29:21 -0500
committerChristian Cleberg <[email protected]>2026-04-08 14:29:21 -0500
commita7c25076d16bde9ec928b9ef01bce952406ea7b1 (patch)
tree802c5f84902f240c6aab95acc1e6348dfbd806c2 /app/schemas.py
downloadhutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.tar.gz
hutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.tar.bz2
hutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.zip
initial commit
Diffstat (limited to 'app/schemas.py')
-rw-r--r--app/schemas.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/schemas.py b/app/schemas.py
new file mode 100644
index 0000000..e40b0d3
--- /dev/null
+++ b/app/schemas.py
@@ -0,0 +1,31 @@
+from pydantic import BaseModel, Field
+
+
+class DeviceRegisterIn(BaseModel):
+ user_id: str
+ apns_token: str = Field(min_length=16)
+ apns_env: str
+ bundle_id: str
+ platform: str = "ios"
+ app_version: str | None = None
+ device_name: str | None = None
+
+
+class DeviceOut(BaseModel):
+ id: int
+ user_id: str
+ bundle_id: str
+ apns_env: str
+ is_enabled: bool
+
+
+class SubscriptionIn(BaseModel):
+ source_type: str
+ source_id: str
+ event_type: str
+ is_enabled: bool = True
+
+
+class SubscriptionUpsertIn(BaseModel):
+ device_id: int
+ subscriptions: list[SubscriptionIn]