Skip to content

BDMS-500: Implement read-only admin view for NMAWaterLevelsContinuousPressureDaily#439

Closed
ksmuczynski wants to merge 14 commits intostagingfrom
kas-bdms-500-admin-view-WLContinuousDaily
Closed

BDMS-500: Implement read-only admin view for NMAWaterLevelsContinuousPressureDaily#439
ksmuczynski wants to merge 14 commits intostagingfrom
kas-bdms-500-admin-view-WLContinuousDaily

Conversation

@ksmuczynski
Copy link
Contributor

Why

This PR addresses the following problem / context:

  • Provide admin access to legacy NMA water levels continuous pressure daily data
  • Align the legacy model with UUID-based identifiers for GlobalID and WellID

How

Implementation summary - the following was changed / added / removed:

  • Updated NMA_WaterLevelsContinuous_Pressure_Daily model to map GlobalID and WellID as UUIDs
  • Added a read-only Starlette Admin view with full legacy-order list/detail fields for NMA_WaterLevelsContinuous_Pressure_Daily
  • Registered the new view in the admin views package and wired it into admin configuration
  • Updated water levels pressure daily tests for UUID IDs

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Tests not run (admin UI only)

…uous_Pressure_Daily

Context: updates db/nma_legacy.py to map GlobalID and WellID as UUID(as_uuid=True) and documents the WellID FK to Thing for the continuous pressure daily model.
- Define read-only Starlette Admin view with full legacy-order fields
- Register view in admin/views/__init__.py and admin/config.py
…acy.py for UUID IDs

- Updated the test helper to return UUIDs for GlobalID and WellID in legacy model tests
- Changed well_id to use a UUID so it matches the model mapping.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a read-only admin interface for legacy NMA water levels continuous pressure daily data and updates the underlying model to use UUID-based identifiers instead of strings.

Changes:

  • Updated NMA_WaterLevelsContinuous_Pressure_Daily model to use UUID types for GlobalID and WellID fields
  • Added a new read-only Starlette Admin view (WaterLevelsContinuousPressureDailyAdmin) with comprehensive list and detail field configurations
  • Updated corresponding test fixtures to generate and use UUID values

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
db/nma_legacy.py Changed global_id and well_id from String to UUID type mappings
admin/views/waterlevelscontinuous_pressure_daily.py Created new read-only admin view with field configurations and display labels
admin/views/init.py Exported the new admin view class
admin/config.py Registered the new admin view with the NMA model
tests/test_waterlevelscontinuous_pressure_daily_legacy.py Updated test helper and test data to use UUID instead of string

Copilot AI review requested due to automatic review settings January 29, 2026 17:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings January 29, 2026 17:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

db/nma_legacy.py:232

  • The well_id field was removed from NMA_HydraulicsData but appears to be orphaned code. If this removal was intentional as part of cleanup, ensure this deletion aligns with the model's current schema and usage.
    well_id: Mapped[Optional[uuid.UUID]] = mapped_column("WellID", UUID(as_uuid=True))

Copilot AI review requested due to automatic review settings January 29, 2026 17:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

@ksmuczynski ksmuczynski marked this pull request as draft January 29, 2026 17:35
- Added migrations for thing_id FK and UUID column alignment
- Updated pressure daily legacy tests for Thing linkage and FK enforcement
- Cache Thing IDs and map PointID to thing_id to satisfy new FK
- Filter orphan rows to prevent invalid inserts
- Add focused transfer unit test to validate mapping and filtering
@ksmuczynski ksmuczynski requested a review from Copilot January 29, 2026 20:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

tests/test_waterlevelscontinuous_pressure_daily_legacy.py:2

  • The copyright year is set to 2026, which is in the future. Update this to the current year or the actual year when this code was written.
# Copyright 2026 ross

@ksmuczynski ksmuczynski marked this pull request as ready for review January 29, 2026 20:28
@jirhiker
Copy link
Member

I merged these changes directly into my PR #450 and linearized the alembic migrations.

@jirhiker jirhiker closed this Jan 30, 2026
@TylerAdamMartinez TylerAdamMartinez deleted the kas-bdms-500-admin-view-WLContinuousDaily branch February 5, 2026 18:12
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.

2 participants