"""Unit tests for database record models.""" from decimal import Decimal from src.schemas import LedgerAdjustmentApplied, StatementPeriodPaymentEntity class TestStatementPeriodPaymentEntity: """Tests for StatementPeriodPaymentEntity model.""" def test_valid_model(self): """Test valid model creation.""" model = StatementPeriodPaymentEntity( statement_period_payment_entity_id=1, statement_period_id=456, reference_payment_entity_id=10, ) assert model.statement_period_payment_entity_id == 1 assert model.statement_period_id == 456 assert model.reference_payment_entity_id == 10 class TestLedgerAdjustmentApplied: """Tests for LedgerAdjustmentApplied model.""" def test_valid_model(self): """Test valid model creation.""" model = LedgerAdjustmentApplied( ledger_adjustment_applied_id=1, account_id=100, contract_id=200, adjustment_amount=Decimal('50.00'), adjustment_currency_code='USD', adjustment_amount_payee_currency=Decimal('50.00'), adjustment_payee_currency_code='USD', account_payee_id=300, ) assert model.ledger_adjustment_applied_id == 1 assert model.account_id == 100 assert model.contract_id == 200 assert model.adjustment_amount == Decimal('50.00') assert model.adjustment_currency_code == 'USD' assert model.adjustment_amount_payee_currency == Decimal('50.00') assert model.adjustment_payee_currency_code == 'USD' assert model.account_payee_id == 300 def test_decimal_precision(self): """Test that decimal amounts maintain precision.""" model = LedgerAdjustmentApplied( ledger_adjustment_applied_id=1, account_id=100, contract_id=200, adjustment_amount=Decimal('123.45'), adjustment_currency_code='EUR', adjustment_amount_payee_currency=Decimal('130.22'), adjustment_payee_currency_code='USD', account_payee_id=300, ) assert model.adjustment_amount == Decimal('123.45') assert model.adjustment_amount_payee_currency == Decimal('130.22')