feat: Refactor rate plan currency integrator to simplify subscription creation and remove unused helper

- Simplify SubscribeToPlanWithCurrency by creating SubscribeRequest directly instead of intermediate RatePlanSubscription struct
- Remove redundant Status, StartedAt, CreatedAt, and UpdatedAt field assignments
- Mark unused context parameters with underscore in calculateOverageCost and generateReason
- Remove unused getHighestPriorityCarrier helper function from selection_algorithm.go
This commit is contained in:
nutcas3
2026-05-03 11:52:33 +03:00
parent 27e4594a35
commit b76a9a33ce
3 changed files with 5 additions and 31 deletions
@@ -181,19 +181,3 @@ func (sa *SelectionAlgorithm) PredictPerformance(carrierID string, criteria *Sel
func (sa *SelectionAlgorithm) GetCarrierPerformance(carrierID string) *PerformanceMetrics {
return sa.mlModel.GetCarrierPerformance(carrierID)
}
// getHighestPriorityCarrier returns the carrier with the highest priority
func (sa *SelectionAlgorithm) getHighestPriorityCarrier(carriers []*Carrier) *Carrier {
if len(carriers) == 0 {
return nil
}
highestPriority := carriers[0]
for _, carrier := range carriers {
if carrier.Priority > highestPriority.Priority {
highestPriority = carrier
}
}
return highestPriority
}