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 Live Service (Dev) Azure Portal CI/CD Pipeline Source Code Technology Stack
Delivery Status¶
Delivery Wave: 6 -- External Integrations
| Stage | Status |
|---|---|
| Infrastructure (Bicep) | |
| Database Schema (Flyway) | |
| Deployed to Dev | |
| Smoke Tested | |
| Deployed to Prod | not-started |
| Pipeline | Status |
|---|---|
| CI Pipeline | |
| CD Pipeline |
Azure Resources (Dev):
Integration Context¶
Generated from architecture/specs/svc-inventory-procurement.yaml + cross-service-calls.yaml
Data Store¶
Entity Relationship Diagram¶
Generated from architecture/metadata/data-stores.yaml
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.
Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-inventory-procurement--post-purchase-orders.puml
GET /purchase-orders/{po_id} -- Get purchase order details¶
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
PATCH /purchase-orders/{po_id} -- Update purchase order status or line items¶
Supports status transitions: DRAFT->SUBMITTED->APPROVED->SHIPPED->RECEIVED.
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
GET /suppliers -- List all suppliers¶
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
POST /suppliers -- Register a new supplier¶
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
GET /stock-levels -- Query current stock levels¶
Returns stock levels filtered by location and/or item category.
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
POST /stock-adjustments -- Record a stock adjustment¶
Used for manual corrections, damage write-offs, or receiving shipments outside PO flow.
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
GET /reorder-alerts -- Get active reorder alerts¶
Returns items that have fallen below their configured reorder point and need replenishment.
Generated from architecture/specs/svc-inventory-procurement.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.
Consuming Applications¶
| Application | Screens Using This Service |
|---|---|
| Operations Dashboard | Inventory Management |