Commit Graph

375 Commits

Author SHA1 Message Date
ionutboangiu
60929112fa Make sure reply is sorted before comparison for cdre tests 2023-08-28 12:24:59 +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
b7d172f78a Fix misspellings 2023-06-21 11:02:39 +02:00
ionutboangiu
62619ba3a5 Replace interface{} with any 2023-06-05 10:55:32 +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
a748ab629e Apply gofmt simplify code 2022-12-02 14:24:18 +02: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
Trial97
db3bf9f40d Updated build tags 2021-08-30 17:55:51 +03:00
Trial97
a2a340f251 Updated ApierV1.SetRatingProfile and ApierV1.RemoveRatingProfile. Fixes #3186 2021-08-19 17:47:23 +02:00
nickolasdaniel
ce5a52f84a Added tenant flag for cgr-loader 2021-08-18 16:35:48 +02:00
porosnicuadrian
b9fe89b333 Fixed missing struct fields case 2021-08-18 14:40:06 +02:00
Trial97
ca50dd2f73 Updated actionplan cache tests 2021-06-08 12:05:51 +02:00
Trial97
a6aa435a8d Updated AcionPlans 2021-06-08 12:05:51 +02:00
Trial97
a1584a8649 Added test for set account with action plan 2021-06-08 12:05:51 +02:00
Trial97
5148dff2a2 Updated automatic cache reloads 2021-05-17 18:01:11 +02:00
Trial97
a8ecf36bec Added tenant to automatic cache calls. Fixes #2928 2021-05-12 13:54:28 +02:00
Trial97
1083c0315f Updated cache reload 2020-04-30 16:03:05 +02:00
Trial97
a90d5c1e71 Updated RemoveTPRatingProfile API 2020-04-02 17:49:00 +02:00
TeoV
0fcafbb526 Add backwards compatible with ApierV1/ApierV2 prefix 2020-02-10 11:26:17 +01:00
TeoV
bb0803bd96 Correctly send destination with "+" when GetCDR for mongo 2020-02-06 09:58:37 +01:00
Trial97
d8333b5b68 Started adding FieldAsInterface for EventCost 2020-02-05 16:00:32 +01:00
adragusin
3eaf3232a1 Renamed ApierV1 to APIerSv1/ ApierV2 to APIerSv2 2020-01-30 14:06:48 +01:00
adragusin
35e5fb2f9d renamed dbType *sql to *mysql 2020-01-29 16:54:54 +01:00
Trial97
94c29c93d2 Updated CDRExporter 2020-01-28 10:07:34 +01:00
TeoV
6b15a577b7 Merge in one CacheSv1.ReloadCache call for APIer 2020-01-23 16:44:31 +02:00
TeoV
616ebff043 Replace with CacheSv1.ReloadCache in ApierV2 2020-01-23 16:02:31 +02:00
Trial97
60703280a6 Updated typos in cdre 2020-01-21 16:25:50 +02:00
Dan Christian Bogos
cc9dab3ae3 Merge pull request #1882 from adragusin/master
Removed directions from templates
2020-01-21 14:25:23 +01:00
adragusin
3a1104ff01 Removed directions from templates 2020-01-21 13:36:07 +02:00
Trial97
999aabdf9f Updated FieldName for attributes 2020-01-20 14:44:36 +02:00
Trial97
ae56de5cf9 Updated tests 2020-01-17 08:28:52 +02:00
Trial97
9941551826 Updated apier tests 2020-01-15 16:22:47 +02:00
Trial97
363a191d31 Updated OK in tests 2020-01-15 16:22:47 +02:00
adragusin
d7a5fc7ebf Updated IT tests in engine 2020-01-15 03:05:02 -05:00
adragusin
10e79a74d4 Updated IT tests in apier/v2 2020-01-14 02:12:35 -05:00
Trial97
11b362c0f3 Uniformized SetBalance and AddBalance parameters 2020-01-06 17:35:42 +02:00
TeoV
7b72c943a0 Add connections from remote and replicate throuh ConnManager 2020-01-06 09:27:34 -05:00
Trial97
1c086ac0e3 Updated gob integration tests 2019-12-18 13:24:35 +02:00
Trial97
7e6c8ca61c Updated v1ProcessCDR and V1RateCDR 2019-12-17 17:25:55 +02:00
Trial97
e5c97a94ab Renamed META_DEFAULT to MetaDefault 2019-12-13 15:04:34 +02:00
TeoV
4bd4ae3ee9 Add connections through ConnManager 2019-12-12 08:52:49 +02:00
Trial97
bbcfc6de42 Updated integration tests 2019-12-11 08:00:38 +02:00
Trial97
d22151861d Updated integration tests and replaced *none with *remove in attributes 2019-12-11 08:00:38 +02:00
Trial97
b4fe82c6d7 Updated rpcclient library 2019-12-09 18:04:26 +02:00
Trial97
05a989aec0 Added test for Threshold with filter on BalanceSummaries in CDRServer 2019-12-05 16:02:39 +02:00
TeoV
107170f00d Add integration test for InternalDB in apier/v2/cdrs_it_test.go 2019-12-04 09:41:23 -05:00