mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
Remove ActivationInterval from RateProfile
This commit is contained in:
committed by
Dan Christian Bogos
parent
ee19822625
commit
c3cd02f02b
@@ -899,16 +899,15 @@ type ArgCacheReplicateRemove struct {
|
||||
}
|
||||
|
||||
type TPRateProfile struct {
|
||||
TPid string
|
||||
Tenant string
|
||||
ID string
|
||||
FilterIDs []string
|
||||
ActivationInterval *TPActivationInterval
|
||||
Weights string
|
||||
MinCost float64
|
||||
MaxCost float64
|
||||
MaxCostStrategy string
|
||||
Rates map[string]*TPRate
|
||||
TPid string
|
||||
Tenant string
|
||||
ID string
|
||||
FilterIDs []string
|
||||
Weights string
|
||||
MinCost float64
|
||||
MaxCost float64
|
||||
MaxCostStrategy string
|
||||
Rates map[string]*TPRate
|
||||
}
|
||||
|
||||
type TPRate struct {
|
||||
|
||||
@@ -30,15 +30,14 @@ import (
|
||||
|
||||
// RateProfile represents the configuration of a Rate profile
|
||||
type RateProfile struct {
|
||||
Tenant string
|
||||
ID string
|
||||
FilterIDs []string
|
||||
ActivationInterval *ActivationInterval
|
||||
Weights DynamicWeights
|
||||
MinCost *Decimal
|
||||
MaxCost *Decimal
|
||||
MaxCostStrategy string
|
||||
Rates map[string]*Rate
|
||||
Tenant string
|
||||
ID string
|
||||
FilterIDs []string
|
||||
Weights DynamicWeights
|
||||
MinCost *Decimal
|
||||
MaxCost *Decimal
|
||||
MaxCostStrategy string
|
||||
Rates map[string]*Rate
|
||||
}
|
||||
|
||||
func (rp *RateProfile) TenantID() string {
|
||||
@@ -778,11 +777,10 @@ func CompressIntervals(rtIvls []*RateSInterval) {
|
||||
// AsRateProfile converts APIRateProfile to RateProfile
|
||||
func (ext *APIRateProfile) AsRateProfile() (rp *RateProfile, err error) {
|
||||
rp = &RateProfile{
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
ActivationInterval: ext.ActivationInterval,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
}
|
||||
if ext.Weights != EmptyString {
|
||||
if rp.Weights, err = NewDynamicWeightsFromString(ext.Weights, ";", "&"); err != nil {
|
||||
|
||||
@@ -1236,11 +1236,10 @@ func TestLibratesAsRateProfile(t *testing.T) {
|
||||
Weights: "testWeight",
|
||||
}
|
||||
rp := &RateProfile{
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
ActivationInterval: ext.ActivationInterval,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
}
|
||||
|
||||
received, err := ext.AsRateProfile()
|
||||
@@ -1308,11 +1307,10 @@ func TestLibratesAsRateProfileNon0Len(t *testing.T) {
|
||||
},
|
||||
}
|
||||
rp := &RateProfile{
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
ActivationInterval: ext.ActivationInterval,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
Tenant: ext.Tenant,
|
||||
ID: ext.ID,
|
||||
FilterIDs: ext.FilterIDs,
|
||||
MaxCostStrategy: ext.MaxCostStrategy,
|
||||
}
|
||||
|
||||
expected := rp
|
||||
|
||||
Reference in New Issue
Block a user