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

15 statements  

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

1from enum import StrEnum 

2from typing import Annotated 

3 

4from fastapi import Depends 

5 

6from polar.kit.sorting import Sorting, SortingGetter 

7 

8 

9class CustomerMeterSortProperty(StrEnum): 

10 created_at = "created_at" 

11 modified_at = "modified_at" 

12 customer_id = "customer_id" 

13 customer_name = "customer_name" 

14 meter_id = "meter_id" 

15 meter_name = "meter_name" 

16 consumed_units = "consumed_units" 

17 credited_units = "credited_units" 

18 balance = "balance" 

19 

20 

21ListSorting = Annotated[ 

22 list[Sorting[CustomerMeterSortProperty]], 

23 Depends(SortingGetter(CustomerMeterSortProperty, ["-modified_at"])), 

24]