feat(14-01): add site_id device filter, wireless data endpoints, and frontend API clients
- Add site_id and sector_id query parameters to devices list endpoint - Add get_device_registrations and get_device_rf_stats to link_service - Add RegistrationResponse, RFStatsResponse schemas to link.py - Add /registrations and /rf-stats endpoints to links router - Add sectorsApi frontend client (list, create, update, delete, assignDevice) - Add wirelessApi frontend client (links, registrations, RF stats, unknown clients) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,8 @@ async def get_devices(
|
||||
group_id: Optional[uuid.UUID] = None,
|
||||
sort_by: str = "created_at",
|
||||
sort_order: str = "desc",
|
||||
site_id: Optional[uuid.UUID] = None,
|
||||
sector_id: Optional[uuid.UUID] = None,
|
||||
) -> tuple[list[DeviceResponse], int]:
|
||||
"""
|
||||
Return a paginated list of devices with optional filtering and sorting.
|
||||
@@ -235,6 +237,12 @@ async def get_devices(
|
||||
)
|
||||
)
|
||||
|
||||
if site_id:
|
||||
base_q = base_q.where(Device.site_id == site_id)
|
||||
|
||||
if sector_id:
|
||||
base_q = base_q.where(Device.sector_id == sector_id)
|
||||
|
||||
# Count total before pagination
|
||||
count_q = select(func.count()).select_from(base_q.subquery())
|
||||
total_result = await db.execute(count_q)
|
||||
|
||||
Reference in New Issue
Block a user