* chore: allow 0 limits for send/receive amount/volume
* fix: use pointers for claims
* fix: tests to set default as -1
* chore: add 0 check in outgoing exceeded tests
* chore: also default max account balance to -1
* chore: remove dbUri :P
* chore: remove print statements
* chore: add more tests for limits
So far we have returned the total amount (which includes the fee) and the fee.
This information was taken from the payment route response now we directly return it from the invoice data.
This is consistent with the other transaction responses
* Add support for service fees
This introduces a new transaction type "service_fee"
Each outgoing payment is charged a service fee of x/1000.
The service fee entries is added with the routing fee reserve entry.
For failed payments the service fee is reversed.
* Add service_fee migration
* No service fee by default
* Fee reserve and service fee is optional
ignore NoRows errors
* Update Makefile
* Unify setting the fee on the invoice
* Proper error check
* ups
* Add service fee tests to outgoing payment tests
* Save parant id to fee tx entries
* Optionally load test DB from env variable
* Add config for free transactions
payment amounts up to NO_SERVICE_FEE_UP_TO_AMOUNT don't get a service fee charged
* Update readme
* cleanup
* fix: only charge service fees for amounts > free limit
* fix: format
* Save service fee on invoice
* naming
* Also save the payment hash where we save the preimage
we already do exactly that when in the normal PayInvoice flow.
Normally the RHash is already set here, but I guess it does not hurt to have
it consistent everywhere.
* Use the invoice routing fee field to check if a routing fee must be charged
It feels a bit indirect to check if we have set a FeeReserve.
We save the routing fee on the invoice thus we should be able to use that information
* remove nullzero from fee columns
we want those to be 0 by default
* add columns only if not existent
---------
Co-authored-by: René Aaron <rene@twentyuno.net>
* Update Makefile
* Optionally load test DB from env variable
* Add option to soft-delete a user
This allows users to be marked as deleted.
An additional middleware checks if a user is deleted or deactivated and rejects
requests for those as StatusUnauthorized.
note: the middelware adds an additional DB query to load the user.