u
This commit is contained in:
@@ -345,6 +345,7 @@ Clients subscribe via [`GET /events`](routes/events.md) (`text/event-stream`). A
|
|||||||
| `shipping` | `POST /stock/ship` |
|
| `shipping` | `POST /stock/ship` |
|
||||||
| `stock` | `DELETE /shipment/{id}`, `POST /stock/accept`, `POST /stock/adjust`, `POST /stock/ship` |
|
| `stock` | `DELETE /shipment/{id}`, `POST /stock/accept`, `POST /stock/adjust`, `POST /stock/ship` |
|
||||||
| `subagentschedule` | `POST /subagentschedule`, `DELETE /subagentschedule/{id}`, `PUT /subagentschedule/{id}` |
|
| `subagentschedule` | `POST /subagentschedule`, `DELETE /subagentschedule/{id}`, `PUT /subagentschedule/{id}` |
|
||||||
|
| `supplier` | `POST /supplier`, `DELETE /supplier/{id}`, `PATCH /supplier/{id}` |
|
||||||
| `user` | `PUT /auth/selected-company`, `POST /company`, `DELETE /company/{id}` |
|
| `user` | `PUT /auth/selected-company`, `POST /company`, `DELETE /company/{id}` |
|
||||||
| `vfs` | `POST /vfs/applets/restore`, `POST /vfs/mkdir`, `POST /vfs/rename`, `POST /vfs/skills/restore`, `POST /vfs/upload`, `DELETE /vfs/{*path}`, `POST /vfs/{*path}`, `PUT /vfs/{*path}` |
|
| `vfs` | `POST /vfs/applets/restore`, `POST /vfs/mkdir`, `POST /vfs/rename`, `POST /vfs/skills/restore`, `POST /vfs/upload`, `DELETE /vfs/{*path}`, `POST /vfs/{*path}`, `PUT /vfs/{*path}` |
|
||||||
| `warehouse` | `POST /warehouse`, `PUT /warehouse/order`, `DELETE /warehouse/{id}`, `PUT /warehouse/{id}` |
|
| `warehouse` | `POST /warehouse`, `PUT /warehouse/order`, `DELETE /warehouse/{id}`, `PUT /warehouse/{id}` |
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ _none_
|
|||||||
- `labeltemplate`: `{}`
|
- `labeltemplate`: `{}`
|
||||||
- `printer`: `{}`
|
- `printer`: `{}`
|
||||||
- `warehouse`: `{}`
|
- `warehouse`: `{}`
|
||||||
|
- `supplier`: `{}`
|
||||||
- `vfs`: `{}`
|
- `vfs`: `{}`
|
||||||
- `modelconversation`: `{}`
|
- `modelconversation`: `{}`
|
||||||
- `modelconversation-<id>`: `{}`
|
- `modelconversation-<id>`: `{}`
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ emits `{ sender, brandId }`.
|
|||||||
| `labeltemplate` | `{}` | `POST /labeltemplate`, `PUT /labeltemplate/{id}`, `PATCH /labeltemplate/{id}`, `DELETE /labeltemplate/{id}` |
|
| `labeltemplate` | `{}` | `POST /labeltemplate`, `PUT /labeltemplate/{id}`, `PATCH /labeltemplate/{id}`, `DELETE /labeltemplate/{id}` |
|
||||||
| `printer` | `{}` | `POST /printer`, `PUT /printer/{id}`, `PATCH /printer/{id}`, `DELETE /printer/{id}` |
|
| `printer` | `{}` | `POST /printer`, `PUT /printer/{id}`, `PATCH /printer/{id}`, `DELETE /printer/{id}` |
|
||||||
| `warehouse` | `{}` | `POST /warehouse`, `PUT /warehouse/{id}`, `PATCH /warehouse/{id}`, `DELETE /warehouse/{id}` |
|
| `warehouse` | `{}` | `POST /warehouse`, `PUT /warehouse/{id}`, `PATCH /warehouse/{id}`, `DELETE /warehouse/{id}` |
|
||||||
|
| `supplier` | `{}` | `POST /supplier`, `PATCH /supplier/{id}`, `DELETE /supplier/{id}` |
|
||||||
| `vfs` | `{}` | VFS uploads and filesystem mutations such as `POST /vfs/upload`, `POST /vfs/mkdir`, `POST /vfs/rename`, `PUT /vfs/{*path}`, `DELETE /vfs/{*path}` |
|
| `vfs` | `{}` | VFS uploads and filesystem mutations such as `POST /vfs/upload`, `POST /vfs/mkdir`, `POST /vfs/rename`, `PUT /vfs/{*path}`, `DELETE /vfs/{*path}` |
|
||||||
| `modelconversation` | `{}` | `POST /modelconversation`, `DELETE /modelconversation/{id}` |
|
| `modelconversation` | `{}` | `POST /modelconversation`, `DELETE /modelconversation/{id}` |
|
||||||
| `modelconversation-<id>` | `{}` | Conversation-specific updates on the same model conversation thread; the concrete ID is used in the event name |
|
| `modelconversation-<id>` | `{}` | Conversation-specific updates on the same model conversation thread; the concrete ID is used in the event name |
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ Creates a supplier in the company `Lieferanten` group (created on first use).
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Signals
|
||||||
|
|
||||||
|
On success, emits SSE signal: `supplier` (see [`GET /events`](../events.md)).
|
||||||
|
|
||||||
## Response `201`
|
## Response `201`
|
||||||
|
|
||||||
Created supplier
|
Created supplier
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ Related `entityhistory` cascades; `manifest.entity_id` is set null.
|
|||||||
|-------|----------|------|-------------|
|
|-------|----------|------|-------------|
|
||||||
| `id` | yes | integer | |
|
| `id` | yes | integer | |
|
||||||
|
|
||||||
|
## Signals
|
||||||
|
|
||||||
|
On success, emits SSE signal: `supplier` (see [`GET /events`](../events.md)).
|
||||||
|
|
||||||
## Response `204`
|
## Response `204`
|
||||||
|
|
||||||
Deleted
|
Deleted
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ Renames a supplier for the selected company.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Signals
|
||||||
|
|
||||||
|
On success, emits SSE signal: `supplier` (see [`GET /events`](../events.md)).
|
||||||
|
|
||||||
## Response `200`
|
## Response `200`
|
||||||
|
|
||||||
Updated supplier
|
Updated supplier
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export function register(app, basePath = '') {
|
|||||||
* | `labeltemplate` | `{}` | `POST /labeltemplate`, `PUT /labeltemplate/{id}`, `PATCH /labeltemplate/{id}`, `DELETE /labeltemplate/{id}` |
|
* | `labeltemplate` | `{}` | `POST /labeltemplate`, `PUT /labeltemplate/{id}`, `PATCH /labeltemplate/{id}`, `DELETE /labeltemplate/{id}` |
|
||||||
* | `printer` | `{}` | `POST /printer`, `PUT /printer/{id}`, `PATCH /printer/{id}`, `DELETE /printer/{id}` |
|
* | `printer` | `{}` | `POST /printer`, `PUT /printer/{id}`, `PATCH /printer/{id}`, `DELETE /printer/{id}` |
|
||||||
* | `warehouse` | `{}` | `POST /warehouse`, `PUT /warehouse/{id}`, `PATCH /warehouse/{id}`, `DELETE /warehouse/{id}` |
|
* | `warehouse` | `{}` | `POST /warehouse`, `PUT /warehouse/{id}`, `PATCH /warehouse/{id}`, `DELETE /warehouse/{id}` |
|
||||||
|
* | `supplier` | `{}` | `POST /supplier`, `PATCH /supplier/{id}`, `DELETE /supplier/{id}` |
|
||||||
* | `vfs` | `{}` | VFS uploads and filesystem mutations such as `POST /vfs/upload`, `POST /vfs/mkdir`, `POST /vfs/rename`, `PUT /vfs/{*path}`, `DELETE /vfs/{*path}` |
|
* | `vfs` | `{}` | VFS uploads and filesystem mutations such as `POST /vfs/upload`, `POST /vfs/mkdir`, `POST /vfs/rename`, `PUT /vfs/{*path}`, `DELETE /vfs/{*path}` |
|
||||||
* | `modelconversation` | `{}` | `POST /modelconversation`, `DELETE /modelconversation/{id}` |
|
* | `modelconversation` | `{}` | `POST /modelconversation`, `DELETE /modelconversation/{id}` |
|
||||||
* | `modelconversation-<id>` | `{}` | Conversation-specific updates on the same model conversation thread; the concrete ID is used in the event name |
|
* | `modelconversation-<id>` | `{}` | Conversation-specific updates on the same model conversation thread; the concrete ID is used in the event name |
|
||||||
@@ -98,6 +99,8 @@ export function register(app, basePath = '') {
|
|||||||
* payload: "{}"
|
* payload: "{}"
|
||||||
* - name: warehouse
|
* - name: warehouse
|
||||||
* payload: "{}"
|
* payload: "{}"
|
||||||
|
* - name: supplier
|
||||||
|
* payload: "{}"
|
||||||
* - name: vfs
|
* - name: vfs
|
||||||
* payload: "{}"
|
* payload: "{}"
|
||||||
* - name: modelconversation
|
* - name: modelconversation
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as db from '../../db/supplier.js';
|
import * as db from '../../db/supplier.js';
|
||||||
|
import { emit } from '../sse.js';
|
||||||
|
|
||||||
// #region Helpers
|
// #region Helpers
|
||||||
|
|
||||||
@@ -114,6 +115,7 @@ export function register(app, basePath = '') {
|
|||||||
* Creates a supplier in the company `Lieferanten` group (created on first use).
|
* Creates a supplier in the company `Lieferanten` group (created on first use).
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
|
* x-signals: [supplier]
|
||||||
* x-markdown: supplier/create.md
|
* x-markdown: supplier/create.md
|
||||||
* requestBody:
|
* requestBody:
|
||||||
* required: true
|
* required: true
|
||||||
@@ -194,6 +196,7 @@ export function register(app, basePath = '') {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const supplier = await db.create(req.user.id, { name });
|
const supplier = await db.create(req.user.id, { name });
|
||||||
|
emit('supplier', { companyId: selected.companyId });
|
||||||
res.status(201).json({ supplier });
|
res.status(201).json({ supplier });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const status = supplierErrorStatus(error);
|
const status = supplierErrorStatus(error);
|
||||||
@@ -213,6 +216,7 @@ export function register(app, basePath = '') {
|
|||||||
* description: Renames a supplier for the selected company.
|
* description: Renames a supplier for the selected company.
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
|
* x-signals: [supplier]
|
||||||
* x-markdown: supplier/update.md
|
* x-markdown: supplier/update.md
|
||||||
* parameters:
|
* parameters:
|
||||||
* - in: path
|
* - in: path
|
||||||
@@ -274,6 +278,7 @@ export function register(app, basePath = '') {
|
|||||||
* Related `entityhistory` cascades; `manifest.entity_id` is set null.
|
* Related `entityhistory` cascades; `manifest.entity_id` is set null.
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
|
* x-signals: [supplier]
|
||||||
* x-markdown: supplier/delete.md
|
* x-markdown: supplier/delete.md
|
||||||
* parameters:
|
* parameters:
|
||||||
* - in: path
|
* - in: path
|
||||||
@@ -332,6 +337,7 @@ export function register(app, basePath = '') {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const supplier = await db.update(req.user.id, id, { name });
|
const supplier = await db.update(req.user.id, id, { name });
|
||||||
|
emit('supplier', { companyId: selected.companyId });
|
||||||
res.status(200).json({ supplier });
|
res.status(200).json({ supplier });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const status = supplierErrorStatus(error);
|
const status = supplierErrorStatus(error);
|
||||||
@@ -357,6 +363,7 @@ export function register(app, basePath = '') {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await db.remove(req.user.id, id);
|
await db.remove(req.user.id, id);
|
||||||
|
emit('supplier', { companyId: selected.companyId });
|
||||||
res.sendStatus(204);
|
res.sendStatus(204);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const status = supplierErrorStatus(error);
|
const status = supplierErrorStatus(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user