fablabbcn / smartcitizen-api

The Smart Citizen Engine
https://developer.smartcitizen.me
GNU Affero General Public License v3.0
10 stars 4 forks source link

World map and fresh world map to reuse devices structure #304

Closed oscgonfer closed 4 months ago

oscgonfer commented 4 months ago

Reuse similar serialization on devices/<device-id> and world_map / fresh_world_map as devices to avoid custom processing of each endpoint.

In particular:

[
  {
    "id": 16758,
    "name": "UCLA Institute of the Environment and Sustainability",
    "description": "Smart Citizen Kit 2.1 with Urban Sensor Board",
    "location": { # ADD
      "city": "London",
      "country": "United Kingdom of Great Britain and Northern Ireland",
      "country_code": "GB",
      "elevation": null,
      "exposure": "indoor",
      "geohash": "gcpv5kxxz7",
      "ip": null,
      "latitude": 51.529977,
      "longitude": -0.1981195
    },
    "owner" { # ADD
      "id": 1212,
      "username": "xxxx"
    },
    "owner_id": 7588, # REMOVE
    "owner_username": "scottgruber", # REMOVE
    "latitude": 34.0675257164346, # REMOVE
    "longitude": -118.442628975852, # REMOVE
    "city": "Los Angeles", # REMOVE
    "hardware": {
      "name": "SCK 2.1",
      "type": "SCK",
      "description": "Smart Citizen Kit 2.1 with Urban Sensor Board",
      "version": "2.1",
      "slug": "sck:2,1",
      "info": "[FILTERED]"
    },
    "country_code": "US", # REMOVE
    "state": "has_published",
    "system_tags": [
      "online",
      "outdoor"
    ],
    "user_tags": [
      "Experimental",
      "Inside",
      "Third Floor"
    ],
    "updated_at": "2024-02-23T03:18:35Z",
    "last_reading_at": "2024-02-26T10:36:14Z"
  },
... 
]
oscgonfer commented 4 months ago

Tracked in https://github.com/fablabbcn/smartcitizen-api/pull/246

oscgonfer commented 4 months ago

We can close this one, right @timcowlishaw ?