Usage & Metrics Data Model
Usage & Metrics track the consumption of resources by Customers, enabling usage-based billing and analytics.
Entity Relationship Diagram
Core Entities
Usage Journal (com.sureink.usage.model.UsageJournal)
The central ledger for all consumption events.
- Key Fields:
customerCode: The entity responsible for the usage.subscriptionId: The entitlement that covers this usage.projectId: The specific project context (optional).productCode: The resource being consumed.value: The amount consumed.unit: The unit of measure (e.g., GB, Users).dateStart/dateEnd: The period covered by this record.usageType: The category of usage (e.g., Overage, Base).
Relationships
Usage -> Subscription
- Type: Many-to-One
- Description: Usage is typically aggregated and billed against a specific Subscription.
Usage -> Project
- Type: Many-to-One
- Description: Usage can be tagged to a Project for granular reporting and chargebacks.