svc-inventory-procurement¶
NovaTrek Inventory Procurement API | Support | v2.1.0 | NovaTrek Platform Engineering
Manages purchasing workflows, supplier relationships, and stock replenishment
Swagger UI Download OpenAPI Spec
Integration Context¶
Data Store¶
Overview¶
| Property | Detail |
|---|---|
| Engine | PostgreSQL 15 |
| Schema | procurement |
| Tables | purchase_orders, po_line_items, suppliers, stock_levels, stock_adjustments, reorder_alerts |
| Estimated Volume | ~50 POs/day, ~200 stock adjustments/day |
| Connection Pool | min 3 / max 10 / idle timeout 10min |
| Backup Strategy | Daily pg_dump, 30-day retention |
Key Features¶
- Purchase order approval workflow with state machine
- Automatic reorder point calculation based on consumption
- Supplier lead time tracking for delivery estimates
Table Reference¶
purchase_orders¶
Purchase orders with approval state machine
| Column | Type | Constraints |
|---|---|---|
po_id | UUID | PK |
supplier_id | UUID | NOT NULL, FK -> suppliers |
status | VARCHAR(20) | NOT NULL, DEFAULT 'draft' |
total_amount | DECIMAL(10,2) | NOT NULL |
currency | CHAR(3) | NOT NULL, DEFAULT 'USD' |
approved_by | VARCHAR(100) | NULL |
submitted_at | TIMESTAMPTZ | NULL |
approved_at | TIMESTAMPTZ | NULL |
created_at | TIMESTAMPTZ | NOT NULL |
Indexes:
idx_po_supplieronsupplier_ididx_po_statusonstatus
suppliers¶
Approved suppliers with performance tracking
| Column | Type | Constraints |
|---|---|---|
supplier_id | UUID | PK |
name | VARCHAR(200) | NOT NULL |
contact_email | VARCHAR(255) | NOT NULL |
lead_time_days | INTEGER | NOT NULL |
rating | DECIMAL(3,2) | NULL |
active | BOOLEAN | NOT NULL, DEFAULT TRUE |
Indexes:
idx_supplier_activeonactive
stock_levels¶
Current stock quantities with reorder thresholds
| Column | Type | Constraints |
|---|---|---|
stock_id | UUID | PK |
item_type | VARCHAR(50) | NOT NULL |
location_id | UUID | NOT NULL |
quantity_on_hand | INTEGER | NOT NULL |
reorder_point | INTEGER | NOT NULL |
reorder_quantity | INTEGER | NOT NULL |
last_counted_at | TIMESTAMPTZ | NULL |
Indexes:
idx_stock_item_loconitem_type, location_id(UNIQUE)idx_stock_reorderonquantity_on_hand(WHERE quantity_on_hand <= reorder_point)
Endpoints (8 total)¶
POST /purchase-orders -- Create a new purchase order¶
Initiates a purchase order in DRAFT status. Items reference gear categories from svc-gear-inventory.
GET /purchase-orders/{po_id} -- Get purchase order details¶
PATCH /purchase-orders/{po_id} -- Update purchase order status or line items¶
Supports status transitions: DRAFT->SUBMITTED->APPROVED->SHIPPED->RECEIVED.
GET /suppliers -- List all suppliers¶
POST /suppliers -- Register a new supplier¶
GET /stock-levels -- Query current stock levels¶
Returns stock levels filtered by location and/or item category.
POST /stock-adjustments -- Record a stock adjustment¶
Used for manual corrections, damage write-offs, or receiving shipments outside PO flow.
GET /reorder-alerts -- Get active reorder alerts¶
Returns items that have fallen below their configured reorder point and need replenishment.
Consuming Applications¶
| Application | Screens Using This Service |
|---|---|
| Operations Dashboard | Inventory Management |