Home > widget-integration > TierDiscountService > enrichModelWithComputedProperties

TierDiscountService.enrichModelWithComputedProperties() method

Enriches model with computed UI properties. Extension point for adding custom computed properties.

Signature:

protected enrichModelWithComputedProperties(properties: TierDiscountModelProperties): TierDiscountModel;

Parameters

Parameter

Type

Description

properties

TierDiscountModelProperties

Returns:

TierDiscountModel

Model with additional computed properties

Example

protected enrichModelWithComputedProperties(model: TierDiscountModel): TierDiscountModel {
  const enriched = super.enrichModelWithComputedProperties(model);
  enriched.properties.estimatedSavings = this.calculateEstimatedSavings(enriched);
  return enriched;
}