Skip to content

feat(monitor): add monitor device category (engine)#40

Merged
Seungpyo1007 merged 2 commits into
mainfrom
feat/monitor-category
Jul 8, 2026
Merged

feat(monitor): add monitor device category (engine)#40
Seungpyo1007 merged 2 commits into
mainfrom
feat/monitor-category

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

What & why

Adds a monitor device category to the engine, end-to-end — the second non-mobile class (after laptop). This is the engine half; the TechAPI data PR seeding data/monitor/ is paired and merges after this.

Design

  • brand FK required, no component FKs. Display specs (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; rating optional.
  • Unscored (like laptop/tablet): no /score endpoint, not in the dump SCORED set.

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 (seed data/monitor/) · app/dump.py (monitors in 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)
  • Manual: seed → /v1/monitors list/detail (size/resolution/refresh/panel/curvature), brand + panel_type filters, 404, app.dump writes v1/monitors/** + manifest entry (no scored). /v1/monitors present in OpenAPI. Existing endpoints unaffected.

…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.)
@Seungpyo1007 Seungpyo1007 merged commit bfdd4d9 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant