For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Ensure every Market mobile list, detail, create, and edit view displays Chinese business labels instead of internal user IDs, foreign-key IDs, or dictionary codes.
Architecture: Keep backend permission-scoped option lists unchanged, but hydrate each edit form with the current record's authoritative { value, label } snapshots so historical values remain readable. Centralize frontend display fallback rules so unresolved references render 未知人员 or —, never raw IDs/codes, and enrich sample handling responses with handler names at the backend boundary.
Tech Stack: Vue 3, Vant, JavaScript Node test runner, FastAPI, SQLAlchemy, pytest.
Files:
mobile-oa-h5/src/market/reference-options.test.jsmobile-oa-h5/src/market/module-contracts.test.jsmobile-oa-h5/src/market/list-presenter.test.jsModify: backend/tests/test_market_sample_api.py
[ ] Step 1: Write failing frontend tests
Add tests proving selected user, region, hospital, sample type, sample code, and unit values are merged into scoped option sets from detail label fields. Assert protocol/sample/freight detail presenters never fall back to IDs or dictionary codes.
Run: node --test src/market/reference-options.test.js src/market/module-contracts.test.js src/market/list-presenter.test.js
Expected: FAIL because reference-option hydration and safe label fallbacks do not yet exist.
Extend sample API tests so get_sample_detail returns handlerUserName for storage-certificate and insurance summaries and get_sample_form_options retains the currently selected handler as a readable option without widening normal region staff choices.
Run: backend/venv/bin/pytest backend/tests/test_market_sample_api.py -q
Expected: FAIL on missing handler display names/current selected options.
Files:
mobile-oa-h5/src/market/reference-options.jsmobile-oa-h5/src/views/market/MarketModuleForm.vueModify: mobile-oa-h5/src/views/market/presign/PresignOrderForm.vue
[ ] Step 1: Implement minimal hydration helpers
Create pure helpers that merge scoped options with current detail snapshots, deduplicate by normalized value, and only add entries with a real human-readable label.
For protocol fields, merge current collector, sales specialist, manager, region, hospital, sample type, sample code, and unit labels. For sample handling, merge the current handler name. Reapply hydration after region cascade option refreshes.
Reuse the shared person-option merge behavior and render 未知人员 rather than the raw selected ID if the backend cannot resolve a name.
Run: node --test src/market/reference-options.test.js src/market/module-contracts.test.js src/market/list-presenter.test.js src/market/presign/presign-form-state.test.js src/market/presign/presign-form-view.test.js
Expected: all tests pass.
Files:
backend/app/services/market_sample.pyModify: backend/tests/test_market_sample_api.py
[ ] Step 1: Resolve handler names in sample detail summaries
Batch-load tenant user display names for storage-certificate and insurance handler IDs and expose them as handlerUserName.
Append only the handler already referenced by the accessible sample record when it is outside the active region-staff list; do not expose unrelated tenant users.
Run: backend/venv/bin/pytest backend/tests/test_market_sample_api.py -q
Expected: all tests pass.
Files:
mobile-oa-h5/src/market/modules/protocol.jsmobile-oa-h5/src/market/modules/sample.jsmobile-oa-h5/src/market/modules/freight.jsmobile-oa-h5/src/market/list-presenter.jsModify: backend/app/services/market_freight.py
[ ] Step 1: Replace person-ID fallbacks
Display authoritative name fields, 未知人员 for a non-empty unresolved person reference, and — when no reference exists.
For status, source, payment mode, transport mode, sex, and delivery mode, use known Chinese mappings and render 未知 for an unrecognized non-empty code instead of exposing the code.
Do not alter protocol numbers, sample codes, freight batch numbers, laboratory storage codes, or other user-facing business identifiers.
Run: node --test src/market/list-presenter.test.js src/market/module-contracts.test.js src/market/mobile-parity-ui.test.js
Expected: all tests pass.
Files:
Modify generated graph files under backend/graphify-out/ only through the repository script.
[ ] Step 1: Run all mobile Market tests
Run: node --test src/market/*.test.js src/market/presign/*.test.js src/utils/download-attachment.test.js src/utils/http-error.test.js
Expected: zero failures.
Run: npm run build
Expected: Vite exits with code 0.
Run: backend/venv/bin/pytest backend/tests/test_market_sample_api.py backend/tests/test_market_protocol_api.py backend/tests/test_market_support_api.py backend/tests/test_market_freight_scope.py -q
Expected: zero failures.
Run: ./scripts/update-graph.sh backend
Expected: graph update exits with code 0.
Open specialist and manager protocol edit, pre-sign edit, sample handling, payment/chase detail, and freight detail. Confirm reference fields show Chinese labels, no internal UUID/user ID/dictionary code is visible, and valid business identifiers remain unchanged.