Repository navigation
Bosu - Add Equipment Status History and Validation Support backend - #2470
Open
BosuBose132 wants to merge 6 commits into
Open
BosuBose132 wants to merge 6 commits into
BosuBose132 wants to merge 6 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…atus update Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
$push bypasses schema validators, so arbitrary condition strings were persisted. Accept only Good / Needs Repair / Out of Order, mapping legacy UI labels to them; reject anything else with 400. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This branch has not been deployed
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.



Overview
Enhanced the Building Management Equipment backend to support historical status updates, smart-default data retrieval, replacement validation, authenticated user attribution, and consistent equipment status handling.
These changes support the frontend Tool Status Update Form enhancements while improving data integrity, response handling, and test coverage.

Original Task Requirements Supported
The backend changes support the following Tool Status Update Form requirements:
Related Frontend PR
This is related to frontend PR #5782
The frontend PR implements the corresponding UI enhancements, smart defaults, history summary, validation feedback, and submission confirmation.
Changes Implemented
Equipment Status History
Validation and Data Integrity
Authentication and Submission Handling
Automated Tests
Testing Performed
Feature-Specific Tests
git diff --check: Passed.Known Upstream Test-Suite Failure
The broader backend pre-commit test selection reports 30 failures in
bmMaterialsController.test.js.To determine whether the feature introduced these failures, I ran equivalent test selections against both the feature branch and a clean
origin/developmentbaseline (985e7aec6).Results on both branches were identical:
The materials-controller suite also passed independently on both branches (84/84 tests).
This confirms that the broader test-selection failure reproduces on the development baseline and is not specific to the equipment feature. The behavior appears related to shared test context, mock isolation, or test execution order. The underlying cause has not yet been fully identified.
No unrelated materials-controller implementation or test files were modified.
The issue may still affect CI and should be tracked independently by backend maintainers.
How to Test
Known Limitations / Reviewer Notes
Status Mapping — Requires Product Approval
Some distinct frontend status options map to the same backend canonical value:
Stolen/Lost→Out of OrderEnd of life→Out of OrderReturned→GoodWorking well→GoodThese mappings maintain compatibility with the existing backend schema but do not preserve all original business meanings.
Project-lead confirmation is required before merge to determine whether the canonical statuses are acceptable or the data model should be extended.
Image Persistence
The current change does not introduce image-storage support. Image handling remains preview-only on the frontend.
Historical Records
Existing historical records are not migrated.
Screenshots / Demo
Screen.Recording.2026-11-05.at.3.54.22.PM.mov