mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Rename from InitialValue to Initial
This commit is contained in:
committed by
Dan Christian Bogos
parent
4707e02091
commit
e3c10dc6da
@@ -818,12 +818,12 @@ func (f ValueFactor) GetValue(tor string) float64 {
|
||||
|
||||
// BalanceSummary represents compressed information about a balance
|
||||
type BalanceSummary struct {
|
||||
UUID string // Balance UUID
|
||||
ID string // Balance ID if not defined
|
||||
Type string // *voice, *data, etc
|
||||
InitialValue float64
|
||||
Value float64
|
||||
Disabled bool
|
||||
UUID string // Balance UUID
|
||||
ID string // Balance ID if not defined
|
||||
Type string // *voice, *data, etc
|
||||
Initial float64 // initial value before the debit operation
|
||||
Value float64
|
||||
Disabled bool
|
||||
}
|
||||
|
||||
// BalanceSummaries is a list of BalanceSummaries
|
||||
|
||||
@@ -1008,7 +1008,7 @@ func (cd *CallDescriptor) AccountSummary(initialAcnt *AccountSummary) *AccountSu
|
||||
for _, initialBal := range initialAcnt.BalanceSummaries {
|
||||
for _, currentBal := range acntSummary.BalanceSummaries {
|
||||
if currentBal.UUID == initialBal.UUID {
|
||||
currentBal.InitialValue = initialBal.Value
|
||||
currentBal.Initial = initialBal.Value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3295,7 +3295,7 @@ func TestEventCostString(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
eOut = `{"CGRID":"","RunID":"","StartTime":"0001-01-01T00:00:00Z","Usage":null,"Cost":null,"Charges":null,"AccountSummary":{"Tenant":"","ID":"","BalanceSummaries":[{"UUID":"","ID":"ID","Type":"","InitialValue":0,"Value":0,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":null,"Accounting":null,"RatingFilters":null,"Rates":null,"Timings":null}`
|
||||
eOut = `{"CGRID":"","RunID":"","StartTime":"0001-01-01T00:00:00Z","Usage":null,"Cost":null,"Charges":null,"AccountSummary":{"Tenant":"","ID":"","BalanceSummaries":[{"UUID":"","ID":"ID","Type":"","Initial":0,"Value":0,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":null,"Accounting":null,"RatingFilters":null,"Rates":null,"Timings":null}`
|
||||
if rcv := eventCost.String(); !reflect.DeepEqual(eOut, rcv) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user