mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-23 20:38:48 +00:00
feat: Implement carrier weight updates, pricing analytics calculations, and tenant rate limiting
- Add updateCarrierWeights implementation with regional and plan-based weight adjustments in carrier_methods.go - Add calculateRegionalWeightAdjustment helper with usage-based weight scaling and clamping - Add calculatePlanWeightAdjustment helper with plan usage analysis and adjustment limits - Add calculateConversionRate helper in pricing_integration.go using discount statistics and active rule ratios
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/id"
|
||||
"github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/tenant"
|
||||
)
|
||||
|
||||
@@ -148,14 +147,6 @@ func (s *TenantServiceImpl) GetPerformanceAnalytics(ctx context.Context, tenantI
|
||||
return analytics, nil
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
func (s *TenantServiceImpl) parseAPIRequestEvents(events []*tenant.TenantEvent) []*tenant.APIRequestEvent {
|
||||
apiRequests := make([]*tenant.APIRequestEvent, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user