Production order
Production orders
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /production-order/create
Create a new production order with its line items.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
organization_id | string | Да | Organization ObjectId the production order belongs to |
date | string (date-time) | Да | Production order date (ISO 8601) |
code | string | Нет | Optional human-readable order code |
note | string | Нет | Optional free-text note |
items | object[] | Да | Line items — each references a product and a tech-map |
items[].product_id | string | Да | Product ObjectId to be produced |
items[].tech_map_id | string | Да | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Да | Planned production quantity |
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}Ответ
| Поле | Тип | Описание |
|---|---|---|
organization_id | string | Organization ObjectId the production order belongs to |
date | string (date-time) | Production order date (ISO 8601) |
code | string | Optional human-readable order code |
note | string | Optional free-text note |
items | object[] | Line items — each references a product and a tech-map |
items[].product_id | string | Product ObjectId to be produced |
items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Planned production quantity |
_id | string | Production order ObjectId |
status | string | Current production order state |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
],
"_id": "string",
"status": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}GET /production-order/get-by-id/{id}
Fetch a single production order by ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Production-order ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /production-order/create.
POST /production-order/get-paging
Paginated list of production orders, filterable by organization.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
organization_id | string | Нет | Filter by organization ObjectId |
{
"page": 1,
"limit": 20,
"organization_id": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | object[] | |
list[].organization_id | string | Organization ObjectId the production order belongs to |
list[].date | string (date-time) | Production order date (ISO 8601) |
list[].code | string | Optional human-readable order code |
list[].note | string | Optional free-text note |
list[].items | object[] | Line items — each references a product and a tech-map |
list[].items[].product_id | string | Product ObjectId to be produced |
list[].items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
list[].items[].amount | number | Planned production quantity |
list[]._id | string | Production order ObjectId |
list[].status | string | Current production order state |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [],
"_id": "string",
"status": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /production-order/update/{id}
Update an existing production order and its line items.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Production-order ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
organization_id | string | Да | Organization ObjectId the production order belongs to |
date | string (date-time) | Да | Production order date (ISO 8601) |
code | string | Нет | Optional human-readable order code |
note | string | Нет | Optional free-text note |
items | object[] | Да | Replacement line items for the order |
items[].product_id | string | Да | Product ObjectId to be produced |
items[].tech_map_id | string | Да | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Да | Planned production quantity |
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}Ответ
Структура ответа совпадает с POST /production-order/create.
DELETE /production-order/delete/{id}
Soft-delete a production order by ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Production-order ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.