From cbc480463856948f468aaed090db65dcb2e350c9 Mon Sep 17 00:00:00 2001 From: stuppie Date: Wed, 23 Sep 2026 14:38:28 -0600 Subject: payout detail to return user info (so panels can look up the user from a payout ID upon status change) --- generalresearch/managers/thl/wallet/user_payout.py | 13 +++++++++++-- generalresearch/models/thl/wallet/cashout_method.py | 2 ++ pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/generalresearch/managers/thl/wallet/user_payout.py b/generalresearch/managers/thl/wallet/user_payout.py index 756bcee..76ed673 100644 --- a/generalresearch/managers/thl/wallet/user_payout.py +++ b/generalresearch/managers/thl/wallet/user_payout.py @@ -47,12 +47,19 @@ class UserPayoutEventManager(PayoutEventManager): -- User Payout specific ac.name as description, la.reference_type as account_reference_type, - la.reference_uuid as account_reference_uuid + la.reference_uuid as account_reference_uuid, + jsonb_build_object( + 'user_id', u.id, + 'product_id', REPLACE(u.product_id::varchar, '-', ''), + 'product_user_id', u.product_user_id + ) AS user FROM event_payout AS ep LEFT JOIN accounting_cashoutmethod AS ac ON ep.cashout_method_uuid = ac.id - LEFT JOIN ledger_account AS la + JOIN ledger_account AS la ON la.uuid = ep.debit_account_uuid + JOIN thl_user u + ON la.reference_uuid = u.uuid WHERE ep.uuid = %s """, params=[pe_uuid], @@ -96,6 +103,8 @@ class UserPayoutEventManager(PayoutEventManager): description=pe.description, transaction_info=transaction_info, message="", + product_id=pe.user.product_id, + product_user_id=pe.user.product_user_id, ) def filter_by( diff --git a/generalresearch/models/thl/wallet/cashout_method.py b/generalresearch/models/thl/wallet/cashout_method.py index b1bd1eb..907ce8a 100644 --- a/generalresearch/models/thl/wallet/cashout_method.py +++ b/generalresearch/models/thl/wallet/cashout_method.py @@ -420,6 +420,8 @@ class CashoutRequestInfo(BaseModel): examples=[PayoutStatus.PENDING], ) transaction_info: dict[str, Any] | None = Field(default=None) + product_id: UUIDStr = Field() + product_user_id: BPUIDStr = Field() class CashoutRequestResponse(StatusResponse): diff --git a/pyproject.toml b/pyproject.toml index 3a3c544..0f3fd89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.5.7" +version = "3.5.8" description = "Python Utilities for General Research" readme = "README.md" requires-python = ">=3.14" -- cgit v1.2.3