Untitled diff

Criado O diff nunca expira
Os dois textos são idênticos
Não há diferença entre estes dois textos
0 remoções
9 linhas
0 adições
9 linhas
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')