场景:家长测试号 401(属机构 26 红胜利)→ 机构 95「48B测试二店」扫家长码现场建孩子「转店测试1023」并录一条已完成检查记录 → 机构 26 扫同一家长码认领(转店)→ 核对两边权限。
表中「谁」:A = 机构 26·红胜利视光中心有限公司(转入方/认领方账号);B = 机构 95·48B测试二店(dev2验收用)(现场建档方账号)。
| 步骤 | 谁 | 请求 | 状态码 | 关键返回 | 期望 | 结果 |
|---|---|---|---|---|---|---|
| step0a-refresh-A | A | POST /api/seat/refresh | 200 | {} |
200 | PASS |
| step0b-refresh-B | B | POST /api/seat/refresh | 200 | {} |
200 | PASS |
| step1-B-resolve | B | POST /api/h5/brand-code-claim/family-scan/resolve | 200 | {"family_display_name": "留白", "children_count": 0} |
200 | PASS |
| step5-A-resolve-precheck | A | POST /api/h5/brand-code-claim/family-scan/resolve | 200 | {"family_display_name": "留白", "children_count": 0} |
200 | PASS |
| step2-B-create-child | B | POST /api/h5/brand-code-claim/family-scan/create-child | 201 | {"id": "a35824e2-7664-44cf-9d87-1e38baf16c45", "name": "转店测试1023", "owner_type": "parent"} |
201 | PASS |
| step3a-B-list-contains-X | B | GET /api/h5/refractive-records/patients?query=%E8%BD%AC%E5%BA%97%E6%B5%8B%E8%AF%951023&limit=20 | 200 | {"contains_X": true} |
True | PASS |
| step3b-A-list-contains-X | A | GET /api/h5/refractive-records/patients?query=%E8%BD%AC%E5%BA%97%E6%B5%8B%E8%AF%951023&limit=20 | 200 | {"contains_X": false} |
tech推导应为False(仅记录不计分) | 仅记录 |
| step4a-B-create-record | B | POST /api/h5/refractive-records/records | 201 | {"id": "dc2165fc-1bc5-4e76-84a7-a00369445032", "version": 1} |
201 | PASS |
| step4b-B-patch-record | B | PATCH /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | 200 | {"version": 2} |
200 | PASS |
| step4c-B-complete-record | B | POST /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032/complete | 200 | {"status": "completed", "warnings": ["双眼裸眼视力为完成必填"]} |
200 | PASS |
| step5b-A-resolve-check-current-org | A | POST /api/h5/brand-code-claim/family-scan/resolve | 200 | {"patient_id": "a35824e2-7664-44cf-9d87-1e38baf16c45", "service_org_name": "48B测试二店(dev2验收用)"} |
应为机构95名字:48B测试二店(dev2验收用) | PASS |
| step6-A-claim-force-transfer | A | POST /api/h5/brand-code-claim/family-scan/claim | 200 | {"service_org_id": 26, "service_org_name": "红胜利视光中心有限公司"} |
200 且 service_org_id==26 | PASS |
| step7a1-A-list-contains-X | A | GET /api/h5/refractive-records/patients?query=%E8%BD%AC%E5%BA%97%E6%B5%8B%E8%AF%951023&limit=20 | 200 | {"contains_X": true} |
True | PASS |
| step7a2-A-create-record-RA | A | POST /api/h5/refractive-records/records | 201 | {"id": "e7428c0c-4593-4b6d-a690-d76e89530122"} |
201 | PASS |
| step7b-B-list-not-contains-X | B | GET /api/h5/refractive-records/patients?query=%E8%BD%AC%E5%BA%97%E6%B5%8B%E8%AF%951023&limit=20 | 200 | {"contains_X": false} |
False | PASS |
| step7c-B-read-RB | B | GET /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | 200 | {"status_field": "completed"} |
200 | PASS |
| step7d-B-修改记录 | B | PATCH /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7d-B-完成 | B | POST /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032/complete | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7d-B-删除草稿壳 | B | DELETE /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7d-B-修改结论 | B | PATCH /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032/conclusion | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7d-B-推送结论 | B | POST /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032/conclusion/push | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7d-B-触发分析 | B | POST /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032/analysis | 404 | {"detail": "资源不存在"} |
404 | PASS |
| step7e-B-read-RA | B | GET /api/h5/refractive-records/records/e7428c0c-4593-4b6d-a690-d76e89530122 | 404 | {"raw_if_error": "{\"detail\":\"资源不存在\"}"} |
404 | PASS |
| step7f-A-read-RB | A | GET /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | 200 | {"status_field": "completed"} |
tech推导应为200(仅记录不计分) | 仅记录 |
step9 · 汇总: PASS=22 FAIL=0 RECORD(仅记录)=2 SKIPPED=0
主会话用 sudo db-query test 只读查出的原文:
patients: a35824e2-7664-44cf-9d87-1e38baf16c45 | 转店测试1023 | org_id=26 | service_org_id=26 | service_org_bound_at=2026-09-25 02:23:48.621441+00 | owner_type=parent | owner_seat_id=401
refractive_records:
dc2165fc-1bc5-4e76-84a7-a00369445032 | org_id=95 | completed | 2026-09-25 02:23:47.00947+00
e7428c0c-4593-4b6d-a690-d76e89530122 | org_id=26 | draft | 2026-09-25 02:23:49.31171+00
step4c 完成时返回的 warnings:原文 "warnings": ["双眼裸眼视力为完成必填"]。这是接口在完成检查记录时返回的业务提醒(提示该字段未填但仍允许完成),不代表接口失败,status=200 且 status="completed" 均正常。
step3b(仅记录)原文与含义:原文 step3b-A-list-contains-X | GET /api/h5/refractive-records/patients?query=%E8%BD%AC%E5%BA%97%E6%B5%8B%E8%AF%951023&limit=20 | status=200 | key_fields={"contains_X": false} | expected=tech推导应为False(仅记录不计分) | RECORD。含义:转店前,A(机构26)查询患者列表看不到该患者(contains_X=false),这与患者当前仍服务于机构95的事实一致;但该判据是 tech 方案推导出的预期,不是既有测试用例直接覆盖的断言,因此脚本标记为「仅记录」而不计入 PASS/FAIL 统计。
step7f(仅记录)原文与含义:原文 step7f-A-read-RB | GET /api/h5/refractive-records/records/dc2165fc-1bc5-4e76-84a7-a00369445032 | status=200 | key_fields={"status_field": "completed"} | expected=tech推导应为200(仅记录不计分) | RECORD。含义:转店完成后,A(现服务机构26)仍能读取到 B 此前建立的检查记录 RB(status=200,状态仍为 completed),这同样是 tech 方案推导出的预期,未被既有测试直接覆盖,故记为「仅记录」而不计入 PASS/FAIL 统计。