Skip to content

feat: add querying and filtering (STIT-403,STIT-404)#52

Draft
mbarlow12 wants to merge 35 commits intomainfrom
feat/query-filter
Draft

feat: add querying and filtering (STIT-403,STIT-404)#52
mbarlow12 wants to merge 35 commits intomainfrom
feat/query-filter

Conversation

@mbarlow12
Copy link
Copy Markdown
Contributor

No description provided.

Unit tests with mocked query() are sufficient for router layer;
db action tests cover the actual pagination logic with real data.
- Routers construct DBQuery via pagination_to_db()
- ORM classmethods use TYPE_CHECKING import for DBQuery
- Fix lint issues from local imports
- Update router test assertions for new calling convention
- Cut 12 tests: dataclass constructor/default tests, Pydantic validation
  tests, and action function wrapper tests redundant with execute_query
- Parametrize ResourceModel.execute_query with seed fixture + test cases
- Seed fixtures for both models reduce setup duplication and make
  adding sorting/filtering test cases straightforward
…ssmethods

- New OGFieldQueryMixin declarative mixin owns shared OG field columns and
  async query/count classmethods (query, count, _base_query, _build_conditions,
  _apply_sort, _apply_pagination)
- ResourceCoalescedView inherits mixin, gets query for free
- OilGasFieldSourceModel inherits mixin, overrides _base_query to add
  membership join + ACTIVE filter
- Consolidate OGFieldResourceQueryParams/OGFieldSourceQueryParams into
  single OGFieldQueryParams
- Delete db/query.py — logic now lives in the mixin
- Actions modules become thin orchestrators delegating to mixin classmethods
…embership module

- Use PEP 695 inline TypeVar [QM: OGFieldQueryMixin] on Select-returning
  classmethods so parent and child share the same generic signature,
  resolving Select invariance issue without type: ignore
- Extract MembershipModel/MembershipStatus into membership.py to break
  circular import between oil_gas_field_source.py and resource.py
- Change MembershipModel.create() to accept resource_id: int instead of
  resource: ResourceModel, eliminating the bidirectional dependency
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