Skip to main content

Inventory

Entities Definition

This file defines the inventory structure within the Roll Claw domain model.

Implementation

Inventory Definition

File: domain/entities/inventory.pseudo

// Inventory Entities

class InventoryItem {
// Identity
string id
string name

// Properties
string category // "food", "litter", "medicine", "equipment", etc.
int currentQuantity
int minimumThreshold
int recommendedOrderQuantity
Date lastOrderDate
Date lastRestockDate

// Methods
function isLow() { return currentQuantity < minimumThreshold }
function useQuantity(int amount, Date date)
function restockQuantity(int amount, Date date)
function orderMore(int quantity, Date date)
function getDaysToDepletion(float dailyUsage)
}

class SupplyOrder {
// Identity
string id

// Properties
List<InventoryItem> items
Date orderDate
Date expectedDeliveryDate
boolean isReceived
Date receivedDate
string supplier
float cost

// Methods
function markReceived(Date date)
function updateInventory()
function isOverdue()
}
  • See the Domain Model Overview for more information on how this component fits into the overall domain model.