mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Rename file and methods
This commit is contained in:
committed by
Dan Christian Bogos
parent
d555a52ad1
commit
ace5ff9fda
@@ -28,7 +28,7 @@ func (apierV1 *ApierV2) SetExternalAttributeProfile(extAlsPrf *engine.ExternalAt
|
||||
if missing := utils.MissingStructFields(extAlsPrf, []string{"Tenant", "ID"}); len(missing) != 0 {
|
||||
return utils.NewErrMandatoryIeMissing(missing...)
|
||||
}
|
||||
alsPrf, err := extAlsPrf.ConvertExtToAttrPrf()
|
||||
alsPrf, err := extAlsPrf.AsAttributeProfile()
|
||||
if err != nil {
|
||||
return utils.APIErrorHandler(err)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ type ExternalAttributeProfile struct {
|
||||
Weight float64
|
||||
}
|
||||
|
||||
func (ext *ExternalAttributeProfile) ConvertExtToAttrPrf() (attr *AttributeProfile, err error) {
|
||||
func (ext *ExternalAttributeProfile) AsAttributeProfile() (attr *AttributeProfile, err error) {
|
||||
attr = new(AttributeProfile)
|
||||
if len(ext.Attributes) == 0 {
|
||||
return nil, utils.NewErrMandatoryIeMissing("Attributes")
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestConvertExternalToProfile(t *testing.T) {
|
||||
Weight: 20,
|
||||
}
|
||||
|
||||
rcv, err := external.ConvertExtToAttrPrf()
|
||||
rcv, err := external.AsAttributeProfile()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func TestConvertExternalToProfileMissing(t *testing.T) {
|
||||
Weight: 20,
|
||||
}
|
||||
|
||||
_, err := external.ConvertExtToAttrPrf()
|
||||
_, err := external.AsAttributeProfile()
|
||||
if err == nil || err.Error() != "MANDATORY_IE_MISSING: [Attributes]" {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -114,7 +114,7 @@ func TestConvertExternalToProfileMissing2(t *testing.T) {
|
||||
Weight: 20,
|
||||
}
|
||||
|
||||
_, err := external.ConvertExtToAttrPrf()
|
||||
_, err := external.AsAttributeProfile()
|
||||
if err == nil || err.Error() != "MANDATORY_IE_MISSING: [Substitute]" {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ func (rpf *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error
|
||||
for _, p := range utils.SplitPrefix(cd.Destination, MIN_PREFIX_MATCH) {
|
||||
if destIDs, err := dm.DataDB().GetReverseDestination(p, false, utils.NonTransactional); err == nil {
|
||||
var bestWeight *float64
|
||||
var timeChecker bool
|
||||
for _, dID := range destIDs {
|
||||
var timeChecker bool
|
||||
if _, ok := rpl.DestinationRates[dID]; ok {
|
||||
ril := rpl.RateIntervalList(dID)
|
||||
//check if RateInverval is active for call descriptor time
|
||||
|
||||
Reference in New Issue
Block a user