Skip to content

Werkstatt & Asset Management Module

Enterprise-grade asset and storage unit tracking with checkout/return capability.

Overview

The Werkstatt & Asset Management module provides comprehensive tracking of assets (tools, machines, devices, parts) and their storage locations. Based on concepts from Tool Pro, adapted for Lager Guru's multi-tenant architecture.

Features

  • Asset Management: Track tools, machines, devices, and parts with full lifecycle management
  • Storage Unit Management: Organize assets in drawers, cabinets, shelves, lockers, etc.
  • Checkout/Return System: Track asset usage with user attribution and timestamps
  • QR/Barcode Scanning: Fast asset lookup via QR codes or barcodes
  • Usage History: Complete audit trail of asset usage
  • Condition Tracking: Monitor asset condition states (new, used, needs_repair, etc.)
  • Maintenance Integration: Link assets to maintenance module equipment
  • Safety Integration: Connect with incidents and training requirements
  • Configurable Entities: Fully customizable asset types, storage unit types, and conditions

Permissions

  • Admin: Full access to all Werkstatt features
  • Werkstatt Manager: Can manage assets, storage units, and view reports
  • Tool Admin: Can manage assets and storage units
  • Regular Worker: Limited access - can checkout/return assets, view own usage history

Database Schema

Configuration Tables

  • asset_types: Configurable asset categories (e.g., tools, machines, devices, parts)
  • storage_unit_types: Configurable storage types (e.g., drawer, cabinet, shelf, locker)
  • asset_conditions: Configurable condition states (e.g., new, used, needs_repair)

Core Tables

  • assets: Trackable assets with checkout/return capability
  • storage_units: Physical storage locations for assets
  • asset_usage_logs: History of asset checkout and return operations
  • asset_maintenance_links: Links assets to maintenance module equipment

Key Functions

  • getAssets(filters): Get assets with optional filters
  • getStorageUnits(): Get all storage units
  • startAssetUsage(assetId, options): Check out an asset
  • endAssetUsage(usageLogId): Return an asset
  • getActiveUsageLogs(): Get all currently checked out assets
  • getAssetUsageHistory(assetId): Get usage history for an asset
  • linkAssetToEquipment(assetId, equipmentId): Link asset to maintenance equipment

Integration

  • Maintenance Module: Assets can be linked to equipment for integrated maintenance tracking
  • Safety Module: Assets can be associated with incidents and training requirements
  • Equipment Tracking: QR/barcode scanning integrates with equipment tracking system

Configuration

All entity types are configurable per tenant:

  1. Asset Types: Define categories (e.g., "Power Tools", "Hand Tools", "Machines")
  2. Storage Unit Types: Define storage types (e.g., "Drawer", "Cabinet", "Shelf")
  3. Asset Conditions: Define condition states (e.g., "New", "Good", "Needs Repair")

Workflow Example

  1. Admin creates asset types, storage unit types, and conditions
  2. Admin creates storage units (e.g., "Tool Drawer A1")
  3. Admin creates assets and assigns them to storage units
  4. Worker scans QR code or searches for asset
  5. Worker checks out asset with optional user name and reason
  6. System tracks usage with timestamps
  7. Worker returns asset when done
  8. System maintains complete usage history

Migration from Tool Pro

Key differences from Tool Pro:

  • Multi-tenant: All tables include tenant_id for isolation
  • Configurable: No hardcoded types (knife/material → asset_types, drawer → storage_unit_types)
  • Integrated: Links to existing Lager Guru modules (maintenance, safety)
  • RLS Protected: Row-level security policies enforce tenant isolation

API Usage

typescript
import { 
  getAssets, 
  startAssetUsage, 
  endAssetUsage 
} from '@/lib/werkstatt';

// Get all assets
const assets = await getAssets();

// Check out an asset
const usage = await startAssetUsage(assetId, {
  user_name: "John Doe",
  usage_reason: "Production line maintenance",
  notes: "Will return by end of shift"
});

// Return an asset
await endAssetUsage(usage.id);

Released under Commercial License