Skip to content

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

svc-inventory-procurement C4 context diagram

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_supplier on supplier_id
  • idx_po_status on status

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_active on active

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_loc on item_type, location_id (UNIQUE)
  • idx_stock_reorder on quantity_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.

View in Swagger UI

POST /purchase-orders sequence diagram

GET /purchase-orders/{po_id} -- Get purchase order details

View in Swagger UI

GET /purchase-orders/{po_id} sequence diagram

PATCH /purchase-orders/{po_id} -- Update purchase order status or line items

Supports status transitions: DRAFT->SUBMITTED->APPROVED->SHIPPED->RECEIVED.

View in Swagger UI

PATCH /purchase-orders/{po_id} sequence diagram

GET /suppliers -- List all suppliers

View in Swagger UI

GET /suppliers sequence diagram

POST /suppliers -- Register a new supplier

View in Swagger UI

POST /suppliers sequence diagram

GET /stock-levels -- Query current stock levels

Returns stock levels filtered by location and/or item category.

View in Swagger UI

GET /stock-levels sequence diagram

POST /stock-adjustments -- Record a stock adjustment

Used for manual corrections, damage write-offs, or receiving shipments outside PO flow.

View in Swagger UI

POST /stock-adjustments sequence diagram

GET /reorder-alerts -- Get active reorder alerts

Returns items that have fallen below their configured reorder point and need replenishment.

View in Swagger UI

GET /reorder-alerts sequence diagram

Consuming Applications

Application Screens Using This Service
Operations Dashboard Inventory Management