Overview
jshERP implements a robust multi-tenant architecture that allows multiple organizations to use the same system while maintaining complete data isolation. Each tenant operates independently with its own users, data, and configurations.The tenant system is fundamental to jshERP’s architecture. All users must be associated with a tenant, and data is automatically filtered by tenant ID.
Tenant Types
jshERP supports two types of tenants:| Type | Description | Features |
|---|---|---|
| 0 - Free Tenant | Basic tier for trial or small businesses | Limited user count, basic features |
| 1 - Paid Tenant | Premium tier for full access | Extended user limits, all features |
Creating a New Tenant
Configure Tenant Details
Fill in the required information:
Primary administrator login name for this tenant
Maximum number of users allowed for this tenant
Tenant type: “0” for free, “1” for paid
Subscription expiration date (for paid tenants)
Whether the tenant is active (default: true)
Additional notes about this tenant
API Endpoints
The tenant management system exposes the following REST API endpoints:Get Tenant Information
TenantController.java:36-48
List All Tenants
loginName: Filter by admin login nametype: Filter by tenant type (0 or 1)enabled: Filter by enabled statusremark: Search in remarks
TenantController.java:50-60
Create Tenant
TenantController.java:62-68
Update Tenant
TenantController.java:70-76
Delete Tenant
TenantController.java:78-92
Batch Operations
Enable/Disable Multiple Tenants
TenantController.java:114-127
Tenant Expiration Management
For paid tenants, jshERP automatically checks the expiration date during login:Auto-Logout
If the tenant has expired, the user session is automatically terminated and they cannot access the system.
UserController.java:571-575
User Limit Enforcement
Tenants cannot exceed their configured user limit:UserController.java:320-325
Data Model
The Tenant entity structure:Primary key (auto-generated)
Unique tenant identifier used throughout the system
Primary administrator’s login name
Maximum allowed users
Tenant type: “0” (free) or “1” (paid)
Active status
Tenant creation timestamp
Subscription expiration date
Additional notes
Soft delete marker
Tenant.java:1-105
Best Practices
Multi-Tenant Data Isolation:Every database query in jshERP automatically filters by
tenantId to ensure complete data separation. This is handled at the service layer and requires no additional configuration.Validation
Check Name Uniqueness
TenantController.java:94-106
Monitoring and Reporting
Administrators can monitor tenant usage through:- User Count Tracking: View current vs. limit for each tenant
- Expiration Monitoring: Track upcoming tenant expirations
- Activity Status: Monitor enabled/disabled tenant states
- Type Distribution: Analyze free vs. paid tenant ratios
For detailed user management within each tenant, see User Management.