Commit Graph

2118 Commits

Author SHA1 Message Date
ionutboangiu
d1dac1bef6 Replace deprecated ioutil package 2023-08-09 15:30:27 +02:00
gezimbll
8db9d6ca4d Added multiple filters for exportcdrs apis tests 2023-08-08 17:14:36 +02:00
gezimbll
457ab9a3c6 Renaming to filterids field on exportcdrs 2023-08-08 17:14:36 +02:00
gezimbll
f18c118cb0 Adding FiltersID field for ExportCdrs api 2023-08-08 17:14:36 +02:00
ionutboangiu
4fffeeba21 Revise it test to also work when testing entire package 2023-07-21 09:01:46 +02:00
ionutboangiu
f3428e298d Fix failing test due to tariffplan changes 2023-07-18 16:37:06 +02:00
ionutboangiu
f2214052b6 Solve struct literal uses unkeyed fields warning 2023-07-18 16:37:06 +02:00
ionutboangiu
2e9653b551 Apply gofmt 2023-07-18 16:37:06 +02:00
ionutboangiu
b7d172f78a Fix misspellings 2023-06-21 11:02:39 +02:00
ionutboangiu
3935a72605 Remove executable bit from .go files 2023-06-16 10:24:13 +02:00
ionutboangiu
62619ba3a5 Replace interface{} with any 2023-06-05 10:55:32 +02:00
gezimbll
de2eaec25a Fixing tpexporter initialization of slices && testing errors for tpexporter 2023-05-31 10:21:02 +02:00
ionutboangiu
6a6fefd0cd Improve cost formatting and parsing for CDRs
The FormatCost function in cdr.go now accepts an additional parameter of type *config.RSRParser. This is
then used to extract the value from its path as opposed to always using the value of the Cost field directly.

Improved the unit test for the FormatCost function. Now it has become a table-driven test and it handles
cases when the cost is retrieved from different fields other than  from the CDR.
2023-05-22 07:53:47 +02:00
ionutboangiu
d8464ce023 Update libraries 2023-05-03 10:02:15 +02:00
ionutboangiu
85cc7e03f0 Enable bijson support for SessionSv1 service
Add bidirectional support for sessions while maintaining changing the
current rpc service registration method. Modified methods in
sessionsbirpc.go file to satisfy the birpc.ClientConnector interface
and removed BiRPC prefix before creating the service that's to be
registered.
2023-05-03 10:02:15 +02:00
ionutboangiu
259fb83c47 Add the implementation for Sleep api in sessions/sessions.go
Before the implementation was done directly in the SessionSv1 method. The argument definition
was also moved from apier/v1 to utils.
2023-05-03 10:02:15 +02:00
ionutboangiu
cb7ea790de Update rpcclient library to latest version
Replace all instances of rpcclient.ClientConnector with birpc.ClientConnector.

Pass context, maxReconnectInterval, delayFunc and birpcClient to rpcclient
constructors.

