diff --git a/data/conf/samples/ees/cgrates.json b/data/conf/samples/ees/cgrates.json index 9d706241b..8881c970f 100644 --- a/data/conf/samples/ees/cgrates.json +++ b/data/conf/samples/ees/cgrates.json @@ -114,8 +114,8 @@ {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, - {"tag": "RatingPlan", "path": "*exp.RatingPlan", "type": "*variable", "value": "~*ec.EventCost.Charges[0].Rating.RatingFilter.RatingPlanID"}, - {"tag": "RatingPlanSubject", "path": "*exp.RatingPlanSubject", "type": "*variable", "value": "~*ec.EventCost.Charges[0].Rating.RatingFilter.Subject"}, + {"tag": "RatingPlan", "path": "*exp.RatingPlan", "type": "*variable", "value": "~*ec.CostDetails.Charges[0].Rating.RatingFilter.RatingPlanID"}, + {"tag": "RatingPlanSubject", "path": "*exp.RatingPlanSubject", "type": "*variable", "value": "~*ec.CostDetails.Charges[0].Rating.RatingFilter.Subject"}, {"tag": "NumberOfEvents", "path": "*trl.NumberOfEvents", "type": "*variable", "value": "~*dc.NumberOfEvents"}, {"tag": "TotalDuration", "path": "*trl.TotalDuration", "type": "*variable", "value": "~*dc.TotalDuration"}, diff --git a/ees/ees.go b/ees/ees.go index 50c6346a9..956093738 100644 --- a/ees/ees.go +++ b/ees/ees.go @@ -270,7 +270,7 @@ func exportEventWithExporter(exp EventExporter, ev *utils.CGREvent, oneTime bool utils.MetaDC: exp.GetMetrics(), utils.MetaOpts: utils.MapStorage(ev.APIOpts), utils.MetaCfg: cfg.GetDataProvider(), - utils.MetaEC: utils.MapStorage{utils.EventCost: ev.Event[utils.EventCost]}, + utils.MetaEC: utils.MapStorage{utils.CostDetails: ev.Event[utils.CostDetails]}, }, utils.FirstNonEmpty(ev.Tenant, cfg.GeneralCfg().DefaultTenant), filterS, map[string]*utils.OrderedNavigableMap{utils.MetaExp: expNM}).SetFields(exp.Cfg().ContentFields()) diff --git a/ees/filecsv_it_test.go b/ees/filecsv_it_test.go index b423c7ab5..7e508bdb9 100644 --- a/ees/filecsv_it_test.go +++ b/ees/filecsv_it_test.go @@ -376,7 +376,7 @@ func testCsvExportComposedEvent(t *testing.T) { utils.Cost: 1.016374, "ExtraFields": map[string]string{"extra1": "val_extra1", "extra2": "val_extra2", "extra3": "val_extra3"}, - "EventCost": cd, + utils.CostDetails: cd, }, }, } @@ -405,7 +405,7 @@ func testCsvExportComposedEvent(t *testing.T) { utils.Cost: 0.155462, "ExtraFields": map[string]string{"extra1": "val_extra1", "extra2": "val_extra2", "extra3": "val_extra3"}, - "EventCost": cd, + utils.CostDetails: cd, }, }, } diff --git a/engine/argees.go b/engine/argees.go index a62f9f9f5..9d43f1353 100644 --- a/engine/argees.go +++ b/engine/argees.go @@ -50,8 +50,8 @@ func (cgr *CGREventWithEeIDs) UnmarshalJSON(data []byte) error { return err } cgr.CGREvent = cgrEv - // check if we have EventCost and modify it's type (by default it was map[string]interface{} by unrmarshaling, now it will be EventCost) - if ecEv, has := cgrEv.Event[utils.EventCost]; has { + // check if we have CostDetails and modify it's type (by default it was map[string]interface{} by unrmarshaling, now it will be EventCost) + if ecEv, has := cgrEv.Event[utils.CostDetails]; has { ec := new(EventCost) bts, err := json.Marshal(ecEv) if err != nil { @@ -60,7 +60,7 @@ func (cgr *CGREventWithEeIDs) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(bts, &ec); err != nil { return err } - cgr.Event[utils.EventCost] = ec + cgr.Event[utils.CostDetails] = ec } return nil }