This commit is contained in:
seb
2026-10-08 12:44:53 +02:00
parent 79a1b72292
commit e2e7f8d566
11 changed files with 172 additions and 21 deletions

View File

@@ -58,7 +58,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
### Routes
#### Create article in category — `POST /article`
- Params: `body: { categoryId: int, name: str, track_stock?: bool }`
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
- Returns: `201 T31`
#### Export articles as ZIP — `GET /article/export.zip`
- Params: `query: categoryId?: int`
@@ -70,7 +70,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Params: `sku: str`
- Returns: `200 T1`
#### Update article by SKU — `PATCH /article/{sku}`
- Params: `sku: str, body: { name?: str, unitamount?: num, unitSi?: str, track_stock?: bool }`
- Params: `sku: str, body: { name?: str, desc?: str, seo?: str, unitamount?: num, unitSi?: str, track_stock?: bool }`
- Returns: `200 T1`
#### Get Stückliste (bundle items) for an article — `GET /article/{sku}/articlelist`
- Params: `sku: str`

View File

@@ -53,7 +53,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
### Routes
#### Create article in category — `POST /article`
- Params: `body: { categoryId: int, name: str, track_stock?: bool }`
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
- Returns: `201 T29`
#### Delete article by SKU — `DELETE /article/{sku}`
- Params: `sku: str, query: cascade?: bool`
@@ -62,7 +62,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Params: `sku: str`
- Returns: `200 T1`
#### Update article by SKU — `PATCH /article/{sku}`
- Params: `sku: str, body: { name?: str, unitamount?: num, unitSi?: str, track_stock?: bool }`
- Params: `sku: str, body: { name?: str, desc?: str, seo?: str, unitamount?: num, unitSi?: str, track_stock?: bool }`
- Returns: `200 T1`
#### Get Stückliste (bundle items) for an article — `GET /article/{sku}/articlelist`
- Params: `sku: str`

View File

@@ -12,6 +12,8 @@ Creates an article under an authorized category (`parentId`).
|-------|----------|------|-------------|
| `categoryId` | yes | integer | Category ID under which to create the article |
| `name` | yes | string | |
| `desc` | no | string | Article description text/HTML |
| `seo` | no | string | SEO text |
| `track_stock` | no | boolean | Whether to track inventory stock (defaults to true) |
```json

View File

@@ -19,6 +19,8 @@ Patches article fields. At least one of `name`, `unitamount`, `unitSi` required.
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `name` | no | string | |
| `desc` | no | string | Article description text/HTML |
| `seo` | no | string | SEO text |
| `unitamount` | no | number | Must be finite and `> 0` |
| `unitSi` | no | string | Existing company unit `si` |
| `track_stock` | no | boolean | Whether to track inventory stock |