空运已有 TMS 选定舱位时直接锁舱,不再追问三项;纯文字报价提示只留给附件报价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1110,8 +1110,57 @@ class AirGroupCollabTests(unittest.TestCase):
|
||||
self.assertEqual(phase, "lock_ok")
|
||||
self.assertTrue(any("执行成功" in t for t in self._texts()))
|
||||
|
||||
def test_tms_quote_with_selected_cabin_locks_without_asking_params(self) -> None:
|
||||
"""TMS 已有 selected_air_option:直接锁,不追问舱位/航司/航班(WO014)。"""
|
||||
wo = self._create_air(
|
||||
quote={
|
||||
"total": "183370",
|
||||
"source": "TMS",
|
||||
"source_label": "航线确认TMS",
|
||||
"quoteId": "AIR-2094721692181016578-2094721692701110273",
|
||||
"selected_air_option": {
|
||||
"optionNo": "AIR-OPT01",
|
||||
"airlineCode": "JG",
|
||||
"flightNo": "JG2719",
|
||||
},
|
||||
"airOptions": [
|
||||
{
|
||||
"optionNo": "AIR-OPT01",
|
||||
"airlineCode": "JG",
|
||||
"flightNo": "JG2719",
|
||||
},
|
||||
{
|
||||
"optionNo": "AIR-OPT02",
|
||||
"airlineCode": "RW",
|
||||
"flightNo": "RW633",
|
||||
},
|
||||
],
|
||||
},
|
||||
status="已报价",
|
||||
)
|
||||
calls: list[dict] = []
|
||||
orig = self.ledger.lock_cabin
|
||||
|
||||
def spy(**kwargs):
|
||||
calls.append(kwargs)
|
||||
return orig(**kwargs)
|
||||
|
||||
self.ledger.lock_cabin = spy # type: ignore
|
||||
phase = handle_air_group(
|
||||
self._msg(sender="air1", text=f"{wo}锁舱", chat="wr_air_lock_tms_auto", mid="tmsauto1"),
|
||||
flow=self.flow,
|
||||
ledger=self.ledger,
|
||||
injected_intent="air_lock",
|
||||
)
|
||||
self.assertEqual(phase, "lock_ok")
|
||||
self.assertEqual(len(calls), 1)
|
||||
self.assertEqual(calls[0].get("option_no"), "AIR-OPT01")
|
||||
self.assertEqual(calls[0].get("airline"), "JG")
|
||||
self.assertEqual(calls[0].get("flight_no"), "JG2719")
|
||||
self.assertFalse(any("锁舱参数不完整" in t for t in self._texts()))
|
||||
|
||||
def test_lock_missing_params_asks_and_does_not_call_tms(self) -> None:
|
||||
"""缺舱位、航司、航班号时只请补,不锁舱、不报 TMS 失败、不通知 IT。"""
|
||||
"""无舱位明细时缺三项才请补,不锁舱、不报 TMS 失败、不通知 IT。"""
|
||||
wo = self._create_air(
|
||||
quote={
|
||||
"total": "CNY 1800",
|
||||
|
||||
Reference in New Issue
Block a user