Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add icarGroupFeedingEventResource #396

Merged
merged 10 commits into from
Oct 9, 2023
21 changes: 21 additions & 0 deletions collections/icarGroupFeedingEventCollection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"description": "Represents a collection of feed intakes. Based on icarResourceCollection to provide paging etc.",

"allOf": [{
"$ref": "../collections/icarResourceCollection.json"
},
{
"type": "object",

"properties": {
"member": {
"type": "array",
"items": {
"$ref": "../resources/icarGroupFeedingEventResource.json"
},
"description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case group feeding events."
}
}
}
]
}
48 changes: 48 additions & 0 deletions resources/icarGroupFeedingEventResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"description": "Event for recording group or mob feeding. Allowances represent averages so this cannot be used to populate individual animal events.",
"type": "object",
"allOf": [
{
"$ref": "../resources/icarGroupEventCoreResource.json"
}
],
"properties": {
"feedingEndDateTime": {

"$ref": "../types/icarDateTimeType.json",
"description": "The RFC3339 UTC moment from which animals could no longer consume the feed (eventDateTime represents the start of feed availability)."
},
"feedPerAnimal": {
"type": "array",
"items": {
"$ref": "../types/icarConsumedFeedType.json",
"description": "Gives the feed offered to and consumed per animal (average)."
}
},
"feedTotal": {
"description": "Gives the feed offered to and consumed (total for all animals).",
"type": "array",
"items": {
"$ref": "../types/icarConsumedFeedType.json"
}
},
"rationPerAnimal": {
"type": "array",
"items": {
"$ref": "../types/icarConsumedRationType.json",
"description": "Gives the ration offered to and consumed per animal (average)."
}
},
"rationTotal": {
"description": "Gives the feed offered to and consumed (total for all animals).",
"type": "array",
"items": {
"$ref": "../types/icarConsumedRationType.json"
}
},
"device": {
"$ref": "../types/icarDeviceReferenceType.json",
"description": "Optional information about a device used for the feeding, if relevant."
}
}
}
4 changes: 4 additions & 0 deletions types/icarConsumedFeedType.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"feedConsumption": {
"$ref": "../types/icarFeedQuantityType.json",
"description": "The amount of feed the animal has consumed"
},
"dryMatterPercentage": {
"type": "number",
"description": "The dry matter content of the feed provided or consumed, expressed as a percentage."
}
}
}
6 changes: 5 additions & 1 deletion types/icarConsumedRationType.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Gives the consumed amount of feed and the amount the animal was entitled to. Amounts are real weights.",
"description": "Gives the consumed amount of a mixed ration, and the amount the animal was entitled to. Amounts are real weights.",

"type": "object",
"required": [
Expand All @@ -18,6 +18,10 @@
"feedConsumption": {
"$ref": "../types/icarFeedQuantityType.json",
"description": "The amount of feed the animal has consumed"
},
"dryMatterPercentage": {
"type": "number",
"description": "The dry matter content of the ration provided or consumed, expressed as a percentage."
}
}
}
4 changes: 4 additions & 0 deletions types/icarInventoryClassificationType.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"items": {
"$ref": "../enums/icarProductionPurposeType.json"
}
},
"reference": {
"type": "string",
"description": "An external reference (identifier or name) to further identify the group of animals."
}
}
}
42 changes: 42 additions & 0 deletions url-schemes/exampleUrlScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,45 @@
}
}
},
"/locations/{location-scheme}/{location-id}/group-feeding": {
"get": {
"operationId": "get-group-feeding",
"summary": "Get the group feeding events for a certain location",
"description": "# Purpose\nProvides the group feeding events for a location.\n",
"tags": [
"ADE-1.3-feed"
],
"parameters": [{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the feed intakes for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupFeedingEventCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},

"/locations/{location-scheme}/{location-id}/feed-recommendations": {
"get": {
"operationId": "get-Feed-Recommendations",
Expand Down Expand Up @@ -2560,6 +2599,9 @@
"icarFeedIntakeEventCollection": {
"$ref": "../collections/icarFeedIntakeEventCollection.json"
},
"icarGroupFeedingEventCollection": {
"$ref": "../collections/icarGroupFeedingEventCollection.json"
},
"icarFeedReportCollection": {
"$ref": "../collections/icarFeedReportCollection.json"
},
Expand Down
194 changes: 193 additions & 1 deletion url-schemes/feedURLscheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,111 @@
}
}
},
"/locations/{location-scheme}/{location-id}/group-feeding": {
"get": {
"operationId": "get-group-feeding",
"summary": "Get the group feeding events for a certain location",
"description": "# Purpose\nProvides the group feeding events for a location\n",
"tags": [
"ADE-1.3-feed"
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the resources for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupFeedingEventCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
},
"post": {
"operationId": "post-single-group-feeding",
"summary": "Add a single new group feeding event.",
"description": "# Purpose\nAllows a client to add a single group feeding event.\n",
"tags": [
"ADE-1.3-feed"
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
}
],
"requestBody": {
"required": true,
"description": "The group feeding event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupFeedingEventResource"
}
}
}
},
"responses": {
"200": {
"description": "Successful. The response contains a copy of the event, as modifed by the server.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupFeedingEventResource"
}
}
}
},
"201": {
"description": "Created. The Location header contains the URI to the new resource.",
"headers": {
"Location": {
"schema": {
"type": "string",
"format": "uri"
},
"description": "Contains the URI to the new resource."
}
}
},
"202": {
"description": "Accepted. The Location header contains a URI that the client can query for processing status.",
"headers": {
"Location": {
"schema": {
"type": "string",
"format": "uri"
},
"description": "Contains a URI to query creation status."
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/batches/locations/{location-scheme}/{location-id}/feeds": {
"post": {
"operationId": "post-batch-feeds",
Expand Down Expand Up @@ -1163,6 +1268,81 @@
}
}
}
},
"/batches/locations/{location-scheme}/{location-id}/group-feedings": {
"post": {
"operationId": "post-batch-group-feedings",
"summary": "Add an array of group feeding events.",
"description": "# Purpose \nAllows a client to add a collection of group feeding events.\n",
"tags": [
"ADE-1.3-feed"
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
}
],
"requestBody": {
"required": true,
"description": "The collection of group feeding events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupFeedingEventArray"
}
}
}
},
"responses": {
"200": {
"description": "Successful. The response contains a set of batch results, which may include warnings.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/batchResults"
}
}
}
},
"201": {
"description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.",
"headers": {
"Location": {
"schema": {
"type": "string",
"format": "uri"
},
"description": "Contains the URI to the results."
}
}
},
"202": {
"description": "Accepted. The Location header contains a URI that the client can query for processing status.",
"headers": {
"Location": {
"schema": {
"type": "string",
"format": "uri"
},
"description": "Contains a URI to query creation status."
}
}
},
"default": {
"description": "The response contains a set of batch results, which may include errors and warnings.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/batchResults"
}
}
}
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -1247,7 +1427,19 @@
"items": {
"$ref": "#/components/schemas/icarFeedTransactionResource"
}
}
},
"icarGroupFeedingEventResource": {
"$ref": "../resources/icarGroupFeedingEventResource.json"
},
"icarGroupFeedingEventCollection": {
"$ref": "../collections/icarGroupFeedingEventCollection.json"
},
"icarGroupFeedingEventArray": {
"type": "array",
"items": {
"$ref": "#/components/schemas/icarGroupFeedingEventResource"
}
}
},
"parameters": {
"location-scheme": {
Expand Down