mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
added balance tag for action triggers
also chenged the names of direction and destination params (prefixxed with balance)
This commit is contained in:
@@ -607,24 +607,25 @@ func (self *SQLStorage) SetTPActionTriggers(tpid string, ats map[string][]*utils
|
||||
}
|
||||
for _, at := range aTriggers {
|
||||
saved := tx.Save(TpActionTrigger{
|
||||
Tpid: tpid,
|
||||
Tag: atId,
|
||||
BalanceType: at.BalanceType,
|
||||
Direction: at.Direction,
|
||||
ThresholdType: at.ThresholdType,
|
||||
ThresholdValue: at.ThresholdValue,
|
||||
Recurrent: at.Recurrent,
|
||||
MinSleep: int64(at.MinSleep),
|
||||
DestinationTag: at.DestinationId,
|
||||
BalanceWeight: at.BalanceWeight,
|
||||
BalanceExpiryTime: at.BalanceExpirationDate,
|
||||
BalanceRatingSubject: at.BalanceRatingSubject,
|
||||
BalanceCategory: at.BalanceCategory,
|
||||
BalanceSharedGroup: at.BalanceSharedGroup,
|
||||
MinQueuedItems: at.MinQueuedItems,
|
||||
ActionsTag: at.ActionsId,
|
||||
Weight: at.Weight,
|
||||
CreatedAt: time.Now(),
|
||||
Tpid: tpid,
|
||||
Tag: atId,
|
||||
ThresholdType: at.ThresholdType,
|
||||
ThresholdValue: at.ThresholdValue,
|
||||
Recurrent: at.Recurrent,
|
||||
MinSleep: int64(at.MinSleep),
|
||||
BalanceId: at.BalanceId,
|
||||
BalanceType: at.BalanceType,
|
||||
BalanceDirection: at.BalanceDirection,
|
||||
BalanceDestinationTag: at.BalanceDestinationId,
|
||||
BalanceWeight: at.BalanceWeight,
|
||||
BalanceExpiryTime: at.BalanceExpirationDate,
|
||||
BalanceRatingSubject: at.BalanceRatingSubject,
|
||||
BalanceCategory: at.BalanceCategory,
|
||||
BalanceSharedGroup: at.BalanceSharedGroup,
|
||||
MinQueuedItems: at.MinQueuedItems,
|
||||
ActionsTag: at.ActionsId,
|
||||
Weight: at.Weight,
|
||||
CreatedAt: time.Now(),
|
||||
})
|
||||
if saved.Error != nil {
|
||||
tx.Rollback()
|
||||
@@ -1420,13 +1421,14 @@ func (self *SQLStorage) GetTpActionTriggers(tpid, tag string) (map[string][]*uti
|
||||
}
|
||||
for _, tpAt := range tpActionTriggers {
|
||||
at := &utils.TPActionTrigger{
|
||||
BalanceType: tpAt.BalanceType,
|
||||
Direction: tpAt.Direction,
|
||||
ThresholdType: tpAt.ThresholdType,
|
||||
ThresholdValue: tpAt.ThresholdValue,
|
||||
Recurrent: tpAt.Recurrent,
|
||||
MinSleep: time.Duration(tpAt.MinSleep),
|
||||
DestinationId: tpAt.DestinationTag,
|
||||
BalanceId: tpAt.BalanceId,
|
||||
BalanceType: tpAt.BalanceType,
|
||||
BalanceDirection: tpAt.BalanceDirection,
|
||||
BalanceDestinationId: tpAt.BalanceDestinationTag,
|
||||
BalanceWeight: tpAt.BalanceWeight,
|
||||
BalanceExpirationDate: tpAt.BalanceExpiryTime,
|
||||
BalanceRatingSubject: tpAt.BalanceRatingSubject,
|
||||
|
||||
Reference in New Issue
Block a user