Skip to main content

Version Docs Updated

Purpose

This page documents how commission rates are determined, how versioned policies (PolicyService) work, and how performance incentives (TierService) operate.

🏷️ Commission and Policy System

MHM Rentiva uses a multi-layered, deterministic Commission Resolution Hierarchy to calculate commission rates. The system supports both global rules and custom commercial agreements (Overrides).

πŸ“‰ Resolution Hierarchy​

CommissionResolver determines which rate applies to a booking through a 4-level check, from most specific to most general:

PriorityLevelMeta / SourceDescription
1Vehicle Override_mhm_vendor_commission_rateIf a specific rate is assigned to the vehicle itself, it takes highest priority.
2Vendor Override_mhm_vendor_commission_rateIf a specific rate is assigned to the vendor user (and no Vehicle override exists), it applies.
3Tier IncentiveTierServiceAn additional discount is applied on top of the Global rate based on the vendor's performance over the last 30 days.
4Global PolicyCommissionPolicyIf no other rule matches, the system's default policy rate is applied.

🌳 Commission Resolution Decision Tree​


πŸ“œ Policy Versioning and Auditing​

Every commission rate in the system is bound to a Policy object (MHMRentiva\Core\Financial\CommissionPolicy).

  • Immutable Hash: A unique version_hash is generated on each policy change.
  • Audit Consistency: When a Ledger entry is created, the current policy_id and version_hash are stamped onto the record. This proves why a particular rate was used even 2 years later.
  • Time-based Resolution: The PolicyService::resolve_policy_at() method finds the policy that was active at the time the booking was created. Retroactive updates do not break old records.

πŸ’Ž Tier and Incentive System​

TierService is designed to reward vendors with high sales volume:

  • Net Revenue Check: Calculated from the "Cleared" balance over the last 30 days.
  • Additive Discount: The Tier discount applies only on top of the Global Policy. Vendors with a custom agreement (Override) cannot additionally benefit from the Tier discount.

Section Summary​

  • Resolution order: Vehicle > Vendor > Tier > Global.
  • All decisions are based on deterministic and versioned policies.
  • A policy snapshot is captured with every calculation for financial auditing.

Changelog​

DateVersionNote
23.04.20264.27.2English translation added.
19.03.20264.21.2Page updated with 4-level hierarchy and Tier discount logic.