Repository navigation
fix: resolve audit/maintenance issues - #1559
Merged
yusuftomilola merged 1 commit intoSep 26, 2026
Merged
yusuftomilola merged 1 commit into
yusuftomilola merged 1 commit into
Conversation
|
@Mkalbani is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Mkalbani Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…s#1474 DistinctCodes#1475 DistinctCodes#1476 - DistinctCodes#1473: Clarify distinction between audit-log (system change tracking) and audits (physical stocktake) - DistinctCodes#1474: Add technician_id to MaintenanceCompleted event for complete audit trail - DistinctCodes#1475: Add upper bound validation on maintenance costs - DistinctCodes#1476: Add test for unauthorized maintenance logging attempt
Mkalbani
force-pushed
the
feat/audit-maintenance-improvements
branch
from
September 26, 2026 13:02
e117811 to
2061c93
Compare
yusuftomilola
approved these changes
Sep 26, 2026
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
Resolves issues #1473, #1474, #1475, and #1476 with minimal, efficient improvements to audit and maintenance systems.
Issues Fixed
#1473 - Unclear distinction between audit-log and audits dashboard pages
Problem: Overlapping page names with no explanation of differences.
Solution: Added clear documentation and cross-references to distinguish:
#1474 - Maintenance events don't record the technician's identity
Problem:
MaintenanceCompletedevents lacked technician identity, weakening on-chain audit trail.Solution: Added
technician_id: Stringfield toMaintenanceCompletedevent struct and updated the event emission to include technician data from the maintenance record.#1475 - No upper bound check on logged maintenance cost
Problem: Maintenance costs weren't validated for upper limits, allowing extreme values.
Solution: Added validation check with max bound of
999_999_999_999onlabor_cost,parts_cost, andtotal_costto prevent malformed or extreme numbers from skewing calculations.#1476 - No test for unauthorized maintenance logging
Problem: No coverage for unauthorized callers attempting to log maintenance entries.
Solution: Added
test_unauthorized_maintenance_logging()test that verifies an unauthorized provider address fails authentication when attempting to add a maintenance record.Changes
contracts/asset-maintenance/src/events.rs: EnhancedMaintenanceCompletedstruct with technician trackingcontracts/asset-maintenance/src/lib.rs: Added cost upper bound validationcontracts/asset-maintenance/src/test.rs: Added unauthorized access testfrontend/app/(dashboard)/audit-log/page.tsx: Added documentation and clarification textfrontend/app/(dashboard)/audits/page.tsx: Added documentation and cross-referenceTesting
All changes are minimal and focused:
Closes #1473
Closes #1474
Closes #1475
Closes #1476