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

11 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 OrganizationSortProperty(StrEnum): 1a

10 created_at = "created_at" 1a

11 slug = "slug" 1a

12 organization_name = ( 1a

13 "name" # `name` is a reserved word, so we use `organization_name` 

14 ) 

15 next_review_threshold = "next_review_threshold" 1a

16 days_in_status = "days_in_status" 1a

17 

18 

19ListSorting = Annotated[ 1a

20 list[Sorting[OrganizationSortProperty]], 

21 Depends(SortingGetter(OrganizationSortProperty, ["created_at"])), 

22]