feat: asset naming, location extraction, and location display
- New asset naming: {MID} - {Customer} / {Address} / {Building details}
- Extracted 660 building_names from customer data (Disney resorts, hotels)
- 1,704 assets now have location data (building_name, floor, etc.)
- Location section in detail view now shows building, floor, trailer, room
- Added has_gps filter to API for map loading
- Added location_source column to track GPS origin
This commit is contained in:
@@ -1039,6 +1039,7 @@ def list_assets(
|
||||
disney_filter: Optional[str] = Query(None),
|
||||
q: Optional[str] = Query(None),
|
||||
no_dex_days: Optional[int] = Query(None, ge=1),
|
||||
has_gps: Optional[bool] = Query(None),
|
||||
limit: int = Query(100, ge=1, le=2000),
|
||||
offset: int = Query(0, ge=0),
|
||||
):
|
||||
@@ -1081,6 +1082,11 @@ def list_assets(
|
||||
if no_dex_days is not None:
|
||||
conditions.append("(dex_report_date IS NULL OR REPLACE(dex_report_date, 'T', ' ') < datetime('now', '-' || ? || ' days'))")
|
||||
params.append(no_dex_days)
|
||||
if has_gps is not None:
|
||||
if has_gps:
|
||||
conditions.append("a.latitude IS NOT NULL AND a.longitude IS NOT NULL")
|
||||
else:
|
||||
conditions.append("(a.latitude IS NULL OR a.longitude IS NULL)")
|
||||
|
||||
where = " AND ".join(conditions)
|
||||
from_clause = "FROM assets a LEFT JOIN customers c ON a.customer_id = c.id"
|
||||
|
||||
Reference in New Issue
Block a user