storj/satellite/console
paul cannon a16aecfa96 satellite/payments: specialized type for monetary amounts
Why: big.Float is not an ideal type for dealing with monetary amounts,
because no matter how high the precision, some non-integer decimal
values can not be represented exactly in base-2 floating point. Also,
storing gob-encoded big.Float values in the database makes it very hard
to use those values in meaningful queries, making it difficult to do
any sort of analysis on billing.

For better accuracy, then, we can just represent monetary values as
integers (in whatever base units are appropriate for the currency). For
example, STORJ tokens or Bitcoins can not be split into pieces smaller
than 10^-8, so we can store amounts of STORJ or BTC with precision
simply by moving the decimal point 8 digits to the right. For USD values
(assuming we don't want to deal with fractional cents), we can move the
decimal point 2 digits to the right.

To make it easier and less error-prone to deal with the math involved, I
introduce here a new type, monetary.Amount, instances of which have an
associated value _and_ a currency.

Change-Id: I03395d52f0e2473cf301361f6033722b54640265
2021-09-28 23:27:44 +00:00
..
consoleauth all: fix linter complaints 2020-10-13 15:59:01 +03:00
consolewasm satellite/console: add more tests for uplink access permission 2021-06-23 11:58:29 +00:00
consoleweb satellite/payments: specialized type for monetary amounts 2021-09-28 23:27:44 +00:00
wasm satellite/wasm: support restricting full access grants to paths 2021-03-26 19:49:21 +00:00
apikeys_test.go satellite/satellitedb/satellitedbtest: pass ctx as an argument 2020-01-20 16:35:42 +02:00
apikeys.go all: golangci-lint v1.33.0 fixes (#3985) 2020-12-05 17:01:42 +01:00
attribution_test.go ci: fix lint errors 2021-05-17 13:37:31 +00:00
auth.go all: fix error naming 2021-04-29 15:38:21 +03:00
billinghistoryitem.go satellite/payments: available coupon value feature 2020-06-02 10:00:45 +00:00
buckets.go satellite/metabase: move package one level higher 2021-04-21 15:54:22 +03:00
database.go satellite: remove referral program related code 2021-02-08 13:52:50 +00:00
mfa.go satellite/console,web/satellite: Allow disabling MFA with recovery code 2021-08-18 14:34:17 +00:00
projectmembers_test.go all: remove old uuid 2020-04-02 19:30:36 +03:00
projectmembers.go all: add missing dots 2020-08-11 17:50:01 +03:00
projects_test.go satellite/console: Add pagination fields for ListProjectsByOwnerID 2021-01-20 16:15:29 +00:00
projects.go satellite/metainfo: separate burst limit from rate limit config 2021-09-28 22:47:41 +00:00
projectusagelimits.go satellite/console: project usage limits api (#3702) 2019-12-12 14:58:15 +02:00
recaptcha_test.go satellite/console: Forward friendly registration errors to client 2021-07-22 11:31:12 +00:00
recaptcha.go satellite/console: Add reCAPTCHA verification step to registration 2021-07-07 21:34:07 +00:00
registrationtoken.go all: golangci-lint v1.33.0 fixes (#3985) 2020-12-05 17:01:42 +01:00
request.go audit logging: log important user activity 2020-09-07 15:26:34 +00:00
resetpasswordtoken_test.go all: fix linter complaints 2020-10-13 15:59:01 +03:00
resetpasswordtoken.go all: golangci-lint v1.33.0 fixes (#3985) 2020-12-05 17:01:42 +01:00
service_test.go satellite/console: UpdateProject changes 2021-09-01 20:30:26 +00:00
service.go satellite/console: add status check to user authorization to ensure deleted accounts cannot perform actions 2021-09-16 17:06:34 +00:00
sortdirection.go all: fix comments 2020-07-16 19:13:14 +03:00
users_test.go satellite/console: Implement MFA backend 2021-07-26 16:37:05 +00:00
users.go satellite/console: Implement MFA backend 2021-07-26 16:37:05 +00:00
validation.go all: fix error naming 2021-04-29 15:38:21 +03:00