Problem
The reputation contract's composite scoring formula (0-1000 scale combining rating, punctuality, and reliability) has no test coverage. An incorrect calculation would corrupt carrier rankings and shipper trust scores across the entire platform with no automated detection.
Proposed Solution
Write a test suite for the reputation contract inside contracts/package/tests/reputation/ that verifies the scoring formula with exact expected values.
Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.
Acceptance Criteria
Problem
The reputation contract's composite scoring formula (0-1000 scale combining rating, punctuality, and reliability) has no test coverage. An incorrect calculation would corrupt carrier rankings and shipper trust scores across the entire platform with no automated detection.
Proposed Solution
Write a test suite for the reputation contract inside
contracts/package/tests/reputation/that verifies the scoring formula with exact expected values.Acceptance Criteria
add_rating: valid scores 1-5 succeed; scores 0 and 6 returnInvalidScoreDuplicateRatingget_reputation: returns the correct breakdown of all three score componentsupdate_stats: on-time percentage updates correctly after new dataassert_eq!calls use explicit expected values, not computed values (tests verify the formula, not re-implement it)