States settings
Kanban board column configuration
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /states-settings/create
Create a custom workflow state column for an organization and domain type.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
organization_id | string | Ha | Organization ObjectId this state column belongs to |
name | string | Ha | Display name of the state column |
type | string | Ha | The domain this state column belongs to (STATE_TYPE). Mumkin qiymatlar: trades, saleOrders, deliveryOrders, purchases, purchaseOrders, purchaseRequests |
order | number | Ha | Display order within the same type; siblings are re-sequenced automatically |
note | string | Yo‘q | Optional descriptive note for the state column |
bg_color | string | Yo‘q | Background color hex code, e.g. #F1F2F4 |
{
"organization_id": "string",
"name": "string",
"type": "trades",
"order": 0,
"note": "string",
"bg_color": "string"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
name | string | |
type | string | |
is_default | boolean | |
default_key | string | |
organization_id | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"type": "string",
"is_default": false,
"default_key": "string",
"organization_id": "string"
},
"time": "2025-05-01T12:00:00Z"
}GET /states-settings/get-by-id/{id}
Fetch a single workflow state column by ObjectId.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | State column ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /states-settings/create.
POST /states-settings/get-paging
Flat sorted list of workflow state columns. Filterable by type, organization, and is_default. Returns a plain array sorted by {type, order} — not a {list, total} envelope.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
type | string | Yo‘q | Filter by STATE_TYPE domain. Mumkin qiymatlar: trades, saleOrders, deliveryOrders, purchases, purchaseOrders, purchaseRequests |
types | string[] | Yo‘q | Filter by multiple STATE_TYPE values |
organization_id | string | Yo‘q | Filter by organization ObjectId |
is_default | boolean | Yo‘q | When true, return only default (system-seeded) columns; false returns custom ones only |
{
"type": "trades",
"types": [
"trades"
],
"organization_id": "string",
"is_default": false
}Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"name": "string",
"type": "string",
"is_default": false,
"default_key": "string",
"organization_id": "string"
}
],
"time": "2025-05-01T12:00:00Z"
}PUT /states-settings/update/{id}
Update an existing workflow state column. Changing order re-sequences sibling columns of the same type. order is silently dropped for default (system-seeded) columns.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | State column ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Yo‘q | New display name |
order | number | Yo‘q | New display order. Silently dropped for default columns. |
note | string | Yo‘q | Updated note |
bg_color | string | Yo‘q | Updated background color hex code |
{
"name": "string",
"order": 0,
"note": "string",
"bg_color": "string"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /states-settings/create.
DELETE /states-settings/delete/{id}
Soft-delete a workflow state column (sets is_deleted=true). Guarded: default columns cannot be deleted, and columns still referenced by trade/sale-order/delivery-order documents are rejected with an error.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | State column ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "string",
"time": "2025-05-01T12:00:00Z"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.