Rename file and methods

This commit is contained in:
TeoV
2019-03-18 11:41:49 +02:00
committed by Dan Christian Bogos
parent d555a52ad1
commit ace5ff9fda
5 changed files with 6 additions and 6 deletions

View File

@@ -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)
}

View File

@@ -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")

View File

@@ -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)
}

View File

@@ -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