Untitled diff

作成日 差分は期限切れになりません
2つのテキストは同一です
これら2つのテキストの間に違いはありません行数: 9 · 差分: 0
0 削除
9 行
0 追加
9 行
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')
変更は検出されませんでした。