Skip to main content

Warehouse Service

The Warehouse service manages inventory, stock levels, storage locations, and stock transfers. It provides real-time stock data to the Webshop and handles physical warehouse operations.

Architecture

  Webshop Service ──┐
Tenant Frontend ──┤──▶ Warehouse Backend (Laravel 12)
CRM Service ──────┘ │
├──▶ PostgreSQL (warehouse schema)
├──▶ Redis (cache)
└──▶ RabbitMQ (stock events)

Key Features

Inventory Management

  • Real-time stock levels per product and variant
  • Multi-location warehouse support
  • Safety stock thresholds and alerts
  • Batch and serial number tracking

Stock Operations

  • Receiving — Inbound stock from suppliers
  • Transfers — Move stock between locations
  • Adjustments — Manual stock corrections with reason codes
  • Reservations — Hold stock for pending orders

Integration with Webshop

  • Automatic stock reservation on order creation
  • Stock release on order cancellation
  • Real-time availability check for product pages

API Endpoints

Base URL: https://{tenant}.vecton.hu/api/warehouse (production) | http://localhost:8011/api (dev)

MethodEndpointDescription
GET/stockList stock levels (filterable by product, location)
GET/stock/{productId}Get stock for specific product
POST/stock/receiveRecord inbound stock
POST/stock/transferTransfer between locations
POST/stock/adjustManual stock adjustment
POST/stock/reserveReserve stock for an order
POST/stock/releaseRelease reserved stock
GET/locationsList warehouse locations
POST/locationsCreate warehouse location
GET/movementsStock movement history

Events

EventTriggerConsumers
stock.receivedNew stock receivedAnalytics, Webhook
stock.transferredStock moved between locationsAnalytics
stock.adjustedManual adjustmentAnalytics, Webhook
stock.lowStock below safety thresholdCRM (alerts), Webhook
stock.reservedStock reserved for orderAnalytics

Database Schema

TableDescription
stock_itemsCurrent stock levels per product/location
stock_movementsHistory of all stock changes
locationsWarehouse locations
reservationsActive stock reservations
suppliersSupplier information
receiving_ordersInbound receiving records

Configuration

VariableDescriptionDefault
APP_URLService base URLhttp://localhost:8011
DB_SCHEMADatabase schemawarehouse
LOW_STOCK_THRESHOLDDefault safety stock level10

Development

cd tenant/tenant-backend-warehouse
composer install
php artisan migrate --seed
php artisan serve --port=8011