This commit is contained in:
seb
2026-09-27 21:01:20 +02:00
parent bab15b0978
commit 68b793c9ba
17 changed files with 1695 additions and 23 deletions

View File

@@ -92,12 +92,610 @@
"name": "Stock",
"description": "Manual stock additions and removals"
},
{
"name": "Warehouse",
"description": "Company-scoped warehouses"
},
{
"name": "Serper",
"description": "Serper Google image search and thumbnail streaming"
}
],
"paths": {
"/warehouse": {
"get": {
"tags": [
"Warehouse"
],
"summary": "List warehouses",
"description": "Lists warehouses for the selected company, ordered by sort and name.",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "warehouse/list.md",
"responses": {
"200": {
"description": "List of warehouses",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouses": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Warehouse"
}
}
}
}
}
}
},
"400": {
"description": "No company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"post": {
"tags": [
"Warehouse"
],
"summary": "Create warehouse",
"description": "Creates a new warehouse for the selected company.\nSort order will be automatically appended if omitted.\n",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "warehouse/create.md",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WarehouseCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "Created warehouse",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouse": {
"$ref": "#/components/schemas/Warehouse"
}
}
}
}
}
},
"400": {
"description": "Invalid input or missing fields",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Warehouse already exists",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/warehouse/order": {
"put": {
"tags": [
"Warehouse"
],
"summary": "Reorder warehouses",
"description": "Reorders warehouses for the selected company.\n`warehouseIds` must include all existing warehouse IDs exactly once.\n",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "warehouse/order.md",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"warehouseIds"
],
"properties": {
"warehouseIds": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Applied warehouse order",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouseIds": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}
}
}
},
"400": {
"description": "Invalid warehouse order or no company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/warehouse/{id}": {
"get": {
"tags": [
"Warehouse"
],
"summary": "Get warehouse by ID",
"description": "Retrieves a single warehouse for the authenticated user's selected company.",
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Warehouse ID"
}
],
"x-markdown": "warehouse/get.md",
"responses": {
"200": {
"description": "Warehouse details",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouse": {
"$ref": "#/components/schemas/Warehouse"
}
}
}
}
}
},
"400": {
"description": "Invalid ID or no company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Warehouse not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"patch": {
"tags": [
"Warehouse"
],
"summary": "Update warehouse (partial)",
"description": "Updates specified fields of an existing warehouse for the selected company.",
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Warehouse ID"
}
],
"x-markdown": "warehouse/update.md",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WarehouseUpdateInput"
}
}
}
},
"responses": {
"200": {
"description": "Updated warehouse",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouse": {
"$ref": "#/components/schemas/Warehouse"
}
}
}
}
}
},
"400": {
"description": "Invalid input",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Warehouse not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Warehouse name conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"put": {
"tags": [
"Warehouse"
],
"summary": "Update warehouse",
"description": "Updates specified fields of an existing warehouse for the selected company.",
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Warehouse ID"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WarehouseUpdateInput"
}
}
}
},
"responses": {
"200": {
"description": "Updated warehouse",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"warehouse": {
"$ref": "#/components/schemas/Warehouse"
}
}
}
}
}
},
"400": {
"description": "Invalid input",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Warehouse not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Warehouse name conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"delete": {
"tags": [
"Warehouse"
],
"summary": "Delete warehouse",
"description": "Deletes a warehouse if not in use in the ledger.",
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Warehouse ID"
}
],
"x-markdown": "warehouse/delete.md",
"responses": {
"204": {
"description": "Warehouse deleted"
},
"400": {
"description": "Invalid ID or no company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Warehouse not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Warehouse in use in ledger",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/unit": {
"get": {
"tags": [
@@ -8995,6 +9593,10 @@
},
"name": {
"type": "string"
},
"track_stock": {
"type": "boolean",
"description": "Whether to track inventory stock (defaults to true)"
}
},
"example": {
@@ -9277,6 +9879,10 @@
"unitSi": {
"type": "string",
"description": "Existing company unit `si`"
},
"track_stock": {
"type": "boolean",
"description": "Whether to track inventory stock"
}
},
"example": {
@@ -10277,6 +10883,113 @@
}
}
},
"/article/{sku}/track_stock": {
"put": {
"tags": [
"Article"
],
"summary": "Set article track_stock flag by SKU",
"description": "Enables or disables inventory stock tracking for this article.\n",
"security": [
{
"cookieAuth": []
}
],
"x-signals": [
"article-<sku>"
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
},
"description": "Article SKU"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"track_stock"
],
"properties": {
"track_stock": {
"type": "boolean",
"description": "Whether to track inventory stock for this article"
}
},
"example": {
"track_stock": true
}
}
}
}
},
"responses": {
"200": {
"description": "Updated article detail",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"article": {
"$ref": "#/components/schemas/ArticleDetail"
}
}
}
}
}
},
"400": {
"description": "Invalid track_stock",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not authorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Article not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/article/{sku}/categories": {
"put": {
"tags": [
@@ -10889,12 +11602,15 @@
},
"sku": {
"type": "string"
},
"track_stock": {
"type": "boolean"
}
}
},
"ArticleDetail": {
"type": "object",
"description": "Full article payload (unit, brand, categoryIds, photos, eans, prices, …)",
"description": "Full article payload (unit, brand, categoryIds, photos, eans, prices, track_stock, …)",
"additionalProperties": true
},
"ArticleHistoryEntry": {
@@ -12116,6 +12832,53 @@
}
}
},
"Warehouse": {
"type": "object",
"required": [
"id",
"name",
"sort"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"sort": {
"type": "integer",
"description": "Sort order"
}
}
},
"WarehouseCreateInput": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"sort": {
"type": "integer",
"description": "Optional sort order (defaults to auto-increment)"
}
}
},
"WarehouseUpdateInput": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"sort": {
"type": "integer",
"description": "Sort order"
}
}
},
"StockAdjustmentInput": {
"type": "object",
"properties": {