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

16 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 17:15 +0000

1from enum import StrEnum 1a

2 

3from pydantic import UUID4, Field 1a

4 

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

6 

7 

8class NotificationRecipientPlatform(StrEnum): 1a

9 ios = "ios" 1a

10 android = "android" 1a

11 

12 

13class NotificationRecipientCreate(Schema): 1a

14 platform: NotificationRecipientPlatform = Field( 1a

15 description="Platform of the notification recipient." 

16 ) 

17 expo_push_token: str = Field( 1a

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

19 ) 

20 

21 

22class NotificationRecipientDelete(Schema): 1a

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

24 

25 

26class NotificationRecipientSchema(IDSchema, TimestampedSchema): 1a

27 id: UUID4 1a

28 user_id: UUID4 = Field( 1a

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

30 ) 

31 platform: NotificationRecipientPlatform = Field( 1a

32 description="Platform of the notification recipient." 

33 ) 

34 expo_push_token: str = Field( 1a

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

36 )