adewg / ICAR

Standard messages and specifications for animal data exchange in livestock.
https://icar.org/
Apache License 2.0
47 stars 26 forks source link

Improve device references in events #411

Closed cookeac closed 9 months ago

cookeac commented 1 year ago

Several events have a device property which is intended to identify the device that is the source of the event. However, device is an icarDeviceReferenceType, which derived from an icarResourceReferenceType is intended to provide the ID and optionally a URL to get details of the resource (in this case the device). It extends this type, adding model (a string) and serial (a serial number string).

There is also icarDeviceResource which defines a more useful set of device properties:

It would be good if this information were available with each event, rather than having to be fetched separately through a dereferenced call to get a device with that ID (particularly if the API to get devices was not implemented!).

A potential solution would be to add the properties of icarDeviceResource to the device property in events, perhaps through an allOf. The only required property is id which is required in a reference type anyway.

cookeac commented 10 months ago

During discussions at the technical meetings on 5 October 2023 and 19 October 2023, we decided that only the manufacturer needed to be added to the icarDeviceReferenceType. The other more detail fields can stay in icarDeviceResource and be retrieved when necessary (if that API is implemented).