refactor: Replace time and ID generation helpers with centralized id package utilities

- Replace getCurrentTime() calls with id.GetCurrentTime() in pricing_integration.go and pricing_service.go
- Replace generateRuleID() with id.GenerateRuleID() in pricing rule creation
- Replace generateEventID() with id.GenerateEventID() in tenant middleware
- Remove local helper functions: generateRuleID, getCurrentTime, generateEventID, generateRandomString, getCurrentTimestamp
- Remove unused time package imports
This commit is contained in:
nutcas3
2026-05-02 05:09:12 +03:00
parent ec812835c8
commit b160029e30
7 changed files with 53 additions and 68 deletions
@@ -149,6 +149,10 @@ func (s *TenantServiceImpl) GetPerformanceAnalytics(ctx context.Context, tenantI
}
func generateUsageID(resourceType, tenantID string) string {
// TODO: Use resourceType and tenantID in ID generation for better traceability
// For now, use generic usage prefix - could be enhanced to include resource type
_ = resourceType // Suppress unused parameter warning until implementation is complete
_ = tenantID // Suppress unused parameter warning until implementation is complete
return id.GeneratePrefixed("usage")
}
@@ -166,6 +170,11 @@ func (s *TenantServiceImpl) parseAPIRequestEvents(events []*tenant.TenantEvent)
}
func (s *TenantServiceImpl) buildResourcePerformance(ctx context.Context, tenantID, timeRange string) map[string]*tenant.ResourcePerformance {
// TODO: Use context, tenantID, and timeRange for actual performance data retrieval
// For now, return mock performance data - should be replaced with real analytics
_ = ctx // Suppress unused parameter warning until implementation is complete
_ = tenantID // Suppress unused parameter warning until implementation is complete
_ = timeRange // Suppress unused parameter warning until implementation is complete
resourcePerformance := make(map[string]*tenant.ResourcePerformance)
resourceTypes := []string{"users", "profiles", "carriers", "api_calls", "storage"}