Update RateProfile to use map[string]*Rate instead of slice

This commit is contained in:
TeoV
2020-06-15 16:03:32 +03:00
committed by Dan Christian Bogos
parent 72a521a66d
commit 21773a185d
23 changed files with 225 additions and 197 deletions

View File

@@ -83,8 +83,8 @@ type TPDestination struct {
}
// This file deals with tp_* data definition
type TPRate struct {
// TPRateRALs -> TPRateRALs
type TPRateRALs struct {
TPid string // Tariff plan id
ID string // Rate id
RateSlots []*RateSlot // One or more RateSlots
@@ -150,7 +150,7 @@ type TPDestinationRate struct {
type DestinationRate struct {
DestinationId string // The destination identity
RateId string // The rate identity
Rate *TPRate
Rate *TPRateRALs
RoundingMethod string
RoundingDecimals int
MaxCost float64
@@ -1436,3 +1436,31 @@ type AttrsExecuteActionPlans struct {
*ArgDispatcher
TenantArg
}
type TPRateProfile struct {
TPid string
Tenant string
ID string
FilterIDs []string
ActivationInterval *TPActivationInterval
Weight float64
ConnectFee float64
RoundingMethod string
RoundingDecimals int
MinCost float64
MaxCost float64
MaxCostStrategy string
Rates map[string]*TPRate
}
type TPRate struct {
ID string // RateID
FilterIDs []string // RateFilterIDs
ActivationInterval *TPActivationInterval //TPActivationInterval have ATime and ETime as strings
IntervalStart string
Weight float64 // RateWeight will decide the winner per interval start
Value float64 // RateValue
Unit string
Increment string
Blocker bool // RateBlocker will make this rate recurrent, deactivating further intervals
}