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

13 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 CustomerCustomerMeterSortProperty(StrEnum): 

10 created_at = "created_at" 

11 modified_at = "modified_at" 

12 meter_id = "meter_id" 

13 meter_name = "meter_name" 

14 consumed_units = "consumed_units" 

15 credited_units = "credited_units" 

16 balance = "balance" 

17 

18 

19ListSorting = Annotated[ 

20 list[Sorting[CustomerCustomerMeterSortProperty]], 

21 Depends(SortingGetter(CustomerCustomerMeterSortProperty, ["-modified_at"])), 

22]