AmountValidation

sealed interface AmountValidation

Whether an amount can be bought for a given ecode, and when it cannot, why.

A boolean would answer only whether to enable the buy button; a purchase form also has to tell the member what to change, which is why each refusal carries the bound or the set that refused it.

Inheritors

Types

Link copied to clipboard
data class AboveMaximum(val maximum: Double) : AmountValidation

Above a range ecode's ceiling, including positive infinity.

Link copied to clipboard
data class BelowMinimum(val minimum: Double) : AmountValidation

Below a range ecode's floor.

Link copied to clipboard

Not one of a fixed-denomination ecode's amounts. Positive infinity is reported this way for a fixed ecode.

Link copied to clipboard

Zero, negative or not a number (NaN, negative infinity) - never a purchase, whatever the ecode allows.

Link copied to clipboard
data object Valid : AmountValidation

The amount can be submitted for checkout.