mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-16 08:55:13 +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:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/id"
|
||||
"github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/tenant"
|
||||
)
|
||||
|
||||
@@ -40,7 +41,7 @@ func (s *TenantServiceImpl) buildQuotaStatus(usageStats *tenant.TenantUsageStats
|
||||
if err != nil {
|
||||
// Create empty usage if not found
|
||||
usage = &tenant.TenantUsage{
|
||||
ID: generateUsageID(resourceType, usageStats.TenantID),
|
||||
ID: id.GenerateUsageID(resourceType, usageStats.TenantID),
|
||||
TenantID: usageStats.TenantID,
|
||||
ResourceType: resourceType,
|
||||
ResourceCount: 0,
|
||||
|
||||
Reference in New Issue
Block a user