Skip to main content

WarehouseDTO

Represents a warehouse distribution center with geographic location and available product inventory. Warehouses serve as the source of stock for fulfilling store demand.

Fields

id
string
required
Unique identifier for the warehouse
latitude
double
required
Geographic latitude coordinate of the warehouse location
longitude
double
required
Geographic longitude coordinate of the warehouse location
country
string
required
ISO country code where the warehouse is located (e.g., “US”, “CA”, “UK”)
stock
ProductItemDTO[]
required
List of product items with available quantities in the warehouse inventory

Example

{
  "id": "WH-001",
  "latitude": 40.7580,
  "longitude": -73.9855,
  "country": "US",
  "stock": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440000",
      "productId": "PROD-001",
      "size": "S",
      "quantity": 500
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "productId": "PROD-001",
      "size": "M",
      "quantity": 750
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440002",
      "productId": "PROD-001",
      "size": "L",
      "quantity": 600
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440003",
      "productId": "PROD-002",
      "size": "M",
      "quantity": 400
    }
  ]
}

Business Logic

Geographic Distribution
  • Warehouses are strategically positioned to minimize shipping distances
  • Location coordinates are used to calculate distance to stores
  • Same-country distribution is typically preferred for efficiency
Inventory Management
  • Stock levels are updated as assignments are created
  • Each product item tracks quantity by product ID and size
  • Zero-quantity items may be filtered from responses
Fulfillment Priority
  • Distribution algorithm considers:
    • Distance from warehouse to store
    • Available stock quantities
    • Store capacity constraints
    • Cross-border shipping preferences

Build docs developers (and LLMs) love