Refactor: Move dataclasses from routes/models.py to resources/ - #591
Merged
Conversation
Replace the single seam/routes/models.py with a seam/resources package that exports one dataclass per module, and move each abstract route class next to the concrete route class it describes. - seam/resources/<resource>.py holds one dataclass each, re-exported from seam/resources/__init__.py - seam/routes/<namespace>.py now defines AbstractX alongside X, and seam/routes/__init__.py defines AbstractRoutes alongside Routes - AbstractSeamHttpClient moves from seam/models.py to seam/client.py so that seam.client no longer imports seam.models, which would otherwise cycle through seam.routes - Codegen emits the new layout: models.hbs is replaced by resource.hbs and resources-index.hbs, and the models layout context becomes resources.ts Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MNpvDnkB6xgtjBT4bnPZzC
razor-x
marked this pull request as ready for review
July 27, 2026 23:45
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.
Summary
This PR refactors the codebase to reorganize dataclass definitions by moving them from a monolithic
seam/routes/models.pyfile into individual modules under a newseam/resources/package. Abstract route classes are now defined inline within their respective route modules rather than in a centralized models file.Key Changes
seam/routes/models.py: Deleted the 3640-line monolithic models file that contained all dataclass definitions and abstract route classesseam/resources/package: New package structure with individual dataclass modules:AccessCode,Device,AcsUser,AcsSystem,Workspace,SeamEvent, etc.ActionAttempt,Pagination@dataclassdecorator andDeepAttrDictutilityAbstractAccessCodes,AbstractThermostats) are now defined directly in their corresponding route modules usingabc.ABCseam.resourcesinstead ofseam.routes.modelscodegen/lib/layouts/models.tscodegen/lib/layouts/resources.tsto generate individual resource modulescodegen/smith.tsto clean up both routes and resources directoriesImplementation Details
seam/resources/device.py,seam/resources/access_code.py)seam/resources/__init__.pyfor convenient importingabcmodule with@abc.abstractmethoddecorators__init__.pyexporthttps://claude.ai/code/session_01MNpvDnkB6xgtjBT4bnPZzC