mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-22 11:58:48 +00:00
- Mark unused model parameter with underscore in generateMaintenanceRecommendations - Mark unused context and period parameters with underscore in calculateCompetitiveIndex - Mark unused context parameter with underscore in calculateOptimizationROI - Mark unused data parameter with underscore in generateAnalysis - Mark unused ratePlan and data parameters with underscore in optimizeForCompetitive - Mark unused
28 lines
582 B
Go
28 lines
582 B
Go
package pricing
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// getPeriodStart returns start date for period
|
|
func (s *PricingOptimizationService) getPeriodStart(period string) time.Time {
|
|
now := time.Now()
|
|
switch period {
|
|
case "daily":
|
|
return now.Truncate(24 * time.Hour)
|
|
case "weekly":
|
|
return now.AddDate(0, 0, -7)
|
|
case "monthly":
|
|
return now.AddDate(0, -1, 0)
|
|
case "quarterly":
|
|
return now.AddDate(0, -3, 0)
|
|
default:
|
|
return now.AddDate(0, -1, 0)
|
|
}
|
|
}
|
|
|
|
// getPeriodEnd returns end date for period
|
|
func (s *PricingOptimizationService) getPeriodEnd(_ string) time.Time {
|
|
return time.Now()
|
|
}
|