Commit graph

19 commits

Author SHA1 Message Date
Elle Mouton
957c9a3a52
accounts: remove UpdateAccount and last usages
We remove the last few calls to UpdateAccount from the
TestAccountService test. Previously, the UpdateAccount call was used in
this test to also _insert_ new accounts and to force the account ID to
be set to specific values. So here we need to instead call the store's
NewAccount method to insert a new account, then we get the AccountID
from the returned value and we need to then use this returned ID (which
is no longer forceable) in the remainder of the tests.
2025-01-23 09:20:09 +02:00
Elle Mouton
8b1c9a2893
accounts: revert UpdateAccountBalanceAndExpiry balance type to be int64
In our mission to replace UpdateAccount, we need
UpdatAccountBalanceAndExpiry to take a negative balance so that we can
use it to replace the behaviour of UpdateAccount as it stands today.
2025-01-23 09:00:49 +02:00
Elle Mouton
4d8d4e1fa3
accounts: use UpsertAccountPayment in removePayment
Instead of UpdateAccount.
2025-01-21 12:20:33 +02:00
Elle Mouton
7fb7faa124
accounts: add DeleteAccountPayment method to Store
And use it instead of UpdateAccount.
2025-01-21 12:02:29 +02:00
Elle Mouton
c386008fe6
accounts: use UpsertAccountPayment for TrackPayment
Instead of useing UpdateAccount.
2025-01-21 12:02:19 +02:00
Elle Mouton
340dc5d5b0
accounts: add new UpsertAccountPayment Store method
And use it in the InterceptorService's paymentUpdate method.
2025-01-21 12:01:33 +02:00
Elle Mouton
0580d9acf0
accounts: add new IncreaseAccountBalance Store method
And use it instead of UpdateAccount in the InterceptorService's
invoiceUpdate method.
2025-01-17 14:17:53 +02:00
Elle Mouton
5a4b22f6e7
accounts: add new AddAccountInvoice Store method
And use it instead of UpdateAccount for the InterceptorService's
AssociateInvoice method.
2025-01-17 14:17:53 +02:00
Elle Mouton
64606f0132
accounts: add new UpdateAccountBalanceAndExpiry Store method
In this commit, we remove one call to the UpdateAccount store method and
replace it with a call to a new UpdateAccountBalanceAndExpiry method
which updates an accounts balance and/or expiry fields and finds the
account via the given ID. This method signature is more appropriate for
a SQL backend than the UpdateAccount method.
2025-01-17 14:11:38 +02:00
Elle Mouton
86fc2ccf79
accounts: let interface methods take a context
Update the accounts `Store` and `Service` interfaces take a context.
This is in preparation for when the backend DB of the accounts service
is a SQL store which will have methods that take a context.
2025-01-16 09:19:04 +02:00
Elle Mouton
fde86d3136
accounts+mid: support for error handlers in accounts
We also want to be able to see via the trace logs if a request has
errored. So first we need to update the framework to be ready for this.
2024-06-06 12:43:56 -04:00
Elle Mouton
8b5a01f909
accounts: start logging useful info from payment request handlers
This commit adds a prefixed logger that is then used to log trace
information about a payment. This will make it easy to see from the logs
which account ID is making the request, what the request ID is and what
the relavant payment hash is.
2024-06-06 12:43:56 -04:00
Elle Mouton
18c819b442
accounts: add ReqIDToPaymentHashStore and implement
In preparation for implementing trace logging that makes it easy to link
state across requests and responses for more informative logs, we add a
new ReqIDToPaymentHashStore interface along with an in-memory
implementation. This can be expanded in future to contain other state
but for now let's just go with the payment hash since that is useful to
have and will provide the user useful information about the payment
corresponding to a log.
2024-06-06 12:43:56 -04:00
Viktor Tigerström
666f19cee8
accounts: associate payments before sending them 2023-09-28 12:58:37 +02:00
Viktor Tigerström
a49422f36f
accounts: disallow requests after critical errors 2023-09-28 12:58:36 +02:00
Oliver Gugger
568d7ad508
accounts+itest: fix linter and code style issues 2023-07-26 18:37:49 +02:00
Oliver Gugger
59563c8a35
accounts: add label to account 2023-07-26 16:41:20 +02:00
Oliver Gugger
cd741091be
session+accounts: add RPC server 2022-12-02 10:06:51 +01:00
Oliver Gugger
43ae6e04c2
accounts: add account store 2022-12-02 10:06:50 +01:00