Enables admin to generate invoices for users

Allows administrators to generate payment invoices on behalf of specific users.
This is useful for handling settlement invoices in certain scenarios.

The changes include:
- Adding a `user_id` field to the generate payment invoice request model
- Updating the API endpoint to accept the `user_id` parameter
- Implementing checks to ensure only superusers can generate invoices for other users
- Updating the memo and extra data to reflect the target user
This commit is contained in:
padreug 2025-10-23 03:07:47 +02:00
parent a2a58d323b
commit af424109f1
3 changed files with 36 additions and 8 deletions

View file

@ -915,7 +915,8 @@ window.app = Vue.createApp({
'/castle/api/v1/generate-payment-invoice',
this.g.user.wallets[0].adminkey,
{
amount: this.settleReceivableDialog.amount
amount: this.settleReceivableDialog.amount,
user_id: this.settleReceivableDialog.user_id // Specify which user this invoice is for
}
)