- holds common relevant data between actions.
- currently supports only *cdrlog, making the process more reliable
and less repetitive. It also provides access to more information about
actions when creating CDRs.
- easier to scale.
- removes the need for cloning accounts before executing a group of
actions.
- added Actions method to check if specific action types exist inside.
By default setting rerate to true also sets refund to true, but
flags should take precedence over defaults.
If rerate is true and refund is false, remove any previous
CostDetails from event to force rerate.
Centralize the configuration of processing args.
The *transfer_balance action can now use a reference value to ensure
the destination balance reaches a specified amount. If the destination
balance exceeds the reference value, the excess is transferred back
to the source balance. If the destination balance is below the
reference value, the required amount is transferred from the source
balance to the destination balance to reach the specified reference
value. An error is returned if the transfer cannot achieve the
specified reference value.
Used by specifying DestinationReferenceValue inside ExtraParameters.
Other *transfer_balance changes:
- used json tags when unmarshaling ExtraParameters in order to be
able to shorten the names of the fields
- lock the destination account only if it's different from the
source account. It is still passed to the Guard function but
without a lock key and with 0 timeout.
- if the transfer happens within the same account, update the
account and execute its ActionTriggers only once.
- moved transfer units validation after retrieving/creating the
destination balance
*cdrlog action has been updated to create cdrs for reference
*transfer_balance actions, although improvements are needed and
the functionality is not completely tested.
APIerSv1.TransferBalance has been updated to take into account the
ReferenceValue parameter.
Added new *transfer_balance action unit tests to account for the
new changes.
Added integration tests (incomplete for now, but functionality
has been tested manually).
200 -> 16
Previously, considering the fibonacci back off strategy, if engine failed to
start it would have tried to attempt connections for 2.862799e+33 years.
Now, the amount of attempts is 16, equivalent to around 2 and a half seconds.
Should be more than enough, considering that usually 6-7 attempts are enough.
Fixes an issue where 0 values would become empty inside the cron
expressions.
Added unit tests for the edge cases and grouped them together with
the previous ones under the same table test.
When creating the StartTime field, assign time.Now() to a centralised
variable and reuse it instead of calling time.Now() repeatedly.
Revise backup loop tests to not rely on time.Sleep anymore and remove
unused fields from them.
Removed 3ns TTL from tpreader test dataDB configuration that caused in-
consistent results.
Ensure connManager cache is reloaded in filter tests. Before they could
cause deadlocks.
Remove redundant inits, global vars and setup tests for debit and
accounts tests.
Optimize some analyzers tests.
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.