Coverage for polar/notification_recipient/schemas.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 12:42 +0000

1from enum import StrEnum 

2 

3from pydantic import UUID4, Field 

4 

5from polar.kit.schemas import IDSchema, Schema, TimestampedSchema 

6 

7 

8class NotificationRecipientPlatform(StrEnum): 

9 ios = "ios" 

10 android = "android" 

11 

12 

13class NotificationRecipientCreate(Schema): 

14 platform: NotificationRecipientPlatform = Field( 

15 description="Platform of the notification recipient." 

16 ) 

17 expo_push_token: str = Field( 

18 description="Expo push token for the notification recipient." 

19 ) 

20 

21 

22class NotificationRecipientDelete(Schema): 

23 id: UUID4 = Field(description="ID of the notification recipient to delete.") 

24 

25 

26class NotificationRecipientSchema(IDSchema, TimestampedSchema): 

27 id: UUID4 

28 user_id: UUID4 = Field( 

29 description="ID of the user the notification recipient belongs to." 

30 ) 

31 platform: NotificationRecipientPlatform = Field( 

32 description="Platform of the notification recipient." 

33 ) 

34 expo_push_token: str = Field( 

35 description="Expo push token for the notification recipient." 

36 )