enviroCar/enviroCar-server — pull request #176 by autermann (2014-02-08 15:55:58+00:00)
Title: Fueling Stop Resource

I've changed the schema at some points to keep it consistent across resources (compare to #175):
* lowercase keys
* no user for creation
* value/unit objects
* embedded users/sensors in response
* ISO8601 datetimes
* numbers are numbers

##### Creation

```json
{
"fuelType": "diesel",
"car": "52f646df44aee65b2833134d",
"cost": {
"value": 123,
"unit": "Euro"
},
"mileage": {
"value": 123,
"unit": "km"
},
"volume": {
"value": 123,
"unit": "l"
},
"time": "2014-02-08T14:55:14Z",
"missedFuelStop": false
}
```

##### GET /user/:name/fuelings
```json
{
"fuelings": [
{
"car": {
"properties": {
"constructionYear": 2012,
"fuelType": "gasoline",
"id": "52f646df44aee65b2833134d",
"manufacturer": "BMW",
"model": "R 1200 GS ADV"
},
"type": "car"
},
"cost": {
"unit": "Euro",
"value": 123
},
"created": "2014-02-08T15:36:56Z",
"fuelType": "diesel",
"id": "52f64f1844aec2f61806ca66",
"mileage": {
"unit": "km",
"value": 123
},
"missedFuelStop": false,
"modified": "2014-02-08T15:36:56Z",
"time": "2014-02-08T14:55:14Z",
"user": {
"created": "2014-02-08T14:55:14Z",
"mail": "envirocar@autermann.org",
"modified": "2014-02-08T14:55:14Z",
"name": "auti"
},
"volume": {
"unit": "l",
"value": 123
}
}
]
}
```

##### GET /user/:name/fuelings/:id
```json
{
"car": {
"properties": {
"constructionYear": 2012,
"fuelType": "gasoline",
"id": "52f646df44aee65b2833134d",
"manufacturer": "BMW",
"model": "R 1200 GS ADV"
},
"type": "car"
},
"cost": {
"unit": "Euro",
"value": 123
},
"created": "2014-02-08T15:36:56Z",
"fuelType": "diesel",
"id": "52f64f1844aec2f61806ca66",
"mileage": {
"unit": "km",
"value": 123
},
"missedFuelStop": false,
"modified": "2014-02-08T15:36:56Z",
"time": "2014-02-08T14:55:14Z",
"user": {
"created": "2014-02-08T14:55:14Z",
"mail": "envirocar@autermann.org",
"modified": "2014-02-08T14:55:14Z",
"name": "auti"
},
"volume": {
"unit": "l",
"value": 123
}
}
```