Remove redundant time.Duration conversions (e.g. time.Duration(1*time.Second)
now becomes time.Second.

Add context where needed (context.Background() for tests, context.TODO()
for places where it should be passed from somewhere else).

Implement that functionality of the SessionSv1.Sleep call, in sessions/sessions
instead of apier/v1.

Make changes in utils/server.go (replacing the old rpc2 library with github.com/cgrates/birpc).

Change the way we register birpc methods for sessions in services, using a helper function
defined in engine/libengine.go.
2023-05-03 10:02:15 +02:00
ionutboangiu
4cd2dc3de8 Revise CDR rerating
The (*CDRServer).processEvent function is now called processEvents and can
be passed an array of CGREvents instead of only one. This was done because
when calling the RateCDRs API we want to first refund all CDRs before
starting to debit again.

The rerate parameter is now no longer hardcoded to true for the RateCDRs API.If
required, the "*rerate" flag must be provided by the caller.

Now, the refundEventCost function returns an additional boolean, that signals
whether the refund occured or didn't.

If the reRate parameter is set to true, also set refund to true.

In case CostDetails is not populated, retrieve it from StorDB if possible
and add it to the CGREvent before converting to CDRs. Set CostDetails back
to nil once the refund goes through.

Remove the refund logic from within the store block.

Now that the refund happens before the debit, revise the expected values for
the "testV1CDRsProcessEventWithRefund" subtest within the
apier/v1/cdrs_it_test.go file.

Add an integration test for the following scenario:
 -create one account with one balance of 1 free minute and rating for the rest.
 -send one CDR of two minutes with ProcessEvent. This should consume 60s out of
the free balance and charge 60s. The SetupTime in the CDR should be 1 hour after
the second CDR.
 -send the second CDR with an usage of 2m. This should be charged entirely.
 -send a RateCDR API call with OrderBy: "SetupTime". This should rerate the two
CDRs from above and change their order of rating.
2023-04-20 20:05:00 +02:00
ionutboangiu
15b404e8cf Revise randomly failing tests 2023-03-28 17:59:32 +02:00
ionutboangiu
ee7a0d131a Revise kafka poster integration test
When verifying whether the export was successful, read message by message instead of reading in batches.
2023-03-19 19:32:25 +01:00
ionutboangiu
01556a299f Revise it tests 2023-03-10 14:07:59 +01:00
ionutboangiu
24d5a654e5 Get rid of logs from kafka cdre test 2023-03-10 14:07:59 +01:00
gezimbll
7dcbd09a1f replacing non-meta constants for storage types 2023-03-08 19:14:24 +01:00
ionutboangiu
dbd497c4d4 Update to latest amqp 1.0 package version and fix compilation errors 2023-02-22 18:19:47 +01:00
ionutboangiu
edcb7d6e6b Update amqpv1 library and fix compilation errors 2023-02-21 18:26:01 +01:00
ionutboangiu
6a7fde0c99 Add integration tests for amqpv1 exporter 2023-02-20 19:45:08 +01:00
ionutboangiu
c9ec5e53c8 Leave exportPath unprocessed for kafka + tests 2023-02-20 19:45:08 +01:00
ionutboangiu
40943dda09 Add test for *amqp_json_cdr exporter 2023-02-20 19:45:08 +01:00
ionutboangiu
6f91f027c8 Leave exportPath unprocessed for s3&sqs + tests 2023-02-17 12:19:22 +01:00
gezimbll
5557cde746 IT test for setting balance uuid 2023-02-17 11:30:30 +01:00
ionutboangiu
c2a824a94b Leave export_path as is when exporting (AMQP) + tests 2023-02-16 11:25:20 +01:00
gezimbll
682904ad9d replacing streadway/amqp with rabbitmq/amqp091-go 2023-02-02 17:49:05 +01:00
adi
a551488cab Updated internal drv 2023-01-13 16:27:10 +01:00
adi
132d206266 Finished updates for mongo driver and tests 2023-01-07 17:49:13 +01:00
adi
c94ed8d123 Improved soME tests and driver 2022-12-27 18:29:32 +02:00
adi
d857079890 Dispatcher reverse filter indexes 2022-12-20 18:28:20 +02:00
adi
7ea41a6bc7 Added reverse filter indexes for attributes 2022-12-15 12:05:10 +02:00
adi
ae62ff3b1c Added reverse filter indexes for stats 2022-12-15 12:05:10 +02:00
adi
db4912e330 Added supplier filter indexes 2022-12-15 12:05:10 +02:00
adi
0139f213fc Added resource reverse indexes code 2022-12-13 17:10:47 +02:00
adi
4c3d1b60a0 Improved reverse idx code + thresholds implementation and tests 2022-12-12 11:15:43 +02:00
adi
5914213c96 Update filters without computing when overwriting + chargers case 2022-12-09 13:27:28 +02:00
adi
4ec5e420b0 Remove reverse filter indexes 2022-12-07 17:32:20 +02:00
adi
c9a9857152 Added relevant paratheses 2022-12-02 18:39:29 +02:00
ionutboangiu
1436bac61c Remove unnecessary paranthesis 2022-12-02 14:24:18 +02:00
ionutboangiu
a748ab629e Apply gofmt simplify code 2022-12-02 14:24:18 +02:00
ionutboangiu
82468c580d Replace deprecated ioutil library, remove redundant statements + small optimizations 2022-12-02 14:24:18 +02:00
ionutboangiu
bcd0a47268 Update radius library 2022-11-21 11:04:21 +01:00
ionutboangiu
758a94280a Apply project wide fmt 2022-11-16 10:13:44 +01:00
adi
a6445f641e Displays messages for agents when connect + fixes on call tests 2022-11-11 17:04:59 +01:00