# Data Rules ## Идентификаторы 1С (схема analytics) - **`*_1c_id`** — бинарный ключ 1С (`BINARY(16)`), ссылка на `_IDRRef` справочника/документа. - **`*_id`** — строковый id (GUID в формате `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) для API, поиска, отображения. Пример: `contractor_1c_id` (binary) в таблице, `contractor_id` (nvarchar) в представлении для выдачи во внешние системы. --- - Stock quantity = field 'quantity' only. - Never use 'sellable_stock' in stock calculations. - Marketplace (MP) stock is calculated separately and added if needed. - Orders with statuses: 'В пути', 'В производстве', 'Выгружен на складе', 'Согласован' are treated as incoming stock. - Use date intervals as [start, end) when aggregating.