diff --git a/apps/carrier-connector/internal/analytics/market_service.go b/apps/carrier-connector/internal/analytics/market_service.go index 62b2968..894fa92 100644 --- a/apps/carrier-connector/internal/analytics/market_service.go +++ b/apps/carrier-connector/internal/analytics/market_service.go @@ -216,7 +216,7 @@ func (s *MarketAnalysisService) calculateDemographicMetrics(ctx context.Context, } // analyzeCompetitors analyzes competitive landscape -func (s *MarketAnalysisService) analyzeCompetitors(ctx context.Context, metrics *MarketMetrics) { +func (s *MarketAnalysisService) analyzeCompetitors(_ context.Context, metrics *MarketMetrics) { competitors := []struct { name string subs int64 @@ -272,7 +272,7 @@ func (s *MarketAnalysisService) analyzeCompetitors(ctx context.Context, metrics } // identifyOpportunities identifies market penetration opportunities -func (s *MarketAnalysisService) identifyOpportunities(ctx context.Context, metrics *MarketMetrics) { +func (s *MarketAnalysisService) identifyOpportunities(_ context.Context, metrics *MarketMetrics) { opportunities := []OpportunityMetrics{ { Country: "India", diff --git a/apps/carrier-connector/internal/infra/predictive_maintenance.go b/apps/carrier-connector/internal/infra/predictive_maintenance.go index a515800..665201f 100644 --- a/apps/carrier-connector/internal/infra/predictive_maintenance.go +++ b/apps/carrier-connector/internal/infra/predictive_maintenance.go @@ -187,7 +187,7 @@ func (s *PredictiveMaintenanceService) GetMaintenanceAlerts(ctx context.Context, } // PredictFailure predicts failure for an asset -func (s *PredictiveMaintenanceService) PredictFailure(ctx context.Context, assetID string) (*MaintenanceAlert, error) { +func (s *PredictiveMaintenanceService) PredictFailure(_ context.Context, assetID string) (*MaintenanceAlert, error) { s.mu.Lock() defer s.mu.Unlock() diff --git a/apps/carrier-connector/internal/pricing/types.go b/apps/carrier-connector/internal/pricing/types.go index 7569ec7..638f566 100644 --- a/apps/carrier-connector/internal/pricing/types.go +++ b/apps/carrier-connector/internal/pricing/types.go @@ -141,3 +141,45 @@ type DiscountStatistics struct { SmallestDiscount float64 `json:"smallest_discount"` TotalDiscountValue float64 `json:"total_discount_value"` } +type OptimizationResult struct { + RatePlanID string `json:"rate_plan_id"` + Strategy OptimizationStrategy `json:"strategy"` + CurrentPrice float64 `json:"current_price"` + OptimalPrice float64 `json:"optimal_price"` + PriceChange float64 `json:"price_change_pct"` + ExpectedRevenue float64 `json:"expected_revenue"` + ExpectedDemand int64 `json:"expected_demand"` + Confidence float64 `json:"confidence"` // 0-100 + Reasoning []string `json:"reasoning"` + Risks []string `json:"risks"` + Recommendations []string `json:"recommendations"` + GeneratedAt time.Time `json:"generated_at"` +} + +// PricingMetrics represents pricing performance metrics +type PricingMetrics struct { + Period string `json:"period"` + TotalRevenue float64 `json:"total_revenue"` + TotalSubscribers int64 `json:"total_subscribers"` + ARPU float64 `json:"arpu"` + ChurnRate float64 `json:"churn_rate_pct"` + PriceElasticity float64 `json:"price_elasticity"` + CompetitiveIndex float64 `json:"competitive_index"` + OptimizationROI float64 `json:"optimization_roi_pct"` + GeneratedAt time.Time `json:"generated_at"` +} +// RatePlan represents a rate plan (simplified) +type RatePlan struct { + ID string `gorm:"primaryKey"` + Name string `json:"name"` + BasePrice float64 `json:"base_price"` + Currency string `json:"currency"` +} + +// HistoricalDataPoint represents historical pricing and demand data +type HistoricalDataPoint struct { + Date time.Time `json:"date"` + Price float64 `json:"price"` + Demand int64 `json:"demand"` + Revenue float64 `json:"revenue"` +} diff --git a/apps/carrier-connector/internal/security/fraud_service.go b/apps/carrier-connector/internal/security/fraud_service.go index 877e45f..3ef6179 100644 --- a/apps/carrier-connector/internal/security/fraud_service.go +++ b/apps/carrier-connector/internal/security/fraud_service.go @@ -113,9 +113,10 @@ func (s *FraudDetectionService) GetFraudMetrics(_ context.Context, period string m.TotalAlerts++ m.ByType[a.Type]++ m.BySeverity[a.Severity]++ - if a.Status == "resolved" { + switch a.Status { + case "resolved": m.ResolvedAlerts++ - } else if a.Status == "false_positive" { + case "false_positive": m.FalsePositives++ } }