Untitled diff

Created Diff never expires
The two texts are identical
There is no difference to show between these two texts
0 removals
9 lines
0 additions
9 lines
def calculate_user_discount(user: User, order: Order) -> Decimal:
def calculate_user_discount(user: User, order: Order) -> Decimal:
if user.is_premium and order.total > 1000:
if user.is_premium and order.total > 1000:
return order.total * Decimal('0.15')
return order.total * Decimal('0.15')
elif user.is_premium:
elif user.is_premium:
return order.total * Decimal('0.10')
return order.total * Decimal('0.10')
elif order.total > 1000:
elif order.total > 1000:
return order.total * Decimal('0.05')
return order.total * Decimal('0.05')
else:
else:
return Decimal('0')
return Decimal('0')