Commit Graph

26 Commits

Author SHA1 Message Date
ionutboangiu
8443af3a89 Relicense from GPLv3 to AGPLv3 2025-10-29 19:42:40 +01:00
ionutboangiu
31842bf3f5 Add possibility to set/overwrite balance Factors through API
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.
2024-04-08 13:15:41 +02:00
ionutboangiu
bd4aa99458 Refactor balance's Factor field name with its plural form
Stored balances previous to this commit, that had a non-nil Factors map, will
now have Factors nil due to field name mismatch.
2024-04-01 19:58:04 +03:00
gezimbll
c2dacc42c1 Removed warnings from go staticcheck 2023-11-08 17:10:13 +01:00
ionutboangiu
6c16ff320f Replace interface{} with any 2023-05-31 10:23:12 +02:00
Trial97
61b823443d Finished adding all fieldAsInterface methods 2021-11-28 10:25:32 +01:00
ionutboangiu
59566430bc Add possibility to accept time units as value when setting balance + tests. Fixes #3274 2021-09-19 12:05:45 +02:00
Trial97
f2c9ca3530 Fixed typo in license header 2021-03-10 16:22:37 +01:00
andronache
4ff3b9242d Consts in utils 2021-01-07 18:15:35 +01:00
adragusin
e85825bf28 Updated Clone functions 2019-12-10 17:53:17 +02:00
Trial97
2a356792fb Added test for NewBalanceFilter 2019-12-04 13:42:11 +02:00
Trial97
ee0956d05e Updated ApierV1.SetBalance 2019-11-28 16:21:55 +02:00
adragusin
d3522ef2e7 Updated engine tests after replacing MapStorage 2019-11-20 17:12:04 +01:00
TeoV
5c72bd985a Add test for replication DataManager + populate Timing when using SetBalance API 2019-11-12 11:45:59 +01:00
DanB
417b4fadff Actions.csv - removing balance direction filter 2019-02-13 11:23:27 +01:00
edwardro22
b651b06826 Removed copyright from go doc 2017-09-10 15:02:46 +00:00
DanB
401625861d Updated project README, COPYRIGHT information 2016-09-02 13:04:34 +02:00
Radu Ioan Fericean
768cdcc43a value formula passing test 2016-04-26 20:23:43 +03:00
Radu Ioan Fericean
b16cc28389 started value formula 2016-04-26 20:23:43 +03:00
Radu Ioan Fericean
9dd6c6dc16 generate new expdate on action timing execution
fixes #363
2016-03-08 16:37:22 +02:00
Radu Ioan Fericean
a7024eb66c SetBalance to modify the ID too 2016-02-29 12:40:46 +02:00
Radu Ioan Fericean
eaad0329e7 intermediary migrator 2016-02-25 09:34:12 +02:00
Radu Ioan Fericean
1777a6e1a5 renamed Id to ID in balance 2016-02-23 21:03:58 +02:00
Radu Ioan Fericean
c057840c06 better set account action 2016-02-22 21:21:05 +02:00
Radu Ioan Fericean
2690802100 triggers loading improvement 2016-02-19 12:58:14 +02:00
Radu Ioan Fericean
da4c1ca2da most engine tests passing
ResetAccountPending
2016-02-15 23:05:35 +02:00