Coverage for polar/subscription/sorting.py: 100%

13 statements  

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

1from enum import StrEnum 1a

2from typing import Annotated 1a

3 

4from fastapi import Depends 1a

5 

6from polar.kit.sorting import Sorting, SortingGetter 1a

7 

8 

9class SubscriptionSortProperty(StrEnum): 1a

10 customer = "customer" 1a

11 status = "status" 1a

12 started_at = "started_at" 1a

13 current_period_end = "current_period_end" 1a

14 amount = "amount" 1a

15 product = "product" 1a

16 discount = "discount" 1a

17 

18 

19ListSorting = Annotated[ 1a

20 list[Sorting[SubscriptionSortProperty]], 

21 Depends(SortingGetter(SubscriptionSortProperty, ["-started_at"])), 

22]