feat(api): implement articlesupplier endpoints, sort reordering, and openapi docs
This commit is contained in:
@@ -6875,6 +6875,11 @@
|
||||
"nullable": true,
|
||||
"description": "Supplier stock"
|
||||
},
|
||||
"sort": {
|
||||
"type": "integer",
|
||||
"nullable": true,
|
||||
"description": "Display sort order (defaults to next sort)"
|
||||
},
|
||||
"netPrice": {
|
||||
"type": "number",
|
||||
"nullable": true,
|
||||
@@ -6896,6 +6901,7 @@
|
||||
"sku": "MET-44910",
|
||||
"pu": 1,
|
||||
"stock": 140,
|
||||
"sort": 0,
|
||||
"netPrice": 4.2,
|
||||
"taxId": 1
|
||||
}
|
||||
@@ -7026,6 +7032,10 @@
|
||||
"type": "number",
|
||||
"nullable": true
|
||||
},
|
||||
"sort": {
|
||||
"type": "integer",
|
||||
"description": "Display sort order"
|
||||
},
|
||||
"netPrice": {
|
||||
"type": "number",
|
||||
"nullable": true
|
||||
@@ -7189,6 +7199,124 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/article/{sku}/supplier/order": {
|
||||
"put": {
|
||||
"tags": [
|
||||
"Article"
|
||||
],
|
||||
"summary": "Reorder article suppliers",
|
||||
"description": "Sets the display sort order of supplier assignments for an article.\nExpects an array of all assigned `articlesupplier` IDs in the desired order.\n",
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"x-signals": [
|
||||
"article-<sku>"
|
||||
],
|
||||
"x-markdown": "article/supplier/order.md",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "sku",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Article SKU"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"ids"
|
||||
],
|
||||
"properties": {
|
||||
"ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
},
|
||||
"description": "Full list of articlesupplier ids in their new order"
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"ids": [
|
||||
12,
|
||||
10,
|
||||
15
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "New order applied",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid supplier order, ids is required, or no company selected",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Not authorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Article or company not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/article": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -9162,7 +9290,8 @@
|
||||
"id",
|
||||
"articleId",
|
||||
"entityId",
|
||||
"pu"
|
||||
"pu",
|
||||
"sort"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -9192,6 +9321,10 @@
|
||||
"nullable": true,
|
||||
"description": "Supplier stock"
|
||||
},
|
||||
"sort": {
|
||||
"type": "integer",
|
||||
"description": "Display sort order"
|
||||
},
|
||||
"priceId": {
|
||||
"type": "integer",
|
||||
"nullable": true
|
||||
|
||||
Reference in New Issue
Block a user