Align store calls with selected-company scoping and add entity numbers.

Drop companyId from company-scoped store wrappers and routes, add GET /entity/next-number plus optional number on entity create/update, and document dashdbschema API.md lookup in sibling-repos.
This commit is contained in:
seb
2026-08-07 06:22:13 +02:00
parent 2767568f5a
commit e6c24654dd
36 changed files with 496 additions and 189 deletions

View File

@@ -5,7 +5,8 @@ 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).
filters to one group. Optional `role=customer` excludes Lieferanten/POS
groups (for quote/order pickers). `role` wins when both are set.
## Query parameters
@@ -13,6 +14,7 @@ query filters to one group (must belong to the company).
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `customergroupId` | no | integer | |
| `role` | no | string | |
## Response `200`
@@ -26,6 +28,7 @@ Entity list
"customergroupId": 1,
"firstName": "…",
"name": "…",
"number": "…",
"createdAt": "2026-08-10T00:00:00.000Z",
"updatedAt": "2026-08-10T00:00:00.000Z"
}
@@ -37,7 +40,7 @@ Entity list
| Status | Description |
|--------|-------------|
| 400 | No company selected or invalid customergroupId — `{"error":"…"}` |
| 400 | No company selected, invalid customergroupId, or invalid role — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Company or customer group not found — `{"error":"…"}` |