Skip to content

Tenant Editions Management

Admin guide for managing tenant editions in Lager Guru.

Overview

Super-admins can assign and manage editions for all tenants. Editions control which modules and features are available to each tenant.

Accessing Tenant Editions

  1. Login as super-admin
  2. Navigate to /admin → Tenant Editions
  3. View all tenants and their current editions

Assigning Editions

Via UI

  1. Open Tenant Editions page
  2. Find tenant in the list
  3. Select edition from dropdown:
    • FREE: Basic features
    • PRO: Advanced features (no AI)
    • ENTERPRISE: All features including AI
  4. Edition updates immediately

Via Database (Service Role)

sql
-- Assign PRO edition to tenant
INSERT INTO tenant_editions (tenant_id, edition_id, assigned_by)
SELECT 
  'tenant-uuid-here',
  e.id,
  'admin-user-uuid'
FROM editions e
WHERE e.name = 'pro'
ON CONFLICT (tenant_id) 
DO UPDATE SET 
  edition_id = EXCLUDED.edition_id,
  assigned_by = EXCLUDED.assigned_by,
  assigned_at = now();

Edition Matrix

FREE Edition

Available Modules:

  • Dashboard
  • Shipments
  • Drivers
  • Basic Settings

Limits:

  • 10 pick lists
  • 5 zones
  • 3 workers
  • 5 drivers

PRO Edition

Available Modules:

  • All FREE modules
  • Inventory Management
  • Pick & Pack
  • Maintenance
  • Safety & Compliance
  • Equipment Tracking
  • Auto Assignment
  • Routing Engine

Limits:

  • 100 pick lists
  • 50 zones
  • 20 workers
  • 30 drivers

ENTERPRISE Edition

Available Modules:

  • All PRO modules
  • Floor Plan Visualization
  • Slotting AI

Limits:

  • Unlimited

Module Access Control

How It Works

  1. Tenant edition is checked on:

    • UI component render
    • API endpoint access
    • Route navigation
  2. If module not available:

    • UI: Shows upgrade message
    • API: Returns 403 with MODULE_DISABLED error
    • Route: Shows "Module unavailable" page

Module Names

  • inventory - Inventory Management
  • pickpack - Pick & Pack
  • floorplan - Floor Plan Visualization
  • slottingAI - Slotting AI
  • maintenance - Maintenance Module
  • safety - Safety & Compliance
  • equipmentTracking - Equipment Tracking
  • autoAssignment - Auto Assignment Engine
  • routing - Routing Engine
  • systemSettings - System Settings

Audit Logging

All edition changes are logged to audit_log table:

  • Table: tenant_editions
  • Action: UPDATE
  • Details: Includes edition_id and assigned_by

Best Practices

  1. Default to FREE: New tenants start with FREE edition
  2. Upgrade Gradually: Start with FREE, upgrade as needed
  3. Monitor Usage: Check if tenants are hitting limits
  4. Document Changes: Note why edition was changed
  5. Test Before Upgrade: Verify features work after upgrade

Troubleshooting

Tenant Can't Access Module

  1. Check tenant's edition:

    sql
    SELECT e.name
    FROM tenant_editions te
    JOIN editions e ON e.id = te.edition_id
    WHERE te.tenant_id = 'tenant-uuid';
  2. Verify module is included in edition

  3. Check if module name is correct

  4. Clear browser cache if UI issue

Edition Not Updating

  1. Verify super-admin permissions
  2. Check RLS policies allow update
  3. Verify edition_id exists in editions table
  4. Check audit log for errors

Limits Not Enforcing

  1. Verify limit checking code is in place
  2. Check getEditionLimits() returns correct values
  3. Ensure checkLimit() is called before operations

Публикувано под търговска лицензия