Skip to content

Remove completed_on column and add due_date to DaqbookServiceRecord#280

Merged
rhythmatician merged 8 commits intomainfrom
dev1
Feb 26, 2026
Merged

Remove completed_on column and add due_date to DaqbookServiceRecord#280
rhythmatician merged 8 commits intomainfrom
dev1

Conversation

@rhythmatician
Copy link
Contributor

Eliminate the redundant completed_on column from the DaqbookServiceRecord model and introduce a new due_date field. Additionally, implement a route to retrieve the latest service records and enhance validation for asset_tag in WireSetCert.

Copilot AI review requested due to automatic review settings February 26, 2026 00:15
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52afbc4f8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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 performs a schema refactoring of the DaqbookServiceRecord model by removing the redundant completed_on column and adding a new due_date field to track calibration due dates. It also introduces a new API endpoint to retrieve the latest service records per DAQBook asset, enhances validation in the WireSetCert model, and includes changes to work_item_details.py that have critical issues.

Changes:

  • Remove completed_on column from DaqbookServiceRecord and add due_date column with corresponding migrations
  • Create new /daqbook-service-records/latest/ endpoint to retrieve the most recent service record for each DAQBook
  • Add validation to ensure asset_tag is not None before parsing certificate documents in WireSetCert

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
utils/sync/daqbooks/models.py Replaces completed_on field with due_date, updates upsert logic to include due_date, and maps next_service_date from Qualer API to due_date
utils/schemas.py Adds DaqbookServiceRecordLatestSchema for the new endpoint response format
routes/daqbook_service_records.py New route file implementing the /daqbook-service-records/latest/ endpoint using DISTINCT ON to get latest records
migrations/versions/fe9f4dd27012_add_due_date_to_daqbookservicerecord_.py Migration to add the due_date column to daqbook_service_records table
migrations/versions/e0d468d53509_remove_completed_on_date_from_.py Migration to drop the redundant completed_on column
db/models/wire_set_cert.py Adds defensive validation check to ensure asset_tag is not None before parsing certificates
routes/work_item_details.py Changes asset_id parameter type and adds Never type check (contains critical bugs)
app.py Registers the new daqbook_service_records blueprint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rhythmatician rhythmatician enabled auto-merge (squash) February 26, 2026 00:33
@rhythmatician rhythmatician merged commit 208bcfe into main Feb 26, 2026
5 checks passed
@rhythmatician rhythmatician deleted the dev1 branch February 26, 2026 00:38
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