aboutsummaryrefslogtreecommitdiff
path: root/tests/managers
diff options
context:
space:
mode:
authorstuppie2026-08-19 16:58:43 -0600
committerstuppie2026-08-19 16:58:43 -0600
commit0e60d93cf9dfff98bae4a459288c06c6fd7f2c07 (patch)
tree487ba56058447867c18f3d799602a740c0153d8c /tests/managers
parent91dba28268657c41ebbaec1572258b927c5ae24b (diff)
downloadgeneralresearch-0e60d93cf9dfff98bae4a459288c06c6fd7f2c07.tar.gz
generalresearch-0e60d93cf9dfff98bae4a459288c06c6fd7f2c07.zip
working on BusinessPayoutEvent. create_from_ach_or_wire -> stage payout events all at once. BusinessPayoutEvent standalone model instead of computed from bp_payouts
Diffstat (limited to 'tests/managers')
-rw-r--r--tests/managers/thl/test_payout.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/managers/thl/test_payout.py b/tests/managers/thl/test_payout.py
index 31087b8..f118c71 100644
--- a/tests/managers/thl/test_payout.py
+++ b/tests/managers/thl/test_payout.py
@@ -5,6 +5,7 @@ from decimal import Decimal
from random import choice as rand_choice, randint
from typing import Optional
from uuid import uuid4
+import io
import pandas as pd
import pytest
@@ -16,7 +17,10 @@ from generalresearch.managers.thl.ledger_manager.exceptions import (
from generalresearch.managers.thl.payout import UserPayoutEventManager
from generalresearch.models.thl.definitions import PayoutStatus
from generalresearch.models.thl.ledger import LedgerEntry, Direction
-from generalresearch.models.thl.payout import BusinessPayoutEvent
+from generalresearch.models.thl.payout import (
+ BusinessPayoutEvent,
+ BrokerageProductPayoutEvent,
+)
from generalresearch.models.thl.payout import UserPayoutEvent
from generalresearch.models.thl.wallet import PayoutType
from generalresearch.models.thl.ledger import LedgerAccount
@@ -708,7 +712,6 @@ class TestBusinessPayoutEventManager:
assert int(res.deduction.sum()) == 0
def test_distribute_amount(self, business_payout_event_manager):
- import io
df = pd.read_csv(
io.StringIO(
@@ -802,6 +805,28 @@ class TestBusinessPayoutEventManager:
)
assert "Must issue Supplier Payouts at least $100 minimum." in str(cm)
+ bpe = BusinessPayoutEvent(
+ business_id=business.uuid,
+ amount=USDCent(100_00),
+ payout_type=PayoutType.ACH,
+ )
+ bpe.bp_payouts = [
+ BrokerageProductPayoutEvent(
+ product_id=uuid4().hex,
+ payout_type=PayoutType.ACH,
+ amount=USDCent(47_00),
+ cashout_method_uuid=uuid4().hex,
+ debit_account_uuid=uuid4().hex,
+ ),
+ BrokerageProductPayoutEvent(
+ product_id=uuid4().hex,
+ payout_type=PayoutType.ACH,
+ amount=USDCent(53_00),
+ cashout_method_uuid=uuid4().hex,
+ debit_account_uuid=uuid4().hex,
+ ),
+ ]
+
def test_ach_payment(
self,
product,