u
This commit is contained in:
58
docs/api/routes/printer/:id.put.md
Normal file
58
docs/api/routes/printer/:id.put.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# `PUT /printer/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update printer
|
||||
|
||||
Updates specified fields of an existing printer for the selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Printer ID |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated printer
|
||||
|
||||
```json
|
||||
{
|
||||
"printer": {
|
||||
"id": 1,
|
||||
"company_id": 1,
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid input — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Printer not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
53
docs/api/routes/printer/create.md
Normal file
53
docs/api/routes/printer/create.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# `POST /printer`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create printer
|
||||
|
||||
Creates a new printer for the selected company.
|
||||
`type` must be `"esc/pos"` (lines) or `"zpl"` (pages).
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created printer
|
||||
|
||||
```json
|
||||
{
|
||||
"printer": {
|
||||
"id": 1,
|
||||
"company_id": 1,
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid input or missing fields — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
32
docs/api/routes/printer/delete.md
Normal file
32
docs/api/routes/printer/delete.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# `DELETE /printer/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete printer
|
||||
|
||||
Deletes a printer for the authenticated user's selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Printer ID |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Printer deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Printer not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
45
docs/api/routes/printer/get.md
Normal file
45
docs/api/routes/printer/get.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# `GET /printer/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get printer by ID
|
||||
|
||||
Retrieves a single printer for the authenticated user's selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Printer ID |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Printer details
|
||||
|
||||
```json
|
||||
{
|
||||
"printer": {
|
||||
"id": 1,
|
||||
"company_id": 1,
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Printer not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
40
docs/api/routes/printer/list.md
Normal file
40
docs/api/routes/printer/list.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# `GET /printer`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List printers
|
||||
|
||||
Lists printers for the selected company, ordered by sort and id.
|
||||
|
||||
## Response `200`
|
||||
|
||||
List of printers
|
||||
|
||||
```json
|
||||
{
|
||||
"printers": [
|
||||
{
|
||||
"id": 1,
|
||||
"company_id": 1,
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
43
docs/api/routes/printer/order.md
Normal file
43
docs/api/routes/printer/order.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# `PUT /printer/order`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Reorder printers
|
||||
|
||||
Reorders printers for the selected company.
|
||||
`printerIds` must include all existing printer IDs exactly once.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"printerIds": [
|
||||
1
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Applied printer order
|
||||
|
||||
```json
|
||||
{
|
||||
"printerIds": [
|
||||
1
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid printer order or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
58
docs/api/routes/printer/update.md
Normal file
58
docs/api/routes/printer/update.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# `PATCH /printer/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update printer (partial)
|
||||
|
||||
Updates specified fields of an existing printer for the selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Printer ID |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated printer
|
||||
|
||||
```json
|
||||
{
|
||||
"printer": {
|
||||
"id": 1,
|
||||
"company_id": 1,
|
||||
"address": "…",
|
||||
"type": "esc/pos",
|
||||
"model": "…",
|
||||
"serial": "…",
|
||||
"sort": 1,
|
||||
"desc": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid input — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Printer not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
73
docs/api/routes/stock/adjust.md
Normal file
73
docs/api/routes/stock/adjust.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# `POST /stock/adjust`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Adjust stock manually
|
||||
|
||||
Writes signed (+ or -) entries to the append-only ledger under an implicit manifest
|
||||
of type "adjustment", allocating a number from the "adjustment" number scheme.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"sku": "…",
|
||||
"warehouseId": 1,
|
||||
"amount": 1,
|
||||
"text": "…",
|
||||
"lines": [
|
||||
{
|
||||
"sku": "…",
|
||||
"warehouseId": 1,
|
||||
"amount": 1,
|
||||
"text": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Stock adjusted successfully
|
||||
|
||||
```json
|
||||
{
|
||||
"manifest": {
|
||||
"id": 1,
|
||||
"number": "…",
|
||||
"type": "adjustment",
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z"
|
||||
},
|
||||
"lines": [
|
||||
{}
|
||||
],
|
||||
"ledger": [
|
||||
{
|
||||
"id": 1,
|
||||
"manifestarticle_id": 1,
|
||||
"transaction_type": "…",
|
||||
"amount": 1,
|
||||
"transaction_text": "…",
|
||||
"hash_version": 1,
|
||||
"prev_hash": "…",
|
||||
"sku": "…",
|
||||
"created_at": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Missing fields, invalid amount, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Article or warehouse not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user