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

@ -173,6 +173,7 @@ class GeneratePaymentInvoice(BaseModel):
"""Generate payment invoice request"""
amount: int
user_id: Optional[str] = None # For admin-generated settlement invoices
class RecordPayment(BaseModel):