MRO Module
Inventory Service
API для parts catalog, warehouses, stock operations, movements audit.
Inventory Service — /api/v1/inventory
Base: https://api.nurcore.kg/api/v1/inventory
Parts catalog
Classifications:
| Type | Description | Examples |
|---|---|---|
ROTABLE | S/N tracked LRUs, overhaulable | Engine, gear actuator, LRU |
REPAIRABLE | Recoverable через repair shop | Hydraulic pump, fuel pump |
CONSUMABLE | Не возвратные, limited shelf life | Filters, gaskets, o-rings |
EXPENDABLE | Полностью расходные | Oils, rivets, lockwire, fasteners |
LLP (Life Limited Parts) — отдельная классификация по hard-time discard через TCC limits в component tree (per Part-M).
| Method | Path | Description |
|---|---|---|
POST | /parts | Create P/N в catalog |
GET | /parts?q=DHC8&classification=ROTABLE | Search |
GET | /parts/{id} | Detail |
PATCH | /parts/{id} | Update (reorder policy, shelf life) |
Warehouses & locations
| Method | Path | Description |
|---|---|---|
POST | /warehouses | Create warehouse |
POST | /warehouses/{id}/locations | Add bin/shelf (A-01-02 format) |
GET | /warehouses | List |
Quarantine bin — отдельная location с is_quarantine=true per Part-145 §145.A.42 для unverified parts (no Form 1, expired, failed inspection).
Stock operations
Conditions (per ATA Spec 2000):
| Code | Meaning |
|---|---|
NEW | Factory new, never installed |
SERVICEABLE | Inspected & released |
OH | Overhauled (через repair shop) |
RP | Repaired |
AR | As Removed |
UNSERVICEABLE | Failed inspection |
QUARANTINE | Awaiting verification |
SCRAP | Disposed |
8 atomic operations
| Method | Path | Description |
|---|---|---|
POST | /stock/receipt | Приёмка (создаёт stock_item + RECEIPT movement) |
POST | /stock/issue | Выдача под WO (- qty + ISSUE) |
POST | /stock/transfer | Между warehouses (TRANSFER_OUT + TRANSFER_IN) |
POST | /stock/quarantine | → QUARANTINE bin |
POST | /stock/scrap | Списание (SCRAP) |
POST | /stock/adjust | Inventory correction (ADJUST) |
POST | /stock/return | Возврат на склад (RETURN_TO_STOCK) |
POST | /stock/rob | Receipt On Board (для AOG parts) |
Каждая операция — SELECT FOR UPDATE row lock для atomic concurrent safety.
Movements (append-only audit)
Per Part-145 §145.A.55 — 3 years minimum retention.
Никогда не UPDATE/DELETE — только INSERT с reference к source document (PO/WO/GRN).
| Method | Path | Description |
|---|---|---|
GET | /stock/{stock_item_id}/movements | History per item |
GET | /reports/movements-list?movement_type=RECEIPT | Cross-fleet |
GET | /reports/movements?date_from=...&date_to=... | Aggregate summary |
Reports
| Method | Path | Description |
|---|---|---|
GET | /reports/stock-value | Per-warehouse value |
GET | /reports/expiring-soon?days=90 | Shelf life expiring |
GET | /reports/below-reorder | Parts ниже reorder point |