mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
1925 lines
41 KiB
JSON
1925 lines
41 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "grocy REST API",
|
|
"description": "Authentication is done via API keys (header *GROCY-API-KEY*), which you can manage [here](PlaceHolderManageApiKeysUrl).<br>Additionally requests from within the frontend are also valid (via session cookie).",
|
|
"version": "xxx",
|
|
"contact": {
|
|
"email": "bernd@berrnd.de"
|
|
},
|
|
"license": {
|
|
"name": "grocy.info",
|
|
"url": "https://grocy.info"
|
|
}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "xxx"
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"name": "Generic entity interactions",
|
|
"description": "A limited set of entities are directly exposed for convenience"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/get-objects/{entity}": {
|
|
"get": {
|
|
"description": "Returns all objects of the given entity",
|
|
"tags": [
|
|
"Generic entity interactions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "entity",
|
|
"required": true,
|
|
"description": "A valid entity name",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/ExposedEntity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An entity object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Product"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Habit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Battery"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Location"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ShoppingListItem"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/StockEntry"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/get-object/{entity}/{objectId}": {
|
|
"get": {
|
|
"description": "Returns a single object of the given entity",
|
|
"tags": [
|
|
"Generic entity interactions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "entity",
|
|
"required": true,
|
|
"description": "A valid entity name",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/ExposedEntity"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "objectId",
|
|
"required": true,
|
|
"description": "A valid object id of the given entity",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An entity object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema":{
|
|
"type": "object",
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Product"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Habit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Battery"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Location"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ShoppingListItem"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/StockEntry"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/add-object/{entity}": {
|
|
"post": {
|
|
"description": "Adds a single object of the given entity",
|
|
"tags": [
|
|
"Generic entity interactions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "entity",
|
|
"required": true,
|
|
"description": "A valid entity name",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/ExposedEntity"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "A valid entity object of entity specified in parameter *entity*",
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Product"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Habit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Battery"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Location"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ShoppingListItem"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/StockEntry"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/edit-object/{entity}/{objectId}": {
|
|
"post": {
|
|
"description": "Edits the given object of the given entity",
|
|
"tags": [
|
|
"Generic entity interactions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "entity",
|
|
"required": true,
|
|
"description": "A valid entity name",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/ExposedEntity"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "objectId",
|
|
"required": true,
|
|
"description": "A valid object id of the given entity",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "A valid entity object of entity specified in parameter *entity*",
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Product"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Habit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Battery"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/Location"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ShoppingListItem"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/StockEntry"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/delete-object/{entity}/{objectId}": {
|
|
"get": {
|
|
"description": "Deletes a single object of the given entity",
|
|
"tags": [
|
|
"Generic entity interactions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "entity",
|
|
"required": true,
|
|
"description": "A valid entity name",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/ExposedEntity"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "objectId",
|
|
"required": true,
|
|
"description": "A valid object id of the given entity",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/get": {
|
|
"get": {
|
|
"description": "Returns all users",
|
|
"tags": [
|
|
"User management"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A list of user objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/UserDto"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/create": {
|
|
"post": {
|
|
"description": "Creates a new user",
|
|
"tags": [
|
|
"User management"
|
|
],
|
|
"requestBody": {
|
|
"description": "A valid user object",
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/edit/{userId}": {
|
|
"post": {
|
|
"description": "Edits the given user",
|
|
"tags": [
|
|
"User management"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "userId",
|
|
"required": true,
|
|
"description": "A valid user id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "A valid user object",
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/delete/{userId}": {
|
|
"get": {
|
|
"description": "Deletes the given user",
|
|
"tags": [
|
|
"User management"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "userId",
|
|
"required": true,
|
|
"description": "A valid user id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/add-product/{productId}/{amount}": {
|
|
"get": {
|
|
"description": "Adds the the given amount of the given product to stock",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "productId",
|
|
"required": true,
|
|
"description": "A valid product id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "amount",
|
|
"required": true,
|
|
"description": "The amount to add",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "bestbeforedate",
|
|
"required": false,
|
|
"description": "The best before date of the product to add, when omitted, the current date is used",
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "date"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "price",
|
|
"required": false,
|
|
"description": "The price per purchase quantity unit in configured currency",
|
|
"schema": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "transactiontype",
|
|
"required": false,
|
|
"description": "The transaction type for this transaction, when omitted, *purchase* is used",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/StockTransactionType"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing product, invalid transaction type)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/consume-product/{productId}/{amount}": {
|
|
"get": {
|
|
"description": "Removes the the given amount of the given product from stock",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "productId",
|
|
"required": true,
|
|
"description": "A valid product id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "amount",
|
|
"required": false,
|
|
"description": "The amount to remove",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "spoiled",
|
|
"required": true,
|
|
"description": "True when the given product was spoiled, defaults to false",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "transactiontype",
|
|
"required": false,
|
|
"description": "The transaction type for this transaction, when omitted, *consume* is used",
|
|
"schema": {
|
|
"$ref": "#/components/internalSchemas/StockTransactionType"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing product, invalid transaction type)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/inventory-product/{productId}/{newAmount}": {
|
|
"get": {
|
|
"description": "Inventories the the given product (adds/removes based on the given new current amount)",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "productId",
|
|
"required": true,
|
|
"description": "A valid product id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "path",
|
|
"name": "newAmount",
|
|
"required": true,
|
|
"description": "The new current amount for the given product",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "bestbeforedate",
|
|
"required": false,
|
|
"description": "The best before date which applies to added products",
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "date"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing product)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/get-product-details/{productId}": {
|
|
"get": {
|
|
"description": "Returns details of the given product",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "productId",
|
|
"required": true,
|
|
"description": "A valid product id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A ProductDetailsResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema":{
|
|
"$ref": "#/components/schemas/ProductDetailsResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing product)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/get-product-price-history/{productId}": {
|
|
"get": {
|
|
"description": "Returns the price history of the given product",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "productId",
|
|
"required": true,
|
|
"description": "A valid product id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An array of ProductPriceHistory objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ProductPriceHistory"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing product)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/get-current-stock": {
|
|
"get": {
|
|
"description": "Returns all products which are currently in stock incl. the next expiring date per product",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An array of CurrentStockResponse objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CurrentStockResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/get-current-volatil-stock": {
|
|
"get": {
|
|
"description": "Returns all products which are expiring soon, are already expired or currently missing",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "expiring_days",
|
|
"required": false,
|
|
"description": "The number of days in which products are considered expiring soon",
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 5
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A CurrentVolatilStockResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CurrentVolatilStockResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/add-missing-products-to-shoppinglist": {
|
|
"get": {
|
|
"description": "Adds currently missing products (below defined min. stock amount) to the shopping list",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/clear-shopping-list": {
|
|
"get": {
|
|
"description": "Removes all items from the shopping list",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/stock/external-barcode-lookup/{barcode}": {
|
|
"get": {
|
|
"description": "Executes an external barcode lookoup via the configured plugin with the given barcode",
|
|
"tags": [
|
|
"Stock"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "barcode",
|
|
"required": true,
|
|
"description": "The barcode to lookup up",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "add",
|
|
"required": false,
|
|
"description": "When true, the product is added to the database on a successful lookup and the new product id is in included in output",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An ExternalBarcodeLookupResponse object or null, when nothing was found for the given barcode",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ExternalBarcodeLookupResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Plugin error)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/recipes/add-not-fulfilled-products-to-shopping-list/{recipeId}": {
|
|
"get": {
|
|
"description": "Adds all missing products for the given recipe to the shopping list",
|
|
"tags": [
|
|
"Recipes"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "recipeId",
|
|
"required": true,
|
|
"description": "A valid recipe id",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/recipes/consume-recipe/{recipeId}": {
|
|
"get": {
|
|
"description": "Consumes all products of the given recipe",
|
|
"tags": [
|
|
"Recipes"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "recipeId",
|
|
"required": true,
|
|
"description": "A valid recipe id",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/habits/track-habit-execution/{habitId}": {
|
|
"get": {
|
|
"description": "Tracks an execution of the given habit",
|
|
"tags": [
|
|
"Habits"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "habitId",
|
|
"required": true,
|
|
"description": "A valid habit id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "tracked_time",
|
|
"required": false,
|
|
"description": "The time of when the habit was executed, when omitted, the current time is used",
|
|
"schema": {
|
|
"type": "date-time"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "done_by",
|
|
"required": false,
|
|
"description": "A valid user id of who executed this habit, when omitted, the currently authenticated user will be used",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing habit)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/habits/get-habit-details/{habitId}": {
|
|
"get": {
|
|
"description": "Returns details of the given habit",
|
|
"tags": [
|
|
"Habits"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "habitId",
|
|
"required": true,
|
|
"description": "A valid habit id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A HabitDetailsResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HabitDetailsResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing habit)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/habits/get-current": {
|
|
"get": {
|
|
"description": "Returns all habits incl. the next estimated execution time per habit",
|
|
"tags": [
|
|
"Habits"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An array of CurrentHabitResponse objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CurrentHabitResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/batteries/track-charge-cycle/{batteryId}": {
|
|
"get": {
|
|
"description": "Tracks a charge cycle of the given battery",
|
|
"tags": [
|
|
"Batteries"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "batteryId",
|
|
"required": true,
|
|
"description": "A valid battery id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "tracked_time",
|
|
"required": false,
|
|
"description": "The time of when the battery was charged, when omitted, the current time is used",
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A VoidApiActionResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/VoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing battery)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/batteries/get-battery-details/{batteryId}": {
|
|
"get": {
|
|
"description": "Returns details of the given battery",
|
|
"tags": [
|
|
"Batteries"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "batteryId",
|
|
"required": true,
|
|
"description": "A valid battery id",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A BatteryDetailsResponse object",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BatteryDetailsResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "A VoidApiActionResponse object (possible errors are: Not existing battery)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorExampleVoidApiActionResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/batteries/get-current": {
|
|
"get": {
|
|
"description": "Returns all batteries incl. the next estimated charge time per battery",
|
|
"tags": [
|
|
"Batteries"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An array of CurrentBatteryResponse objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CurrentBatteryResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"internalSchemas": {
|
|
"ExposedEntity": {
|
|
"type": "string",
|
|
"enum": [
|
|
"products",
|
|
"habits",
|
|
"batteries",
|
|
"locations",
|
|
"quantity_units",
|
|
"shopping_list",
|
|
"recipes",
|
|
"recipes_pos"
|
|
]
|
|
},
|
|
"StockTransactionType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"purchase",
|
|
"consume",
|
|
"inventory-correction"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {
|
|
"Product": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"location_id": {
|
|
"type": "integer"
|
|
},
|
|
"qu_id_purchase": {
|
|
"type": "integer"
|
|
},
|
|
"qu_id_stock": {
|
|
"type": "integer"
|
|
},
|
|
"qu_factor_purchase_to_stock": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"barcode": {
|
|
"type": "string",
|
|
"description": "Can contain multiple barcodes separated by comma"
|
|
},
|
|
"min_stock_amount": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0
|
|
},
|
|
"default_best_before_days": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"QuantityUnit": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"name_plural": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"Location": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"StockEntry": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"product_id": {
|
|
"type": "integer"
|
|
},
|
|
"amount": {
|
|
"type": "integer"
|
|
},
|
|
"best_before_date": {
|
|
"type": "string",
|
|
"format": "date"
|
|
},
|
|
"purchased_date": {
|
|
"type": "string",
|
|
"format": "date"
|
|
},
|
|
"stock_id": {
|
|
"type": "string",
|
|
"description": "A unique id which references this stock entry during its lifetime"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ProductDetailsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"product": {
|
|
"$ref": "#/components/schemas/Product"
|
|
},
|
|
"quantity_unit_purchase": {
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
"quantity_unit_stock": {
|
|
"$ref": "#/components/schemas/QuantityUnit"
|
|
},
|
|
"last_purchased": {
|
|
"type": "string",
|
|
"format": "date"
|
|
},
|
|
"last_used": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"stock_amount": {
|
|
"type": "integer"
|
|
},
|
|
"next_best_before_date": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_price": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
}
|
|
},
|
|
"ProductPriceHistory": {
|
|
"type": "object",
|
|
"properties": {
|
|
"date": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"price": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
}
|
|
},
|
|
"ExternalBarcodeLookupResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"location_id": {
|
|
"type": "integer"
|
|
},
|
|
"qu_id_purchase": {
|
|
"type": "integer"
|
|
},
|
|
"qu_id_stock": {
|
|
"type": "integer"
|
|
},
|
|
"qu_factor_purchase_to_stock": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"barcode": {
|
|
"type": "string",
|
|
"description": "Can contain multiple barcodes separated by comma"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"description": "The id of the added product, only included when the producted was added to the database"
|
|
}
|
|
}
|
|
},
|
|
"HabitDetailsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"habit": {
|
|
"$ref": "#/components/schemas/Habit"
|
|
},
|
|
"last_tracked": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When this habit was last tracked"
|
|
},
|
|
"track_count": {
|
|
"type": "integer",
|
|
"description": "How often this habit was tracked so far"
|
|
},
|
|
"last_done_by": {
|
|
"$ref": "#/components/schemas/UserDto"
|
|
},
|
|
"next_estimated_execution_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"BatteryDetailsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"habit": {
|
|
"$ref": "#/components/schemas/Battery"
|
|
},
|
|
"last_charged": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When this battery was last charged"
|
|
},
|
|
"charge_cycles_count": {
|
|
"type": "integer",
|
|
"description": "How often this battery was charged so far"
|
|
},
|
|
"next_estimated_charge_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"Session": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"session_key": {
|
|
"type": "string"
|
|
},
|
|
"expires": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_used": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"UserDto": {
|
|
"type": "object",
|
|
"description": "A user object without the *password* and with an additional *display_name* property",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"display_name": {
|
|
"type": "string"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ApiKey": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"api_key": {
|
|
"type": "string"
|
|
},
|
|
"expires": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_used": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ShoppingListItem": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"product_id": {
|
|
"type": "integer"
|
|
},
|
|
"note": {
|
|
"type": "string"
|
|
},
|
|
"amount": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0,
|
|
"description": "The manual entered amount"
|
|
},
|
|
"amount_autoadded": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0,
|
|
"description": "The automatically added amount based on defined minimum stock amounts"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"Battery": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"used_in": {
|
|
"type": "string"
|
|
},
|
|
"charge_interval_days": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"BatteryChargeCycle": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"battery_id": {
|
|
"type": "integer"
|
|
},
|
|
"tracked_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"Habit": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"period_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"manually",
|
|
"dynamic-regular"
|
|
]
|
|
},
|
|
"period_days": {
|
|
"type": "integer"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"HabitLogEntry": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"habit_id": {
|
|
"type": "integer"
|
|
},
|
|
"tracked_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"StockLogEntry": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"product_id": {
|
|
"type": "integer"
|
|
},
|
|
"amount": {
|
|
"type": "integer"
|
|
},
|
|
"best_before_date": {
|
|
"type": "string",
|
|
"format": "date"
|
|
},
|
|
"purchased_date": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"used_date": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"spoiled": {
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"stock_id": {
|
|
"type": "string"
|
|
},
|
|
"transaction_type": {
|
|
"$ref": "#/components/internalSchemas/StockTransactionType"
|
|
},
|
|
"row_created_timestamp": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ErrorExampleVoidApiActionResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"error_message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"example": {
|
|
"success": false,
|
|
"error_message": "The error message..."
|
|
}
|
|
},
|
|
"VoidApiActionResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"success": {
|
|
"type": "boolean"
|
|
},
|
|
"error_message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"example": {
|
|
"success": true,
|
|
"error_message": ""
|
|
}
|
|
},
|
|
"CurrentStockResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"product_id": {
|
|
"type": "integer"
|
|
},
|
|
"amount": {
|
|
"type": "integer"
|
|
},
|
|
"best_before_date": {
|
|
"type": "string",
|
|
"format": "date",
|
|
"description": "The next best before date for this product"
|
|
}
|
|
}
|
|
},
|
|
"CurrentHabitResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"habit_id": {
|
|
"type": "integer"
|
|
},
|
|
"last_tracked_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"next_estimated_execution_time": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "The next estimated execution time of this habit, 2999-12-31 23:59:59 when the given habit has a period_type of manually"
|
|
}
|
|
}
|
|
},
|
|
"CurrentBatteryResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"battery_id": {
|
|
"type": "integer"
|
|
},
|
|
"last_tracked_time": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"next_estimated_charge_time": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "The next estimated charge time of this battery, 2999-12-31 23:59:59 when the given battery has no charge_interval_days defined"
|
|
}
|
|
}
|
|
},
|
|
"CurrentVolatilStockResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expiring_products": {
|
|
"type": "array",
|
|
"items":{
|
|
"$ref": "#/components/schemas/Product"
|
|
}
|
|
},
|
|
"expired_products": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Product"
|
|
}
|
|
},
|
|
"missing_products": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Product"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"examples": {
|
|
"ErrorVoidApiActionResponseExample": {
|
|
"value": {
|
|
"success": false,
|
|
"error_message": "The error message..."
|
|
}
|
|
}
|
|
},
|
|
"securitySchemes": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "GROCY-API-KEY"
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": [ ]
|
|
}
|
|
]
|
|
}
|