后台成本价、销售价、利润点按费用逐行展示,费用合计用报价官方总价。选完线路只关页面。报价单文件名带上模板名,空运起运地和转人工跟对应工单走。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -711,5 +711,69 @@ class LandSkipAfterRestartTests(unittest.TestCase):
|
||||
self.assertIn(f"{wo}报价方案", joined)
|
||||
|
||||
|
||||
class LandContinuePullCardTests(unittest.TestCase):
|
||||
def test_tms_miss_resume_shows_pull_card(self) -> None:
|
||||
"""陆运没查到价时继续工单,要再出「是否拉产品进群」卡,不能出空运无价卡。"""
|
||||
flow = LandTextInquiryFlow(MemoryLedger())
|
||||
flow._save(
|
||||
FlowSession(
|
||||
sender_id="land-miss",
|
||||
thread_id="land-miss",
|
||||
phase="tms_miss",
|
||||
business_line="LAND",
|
||||
work_order_no="WO202610040004",
|
||||
status="询价中",
|
||||
allowed=(copy.BTN_PULL_COLLAB,),
|
||||
)
|
||||
)
|
||||
replies: list[str] = []
|
||||
extras: list[dict] = []
|
||||
|
||||
def reply(text: str, extra=None) -> str:
|
||||
replies.append(text)
|
||||
extras.append(dict(extra) if extra else {})
|
||||
return ""
|
||||
|
||||
phase = flow.resume_historical(
|
||||
sender_id="land-miss", work_order_no="WO202610040004", reply=reply
|
||||
)
|
||||
self.assertEqual(phase, "tms_miss")
|
||||
joined = "\n".join(replies)
|
||||
self.assertIn("是否需要拉内部产品人员进群", joined)
|
||||
self.assertIn(copy.BTN_PULL_COLLAB, joined)
|
||||
buttons = (extras[-1].get("template_card") or {}).get("button_list") or []
|
||||
self.assertTrue(any(copy.BTN_PULL_COLLAB == b.get("text") for b in buttons))
|
||||
|
||||
def test_priced_resume_shows_pull_card(self) -> None:
|
||||
"""陆运已有价、还在问要不要拉群时,继续工单要出带拉群按钮的价格卡。"""
|
||||
flow = LandTextInquiryFlow(MemoryLedger())
|
||||
flow._save(
|
||||
FlowSession(
|
||||
sender_id="land-hit",
|
||||
thread_id="land-hit",
|
||||
phase="wait_collab",
|
||||
business_line="LAND",
|
||||
work_order_no="WO202610040004",
|
||||
status="已报价",
|
||||
quote={"total": "CNY 800", "source_label": "TMS 标准报价"},
|
||||
allowed=(copy.BTN_PULL_COLLAB, copy.BTN_SKIP_COLLAB),
|
||||
)
|
||||
)
|
||||
replies: list[str] = []
|
||||
|
||||
def reply(text: str, extra=None) -> str:
|
||||
replies.append(text)
|
||||
_ = extra
|
||||
return ""
|
||||
|
||||
phase = flow.resume_historical(
|
||||
sender_id="land-hit", work_order_no="WO202610040004", reply=reply
|
||||
)
|
||||
self.assertEqual(phase, "wait_collab")
|
||||
joined = "\n".join(replies)
|
||||
self.assertIn("是否拉产品人员进群协同", joined)
|
||||
self.assertIn(copy.BTN_PULL_COLLAB, joined)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user