import { UbOverride } from './ub-utils'; export interface UbQuantityConstraintRules { quantity?: UbQuantityConstraint; overrides?: UbQuantityConstraintOverride[]; } export interface UbQuantityConstraint { /** Minimum quantity allowed (inclusive); Cannot be negative */ min_permitted?: number; /** Maximum quantity allowed (inclusive); cannot be less than min_permitted */ max_permitted?: number; /** must be between min_permitted and max_permitted (inclusive) */ default_quantity?: number; /** * When provided, the item price will only be charged per quantity unit in excess of this amount. * Can either be applied to an individual item or an entire modifier group. * - charge_above and refund_under must either both be null or both be non-null. * - Cannot be negative. * - Cannot be greater than max_permitted. * - Cannot be less than default_quantity. */ charge_above?: number; /** * When provided, the item price will be refunded per quantity unit chosen below this amount. * Can either be applied to an individual item or an entire modifier group. * - charge_above and refund_under must either both be null or both be non-null. * - Cannot be negative. * - Cannot be less than max_permitted. * - Cannot be greater than default_quantity. */ refund_under?: number; /** * Minimum quantity of unique customization selections allowed (inclusive). * - Cannot be negative. * - Can only be applied to modifier groups; * - Cannot be used for individual modifier options. */ min_permitted_unique?: number; /** * Maximum quantity of unique customization selections allowed (inclusive) * - Cannot be less than min_permitted_unique. * - Can only be applied to modifier groups; * - Cannot be used for individual modifier options. */ max_permitted_unique?: number; } export interface UbQuantityConstraintOverride extends UbOverride { quantity: UbQuantityConstraint; }