Core App
The core app provides foundational infrastructure used by all other apps in the Maybern backend. It includes base models, custom field types, API utilities, and common services.Base Models
All models in Maybern inherit from one of these base classes:| Model | Description |
|---|---|
TimeStampedModel | Adds created_at and updated_at fields |
CustomerTimeStampedModel | Adds customer_id for multi-tenancy |
AuditableModel | Enables audit logging for changes |
VersionModel | For type-2 versioned entities |
Custom Field Types
All ORM fields are wrapped inserver.apps.core.models.fields for additional functionality:
MUUIDField- UUID with prefix (e.g.,INVS_abc123)TextModelField- Text with validationForeignKeyModelField- FK with sensible defaultsDecimalModelField- Decimal with precisionDateModelField- Date fieldBooleanModelField- Boolean field
Field Decorators
API Utilities
Request Context
TheRequestCtx dataclass contains request-scoped information:
API Decorators
Core Services
Cache Service
Distributed caching using Redis:Evaluate Expression Service
Execute dynamic calculations:I18n Service
Internationalization support:Generate MUUID Service
Create prefixed UUIDs:Rounding Service
Consistent rounding strategies:Managers and QuerySets
Custom managers wrap Django ORM functionality:BaseTimeStampedModelManager- Core querying logicTimeStampedModelManager- For non-tenant modelsCustomerTimeStampedModelManager- Adds customer filteringVersionableModelManager- For versioned models