mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 23:58:44 +05:00
Change blocker type from bool to DynamicBlockers for APActions
This commit is contained in:
committed by
Dan Christian Bogos
parent
718f529ffa
commit
065ffcfbdf
@@ -2046,8 +2046,8 @@ type ActionProfileMdls []*ActionProfileMdl
|
||||
// CSVHeader return the header for csv fields as a slice of string
|
||||
func (apm ActionProfileMdls) CSVHeader() (result []string) {
|
||||
return []string{"#" + utils.Tenant, utils.ID, utils.FilterIDs,
|
||||
utils.Weight, utils.Schedule, utils.TargetType, utils.TargetIDs,
|
||||
utils.ActionID, utils.ActionFilterIDs, utils.ActionBlocker, utils.ActionTTL,
|
||||
utils.Weights, utils.BlockersField, utils.Schedule, utils.TargetType, utils.TargetIDs,
|
||||
utils.ActionID, utils.ActionFilterIDs, utils.ActionBlockers, utils.ActionTTL,
|
||||
utils.ActionType, utils.ActionOpts, utils.ActionPath, utils.ActionValue,
|
||||
}
|
||||
}
|
||||
@@ -2093,11 +2093,11 @@ func (apm ActionProfileMdls) AsTPActionProfile() (result []*utils.TPActionProfil
|
||||
if lacts := len(aPrf.Actions); lacts == 0 ||
|
||||
aPrf.Actions[lacts-1].ID != tp.ActionID {
|
||||
tpAAction = &utils.TPAPAction{
|
||||
ID: tp.ActionID,
|
||||
Blocker: tp.ActionBlocker,
|
||||
TTL: tp.ActionTTL,
|
||||
Type: tp.ActionType,
|
||||
Opts: tp.ActionOpts,
|
||||
ID: tp.ActionID,
|
||||
Blockers: tp.ActionBlockers,
|
||||
TTL: tp.ActionTTL,
|
||||
Type: tp.ActionType,
|
||||
Opts: tp.ActionOpts,
|
||||
Diktats: []*utils.TPAPDiktat{{
|
||||
Path: tp.ActionPath,
|
||||
Value: tp.ActionValue,
|
||||
@@ -2152,7 +2152,7 @@ func APItoModelTPActionProfile(tPrf *utils.TPActionProfile) (mdls ActionProfileM
|
||||
mdl.ActionID = action.ID
|
||||
mdl.ActionFilterIDs = strings.Join(action.FilterIDs, utils.InfieldSep)
|
||||
|
||||
mdl.ActionBlocker = action.Blocker
|
||||
mdl.ActionBlockers = action.Blockers
|
||||
mdl.ActionTTL = action.TTL
|
||||
mdl.ActionType = action.Type
|
||||
mdl.ActionOpts = action.Opts
|
||||
@@ -2210,10 +2210,14 @@ func APItoActionProfile(tpAp *utils.TPActionProfile, timezone string) (ap *Actio
|
||||
ap.Actions[i] = &APAction{
|
||||
ID: act.ID,
|
||||
FilterIDs: act.FilterIDs,
|
||||
Blocker: act.Blocker,
|
||||
Type: act.Type,
|
||||
Diktats: actDs,
|
||||
}
|
||||
if act.Blockers != utils.EmptyString {
|
||||
if ap.Actions[i].Blockers, err = utils.NewBlockersFromString(act.Blockers, utils.InfieldSep, utils.ANDSep); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if ap.Actions[i].TTL, err = utils.ParseDurationWithNanosecs(act.TTL); err != nil {
|
||||
return
|
||||
}
|
||||
@@ -2266,7 +2270,7 @@ func ActionProfileToAPI(ap *ActionProfile) (tpAp *utils.TPActionProfile) {
|
||||
tpAp.Actions[i] = &utils.TPAPAction{
|
||||
ID: act.ID,
|
||||
FilterIDs: act.FilterIDs,
|
||||
Blocker: act.Blocker,
|
||||
Blockers: act.Blockers.String(utils.InfieldSep, utils.ANDSep),
|
||||
TTL: act.TTL.String(),
|
||||
Type: act.Type,
|
||||
Diktats: actDs,
|
||||
|
||||
Reference in New Issue
Block a user