feat(monitor): add monitor device category (engine)#40
Merged
Conversation
…p, validate) Second non-mobile device category, wired end-to-end like laptops: - app/models/monitor.py — Monitor table; brand FK required. Display specs (size_inch, resolution, aspect_ratio, refresh_hz, panel_type, curvature, hdr, ppi) as first-class fields. Unscored. - app/schemas/monitor.py + serializer monitor_read — detail response embeds brand; no score field. - app/routers/monitors.py — list + detail with brand/panel_type filters and size/refresh sort keys. - app/main.py — register the router. - app/seed.py — seed data/monitor/, resolve brand FK. - app/dump.py — add "monitors" to COLLECTIONS (not SCORED). - app/validate.py — MONITOR_REQUIRED + ranges (size 5-120, refresh 24-1000, msrp 10-50000, rating 0-5) + brand FK + variant path. - tests: monitor fixtures + integration tests. Paired with the TechAPI data PR seeding data/monitor/.
test_list_laptops/test_list_monitors asserted the fixture appeared in the unpaginated first page — which breaks once real laptop/monitor data fills the list (the fixture is buried past page 1). Filter by the fixture's unique base_model_slug instead. (Latent since the laptop data merged; surfaced by this PR running pytest against the full dataset.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds a
monitordevice category to the engine, end-to-end — the second non-mobile class (afterlaptop). This is the engine half; the TechAPI data PR seedingdata/monitor/is paired and merges after this.Design
size_inch,resolution,aspect_ratio,refresh_hz,panel_type,curvature,hdr,ppi) are first-class fields;features(ports/speakers/adaptive-sync) is a JSON blob;ratingoptional./scoreendpoint, not in the dumpSCOREDset.Changes
app/models/monitor.py(new table) ·models/__init__.py·app/schemas/monitor.py+serializers.monitor_read+schemas/__init__.py·app/routers/monitors.py(filters: brand, panel_type; sort: name/release_date/msrp/size_inch/refresh_hz) +app/main.py·app/seed.py(seeddata/monitor/) ·app/dump.py(monitorsin COLLECTIONS) ·app/validate.py(MONITOR_REQUIRED+ ranges size 5–120, refresh 24–1000, msrp 10–50000, rating 0–5 + brand FK + variant path) ·tests/integration/{monitor_fixtures,test_monitors}.py.Verification
ruff check app tests✅ ·mypy app✅ (92 files)pytest tests/integration/test_monitors.py✅ (4 tests)/v1/monitorslist/detail (size/resolution/refresh/panel/curvature), brand + panel_type filters, 404,app.dumpwritesv1/monitors/**+ manifest entry (noscored)./v1/monitorspresent in OpenAPI. Existing endpoints unaffected.