Add customergroup and entity HTTP APIs with address and contact routes.
Expose store-backed CRUD for customer groups, entities, nested addresses, and contacts, matching the documented dashdbschema contracts.
This commit is contained in:
@@ -65,11 +65,28 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route
|
||||
| [`routes/company/create.md`](routes/company/create.md) | `POST /company` |
|
||||
| [`routes/company/delete.md`](routes/company/delete.md) | `DELETE /company/{id}` |
|
||||
| [`routes/company/update.md`](routes/company/update.md) | `PUT /company/{id}` |
|
||||
| [`routes/customergroup/list.md`](routes/customergroup/list.md) | `GET /customergroup` |
|
||||
| [`routes/customergroup/create.md`](routes/customergroup/create.md) | `POST /customergroup` |
|
||||
| [`routes/customergroup/delete.md`](routes/customergroup/delete.md) | `DELETE /customergroup/{id}` |
|
||||
| [`routes/customergroup/update.md`](routes/customergroup/update.md) | `PATCH /customergroup/{id}` |
|
||||
| [`routes/delivery/list.md`](routes/delivery/list.md) | `GET /delivery` |
|
||||
| [`routes/delivery/create.md`](routes/delivery/create.md) | `POST /delivery` |
|
||||
| [`routes/delivery/delete.md`](routes/delivery/delete.md) | `DELETE /delivery/{id}` |
|
||||
| [`routes/delivery/get.md`](routes/delivery/get.md) | `GET /delivery/{id}` |
|
||||
| [`routes/delivery/update.md`](routes/delivery/update.md) | `PATCH /delivery/{id}` |
|
||||
| [`routes/entity/list.md`](routes/entity/list.md) | `GET /entity` |
|
||||
| [`routes/entity/create.md`](routes/entity/create.md) | `POST /entity` |
|
||||
| [`routes/entity/address/list.md`](routes/entity/address/list.md) | `GET /entity/{entityId}/address` |
|
||||
| [`routes/entity/address/create.md`](routes/entity/address/create.md) | `POST /entity/{entityId}/address` |
|
||||
| [`routes/entity/address/delete.md`](routes/entity/address/delete.md) | `DELETE /entity/{entityId}/address/{id}` |
|
||||
| [`routes/entity/address/update.md`](routes/entity/address/update.md) | `PATCH /entity/{entityId}/address/{id}` |
|
||||
| [`routes/entity/contact/list.md`](routes/entity/contact/list.md) | `GET /entity/{entityId}/contact` |
|
||||
| [`routes/entity/contact/create.md`](routes/entity/contact/create.md) | `POST /entity/{entityId}/contact` |
|
||||
| [`routes/entity/contact/delete.md`](routes/entity/contact/delete.md) | `DELETE /entity/{entityId}/contact/{id}` |
|
||||
| [`routes/entity/contact/update.md`](routes/entity/contact/update.md) | `PATCH /entity/{entityId}/contact/{id}` |
|
||||
| [`routes/entity/delete.md`](routes/entity/delete.md) | `DELETE /entity/{id}` |
|
||||
| [`routes/entity/get.md`](routes/entity/get.md) | `GET /entity/{id}` |
|
||||
| [`routes/entity/update.md`](routes/entity/update.md) | `PATCH /entity/{id}` |
|
||||
| [`routes/events.md`](routes/events.md) | `GET /events` |
|
||||
| [`routes/health.md`](routes/health.md) | `GET /health` |
|
||||
| [`routes/image/get.md`](routes/image/get.md) | `GET /image/{fullHash}` |
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
41
docs/api/routes/customergroup/create.md
Normal file
41
docs/api/routes/customergroup/create.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# `POST /customergroup`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create customer group
|
||||
|
||||
Creates a customer group for the selected company.
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Kunden"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created customer group
|
||||
|
||||
```json
|
||||
{
|
||||
"customergroup": {
|
||||
"id": 1,
|
||||
"name": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Name required or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
35
docs/api/routes/customergroup/delete.md
Normal file
35
docs/api/routes/customergroup/delete.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# `DELETE /customergroup/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete customer group
|
||||
|
||||
Deletes the customer group (cascades entities). Fails with
|
||||
`Customer group in use` for the POS group or other NO ACTION references.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid id — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Customer group not found — `{"error":"…"}` |
|
||||
| 409 | Customer group in use — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
35
docs/api/routes/customergroup/list.md
Normal file
35
docs/api/routes/customergroup/list.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# `GET /customergroup`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List customer groups
|
||||
|
||||
Lists customer groups for the authenticated user's selected company.
|
||||
|
||||
## Response `200`
|
||||
|
||||
Customer group list
|
||||
|
||||
```json
|
||||
{
|
||||
"customergroups": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
47
docs/api/routes/customergroup/update.md
Normal file
47
docs/api/routes/customergroup/update.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# `PATCH /customergroup/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update customer group
|
||||
|
||||
Renames a customer group for the selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Stammkunden"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated customer group
|
||||
|
||||
```json
|
||||
{
|
||||
"customergroup": {
|
||||
"id": 1,
|
||||
"name": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Name required, invalid id, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Customer group or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
59
docs/api/routes/entity/address/create.md
Normal file
59
docs/api/routes/entity/address/create.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# `POST /entity/{entityId}/address`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create entity address
|
||||
|
||||
Creates an address for the entity. `addressType` is required.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"addressType": "billing",
|
||||
"street": "Hauptstraße",
|
||||
"streetNumber": "12",
|
||||
"zip": "10115",
|
||||
"city": "Berlin"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created address
|
||||
|
||||
```json
|
||||
{
|
||||
"address": {
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"street": "…",
|
||||
"streetNumber": "…",
|
||||
"zip": "…",
|
||||
"city": "…",
|
||||
"county": "…",
|
||||
"addressType": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Address type required, invalid entityId, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
33
docs/api/routes/entity/address/delete.md
Normal file
33
docs/api/routes/entity/address/delete.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# `DELETE /entity/{entityId}/address/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete entity address
|
||||
|
||||
Deletes one address of the entity.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid ids — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Address or entity not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
49
docs/api/routes/entity/address/list.md
Normal file
49
docs/api/routes/entity/address/list.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# `GET /entity/{entityId}/address`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List entity addresses
|
||||
|
||||
Lists addresses for an entity of the selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Address list
|
||||
|
||||
```json
|
||||
{
|
||||
"addresses": [
|
||||
{
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"street": "…",
|
||||
"streetNumber": "…",
|
||||
"zip": "…",
|
||||
"city": "…",
|
||||
"county": "…",
|
||||
"addressType": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid entityId — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
57
docs/api/routes/entity/address/update.md
Normal file
57
docs/api/routes/entity/address/update.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# `PATCH /entity/{entityId}/address/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update entity address
|
||||
|
||||
Patches address fields that are present.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"city": "München",
|
||||
"zip": "80331"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated address
|
||||
|
||||
```json
|
||||
{
|
||||
"address": {
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"street": "…",
|
||||
"streetNumber": "…",
|
||||
"zip": "…",
|
||||
"city": "…",
|
||||
"county": "…",
|
||||
"addressType": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Address type required, invalid ids, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Address, entity, or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
50
docs/api/routes/entity/contact/create.md
Normal file
50
docs/api/routes/entity/contact/create.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# `POST /entity/{entityId}/contact`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create entity contact
|
||||
|
||||
Creates a contact for the entity. `contactType` and `contact` are required.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"contactType": "email",
|
||||
"contact": "anna@example.com"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created contact
|
||||
|
||||
```json
|
||||
{
|
||||
"contact": {
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"contactType": "…",
|
||||
"contact": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Contact required, invalid entityId, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
33
docs/api/routes/entity/contact/delete.md
Normal file
33
docs/api/routes/entity/contact/delete.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# `DELETE /entity/{entityId}/contact/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete entity contact
|
||||
|
||||
Deletes one contact of the entity.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid ids — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Contact or entity not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
43
docs/api/routes/entity/contact/list.md
Normal file
43
docs/api/routes/entity/contact/list.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# `GET /entity/{entityId}/contact`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List entity contacts
|
||||
|
||||
Lists contacts for an entity of the selected company (`contactType` e.g. `email`, `phone`).
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Contact list
|
||||
|
||||
```json
|
||||
{
|
||||
"contacts": [
|
||||
{
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"contactType": "…",
|
||||
"contact": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid entityId — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
50
docs/api/routes/entity/contact/update.md
Normal file
50
docs/api/routes/entity/contact/update.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# `PATCH /entity/{entityId}/contact/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update entity contact
|
||||
|
||||
Patches `contactType` and/or `contact`.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `entityId` | yes | integer | |
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"contact": "anna.mueller@example.com"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated contact
|
||||
|
||||
```json
|
||||
{
|
||||
"contact": {
|
||||
"id": 1,
|
||||
"entityId": 1,
|
||||
"contactType": "…",
|
||||
"contact": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Contact required, invalid ids, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Contact, entity, or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
48
docs/api/routes/entity/create.md
Normal file
48
docs/api/routes/entity/create.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# `POST /entity`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create entity
|
||||
|
||||
Creates an entity in a company customer group and writes `entityhistory` (`Erstellt`).
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"customergroupId": 1,
|
||||
"name": "Müller",
|
||||
"firstName": "Anna"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created entity
|
||||
|
||||
```json
|
||||
{
|
||||
"entity": {
|
||||
"id": 1,
|
||||
"customergroupId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z",
|
||||
"updatedAt": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Name required or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Company or customer group not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
32
docs/api/routes/entity/delete.md
Normal file
32
docs/api/routes/entity/delete.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# `DELETE /entity/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete entity
|
||||
|
||||
Deletes the entity (`entityhistory` cascades; related addresses/contacts cascade).
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid id — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
43
docs/api/routes/entity/get.md
Normal file
43
docs/api/routes/entity/get.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# `GET /entity/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get entity
|
||||
|
||||
Returns one entity for the selected company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Entity
|
||||
|
||||
```json
|
||||
{
|
||||
"entity": {
|
||||
"id": 1,
|
||||
"customergroupId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z",
|
||||
"updatedAt": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid id — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
47
docs/api/routes/entity/list.md
Normal file
47
docs/api/routes/entity/list.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# `GET /entity`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List entities
|
||||
|
||||
Lists entities for the selected company. Optional `customergroupId`
|
||||
query filters to one group (must belong to the company).
|
||||
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `customergroupId` | no | integer | |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Entity list
|
||||
|
||||
```json
|
||||
{
|
||||
"entities": [
|
||||
{
|
||||
"id": 1,
|
||||
"customergroupId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z",
|
||||
"updatedAt": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected or invalid customergroupId — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Company or customer group not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
53
docs/api/routes/entity/update.md
Normal file
53
docs/api/routes/entity/update.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# `PATCH /entity/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update entity
|
||||
|
||||
Patches `name` and/or `firstName`. Writes `entityhistory` when values change.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Müller",
|
||||
"firstName": "Anna"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated entity
|
||||
|
||||
```json
|
||||
{
|
||||
"entity": {
|
||||
"id": 1,
|
||||
"customergroupId": 1,
|
||||
"firstName": "…",
|
||||
"name": "…",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z",
|
||||
"updatedAt": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Name required, invalid id, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Entity or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user