Let protocol-audit list show first-pay times from transfer records. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
988 B
Python
29 lines
988 B
Python
"""payment summary detail includes transferTime"""
|
|
from datetime import datetime
|
|
from types import SimpleNamespace
|
|
import unittest
|
|
|
|
from app.services.qc_work_order_fee_summary import build_protocol_payment_summary
|
|
|
|
|
|
class TestPaymentSummaryTransferTime(unittest.TestCase):
|
|
def test_detail_includes_transfer_time(self):
|
|
pay = SimpleNamespace(pay_mode="fq", contract_amount=10000)
|
|
detail = SimpleNamespace(
|
|
installment_no=1,
|
|
order_num=1,
|
|
create_time=datetime(2025, 9, 1, 10, 0, 0),
|
|
installment_due_date="20250901",
|
|
due_amount=5000,
|
|
transfer_amount=5000,
|
|
pay_status="yjf",
|
|
transfer_time=datetime(2025, 9, 15, 9, 20, 0),
|
|
)
|
|
summary = build_protocol_payment_summary(pay, [detail])
|
|
self.assertIsNotNone(summary)
|
|
self.assertEqual(summary["paymentDetails"][0]["transferTime"], "2025-09-15 09:20:00")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|