OnSmallestValueAllocation

Allocates the Money difference on the item with the smallest value in the allocations list.

This allocation strategy tries to prevent the creation of negative values in the allocations list when the difference is negative. If the difference is positive, it tries to eliminate any negative value available in the list.

Inheritors

Functions

Link copied to clipboard
open override fun allocate(difference: Money, allocations: List<Money>): List<Money>

Allocates the difference in the allocations list.

Link copied to clipboard
abstract fun applyDifferenceOnValue(difference: Money, value: Money, allocations: List<Money>): List<Money>

Apply the difference in a specific value in the allocations list.