in lambda-powertools-feature-flags/app/products/app.py [0:0]
def add_discount(input_products: List[Dict]) -> List[Dict]:
discount_flag: bool = feature_flags.evaluate(name="discount", default=False)
has_premium_features: bool = feature_flags.evaluate(name="premium_features",
context=ctx,
default=False)
discount = {}
if discount_flag:
discount = {"discount": "10%"}
if has_premium_features:
discount = {"discount": "20%"}
return [{**x, **discount} for x in input_products]