feat: 完善真实采购订单核对与恢复 (#100)

This commit is contained in:
chengma
2026-08-10 16:54:06 +08:00
parent 16107aaa18
commit df67b0eaaa
16 changed files with 1134 additions and 103 deletions
+12 -1
View File
@@ -113,10 +113,21 @@ class TaskRepositoryTests(unittest.TestCase):
"PURCHASE-LIVE", "192.168.0.173:5555"
)
marked_at = self.repository.mark_purchase_irreversible(
"PURCHASE-LIVE", started.attempt_id
"PURCHASE-LIVE",
started.attempt_id,
{
"options": {"color": "黑色", "size": "L"},
"quantity": 2,
"unit_price_cent": 3990,
"total_price_cent": 7980,
},
)
run = self.repository.latest_task_run("PURCHASE-LIVE")
self.assertEqual(run.irreversible_action_at, marked_at)
self.assertEqual(
run.diagnostics_json["final_confirmation"]["total_price_cent"],
7980,
)
with self.assertRaisesRegex(ValueError, "已经存在"):
self.repository.mark_purchase_irreversible(
"PURCHASE-LIVE", started.attempt_id