This commit is contained in:
seb
2026-09-29 18:26:40 +02:00
parent 9beab57ab4
commit 63af77eab3
8 changed files with 732 additions and 0 deletions

View File

@@ -12676,6 +12676,277 @@
}
}
},
"/article/{sku}/father": {
"post": {
"summary": "Toggle father mode for an article",
"description": "Enables or disables father article status. Enabling requires specifying an attributeNameId; disabling requires the article to have zero children.",
"tags": [
"Article"
],
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
},
"description": "Article SKU"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"isFather"
],
"properties": {
"isFather": {
"type": "boolean",
"description": "True to make article a father, false to revert to regular article"
},
"attributeNameId": {
"type": "integer",
"description": "Required when isFather is true. The attributename id for variants."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Updated article",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"article": {
"$ref": "#/components/schemas/Article"
}
}
}
}
}
},
"400": {
"description": "Invalid input or article still has children"
},
"404": {
"description": "Article or attribute name not found"
}
}
}
},
"/article/{sku}/children": {
"get": {
"summary": "List child articles of a father article",
"description": "Returns variants/children linked to this father article.",
"tags": [
"Article"
],
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
},
"description": "Father article SKU"
}
],
"responses": {
"200": {
"description": "List of children",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"sku": {
"type": "string"
},
"name": {
"type": "string"
},
"fathersort": {
"type": "integer"
},
"attributeValueId": {
"type": "integer"
},
"attributeValue": {
"type": "string"
}
}
}
}
}
}
}
}
},
"404": {
"description": "Article not found"
}
}
},
"post": {
"summary": "Add a child article to a father article",
"description": "Automatically generates SKU as fatherSku-attributeValueId and assigns the variant attribute.",
"tags": [
"Article"
],
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
},
"description": "Father article SKU"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"attributeValueId": {
"type": "integer",
"description": "ID of existing attribute value for the father's attribute"
},
"value": {
"type": "string",
"description": "String value to find or create under the father's attribute"
},
"name": {
"type": "string",
"description": "Optional custom variant name"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Created child article",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"article": {
"$ref": "#/components/schemas/Article"
}
}
}
}
}
},
"400": {
"description": "Father not configured as father or missing value"
},
"409": {
"description": "Child SKU already exists"
}
}
}
},
"/article/{sku}/children/{childSku}": {
"delete": {
"summary": "Remove a child article from a father article",
"description": "Unlinks the child from the father (or deletes if deleteArticle query/body is true).",
"tags": [
"Article"
],
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
},
"description": "Father article SKU"
},
{
"in": "path",
"name": "childSku",
"required": true,
"schema": {
"type": "string"
},
"description": "Child article SKU"
},
{
"in": "query",
"name": "deleteArticle",
"schema": {
"type": "boolean"
},
"description": "If true, permanently deletes the child article instead of just unlinking"
}
],
"responses": {
"200": {
"description": "Child removed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"deleted": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/auth/selected-company": {
"put": {
"tags": [