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

15 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 16:17 +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 OrderSortProperty(StrEnum): 1a

10 created_at = "created_at" 1a

11 status = "status" 1a

12 invoice_number = "invoice_number" 1a

13 amount = "amount" 1a

14 net_amount = "net_amount" 1a

15 customer = "customer" 1a

16 product = "product" 1a

17 discount = "discount" 1a

18 subscription = "subscription" 1a

19 

20 

21ListSorting = Annotated[ 1a

22 list[Sorting[OrderSortProperty]], 

23 Depends(SortingGetter(OrderSortProperty, ["-created_at"])), 

24]