Constructor looks inside the params' balance map for the Factors key.
It expects either a string representing a JSON serialized map or the
map itself.
BalanceFilter Clone function has been updated to set a deep copy of
the original Factors map instead of a shallow one.
BalanceFilter getter function for Factors now returns nil instead of
an empty map. It's slightly more memory efficient and assignment to
this map will not be attempted, so it's panic proof.
BalanceFilter.ModifyBalance now updates Factors only if the key is
found in the request params' Balance map. Setting Factors to null is also
possible as long as the Factors key exists and is set to null.
Note: only *set_balance can overwrite the Factors map, all the others
can only set it if the balance does exist prior to sending the request.
Update balance integration tests.
The rpcclient constructor could not see the centralized
Encoding flag because it didn't have the necessary build
constraints. Added the constraints in lib_test.go files
where it wasn't alone. In all the other cases, it was
moved to the first file where it was needed.
Retrieve the Accounting BalanceCharge inside a new variable and reuse
that instead of repeatedly indexing the map. It is always assumed that
the BalanceCharge exists in the map and is non-nil. A comment was
added as a reminder.
TotalCost cannot be calculated anymore from ChargingIncrement alone.
The function is not used, so it will not be causing any issues for
now.
BalanceCharge clone function now handles the case where it is nil
to avoid any possible nil pointer dereference.
Factor will be computed only once at the start of the function, instead
of doing it on every Increments iteration.
'amount' variable will be updated and rounded only when the computed
balances factor is different from its default value (1).
CGREventWithEeIDs has also been optimized and properly tested. Comments
have been added explaining the process.
When sending a request to AttributeS from EEs, CostDetails from the reply
will now be overwritten by the original CostDetails to preserve its type.
The downside is that we are assuming that CostDetails was not altered by
AttributeS. We might consider adding a type check against *engine.EventCost
to at least stay backwards compatible with *gob and *internal connections.
general_tests/ees_it_test.go has been updated to ensure changes are working
properly.
It will be added to CallDescriptor in ExtraFields.
Ensure CDR ExtraFields are passed to CallDescriptor before
sending it to RALs.
Ensure Clone function of CallDescriptor also clones the
ExtraFields map.
Will now support two extra parameters: address and codec. For *internal
connections, the birpc.Service object will be retrieved from rpcParamsMap
from utils. Supported codecs: <*gob|*json|*http_jsonrpc> (ingored for
*internal address).
Action does not bother with setting defaults anymore, lets the API
handle them.
Improve action comments.
Add unit tests for the action. UnregisterRpcParams' implementation was
required.
Updated *alter_sessions action tariffplan for radius coa integration test
to include address and codec.
Some birpc clients that are set up in integration tests were still registering
a SessionSv1 object. Updated them to register an AgentV1 object instead.
Ensure parameter fields are not abbreviated.
The action will not depend on balance type anymore. It will go through all
balances.
*default balance from source balance can go negative during transfer.