feat(pilot): 临床科研申请单增加必填渠道
开通 showChannel,保存校验并回写 channel_id/name;表单/列表/详情展示渠道,不绑定服务订单。用户确认免除 Figma。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e741b1284
commit
9242ed0538
6 files changed
+103
-15
No files matched your search
@@ -29,6 +29,7 @@ class TestBasicExperimentCreateValidation(unittest.TestCase):
|
||||
data = {
|
||||
"bizType": "basic_experiment",
|
||||
"researchCategory": "bio_tech_clinical",
|
||||
"channelId": "ch-1",
|
||||
"projectTitle": "课题A",
|
||||
"customerName": "",
|
||||
"customerContact": "张三",
|
||||
@@ -48,6 +49,7 @@ class TestBasicExperimentCreateValidation(unittest.TestCase):
|
||||
db = MagicMock()
|
||||
data = {
|
||||
"bizType": "basic_experiment",
|
||||
"channelId": "ch-1",
|
||||
"projectTitle": "课题A",
|
||||
"customerName": "客户A",
|
||||
"customerContact": "张三",
|
||||
@@ -63,6 +65,26 @@ class TestBasicExperimentCreateValidation(unittest.TestCase):
|
||||
)
|
||||
self.assertIn("业务类型", str(ctx.exception))
|
||||
|
||||
def test_create_basic_experiment_requires_channel(self):
|
||||
db = MagicMock()
|
||||
data = {
|
||||
"bizType": "basic_experiment",
|
||||
"researchCategory": "bio_tech_clinical",
|
||||
"projectTitle": "课题A",
|
||||
"customerName": "客户A",
|
||||
"customerContact": "张三",
|
||||
"customerPhone": "13800000000",
|
||||
}
|
||||
with self.assertRaises(ValueError) as ctx:
|
||||
crud.create_application(
|
||||
db,
|
||||
data=data,
|
||||
tenant_no="zkxw",
|
||||
user_id="user-1",
|
||||
dept_id="dept-1",
|
||||
)
|
||||
self.assertIn("渠道", str(ctx.exception))
|
||||
|
||||
|
||||
class TestBasicExperimentSaleSchedules(unittest.TestCase):
|
||||
@patch("app.crud.pilot_application.create_schedule")
|
||||
|
||||
Reference in new issue
Block a user