azurestandard / api-spec

OpenAPI 3.0 Specification for Azure Standard’s API.
https://azure-api-docs.netlify.app/
1 stars 1 forks source link

Include weight and temp values for purchases #334

Open tompetersjr opened 2 years ago

tompetersjr commented 2 years ago

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 commented 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.

igregson commented 2 years ago

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?

igregson commented 2 years ago

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.