Open tompetersjr opened 2 years ago
Based on https://github.com/azurestandard/driverapp/issues/36 this may be a bit more involved. We can discuss at the next software call.
The purchase endpoint needs to return the weight and temp for the driver application. Getting the temperature data is an expensive operation so it should only be included in the json response if needed as an inline "temperature" value. The weight can be included with the main object. The temp is a combination of dry_chill, frozen and greenhouse so I think an object like this
temperature { dry_chill: true, frozen: false, greenhouse: true }
or and array with the different temps listed out like
temperature ["dry_chill", "greenhouse"]
would work.
@igregson What would your preference be?
@tompetersjr I think the question here is regarding my preference for the returned data, but it's not 100% clear to me (namely since your example gives boolean values for the temperature keys). Can you clarify it that's what your'e indeed asking?
In a call with Tom we discussed the idea of the response including the counts for each temperature type, e.g.
counts_by_temperature: {
dry_chill: 7,
frozen: 3,
greenhouse: 0
}
In the case of a temperature type having 0
items, I'm thinking it'd be best to still explicitly return it, as a count being 0
seems fundamentally different than an item being undefined
or null
.
The purchase endpoint needs to return the weight and temp for the driver application. Getting the temperature data is an expensive operation so it should only be included in the json response if needed as an inline "temperature" value. The weight can be included with the main object. The temp is a combination of dry_chill, frozen and greenhouse so I think an object like this
or and array with the different temps listed out like
would work.
@igregson What would your preference be?