Skip to content

Conversation

@PeterOche
Copy link
Contributor

Pull Request: Create Asset Maintenance and Service History Contract #375

Description

This PR implements the Asset Maintenance and Service History smart contract on Soroban. The contract provides a robust framework for tracking asset lifecycles, maintenance schedules, service provider activities, and warranty information with an emphasis on immutability and compliance.

Key Changes

  • New Contract: Initialized asset-maintenance contract within the workspace.
  • Data Structures: Implemented comprehensive structs for MaintenanceRecord, ScheduledMaintenance, ProviderProfile, WarrantyInfo, and MaintenanceAlert.
  • Core Functions:
    • Provider registration and deactivation.
    • Maintenance record submission with strict validation (cost, ratings, dates).
    • Automated and manual maintenance scheduling.
    • Warranty tracking and claim management.
    • Alert system for service dues and warranty expirations.
  • Business Logic:
    • Weighted Asset Health Score algorithm (considering quality, preventive ratio, and condition improvement).
    • Automated asset analytics for cumulative maintenance cost and downtime tracking.
  • Audit & Security: Role-based access control and detailed event logging for all state changes.

Verification

I have implemented a comprehensive test suite in src/test.rs that validates all core functions and business rules.

Test Results

running 4 tests
test test::test_warranty_and_claims ... ok
test test::test_alerts_and_stats ... ok
test test::test_init_and_provider_registration ... ok
test test::test_maintenance_lifecycle ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

Technical Specifications

  • Framework: Soroban SDK v22
  • Storage: Persistent storage strategy for large histories and provider registries.
  • Events: Unified event emission for auditability.

Closes #375

@vercel
Copy link

vercel bot commented Jan 22, 2026

Someone is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola merged commit ef23145 into DistinctCodes:main Jan 24, 2026
2 of 5 checks passed
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.

Create Asset Maintenance and Service History Contract

2 participants