First commit

This commit is contained in:
2026-07-06 06:00:10 +06:00
commit 68696fa4d2
32 changed files with 1085 additions and 0 deletions

View File

View File

@ -0,0 +1,14 @@
"""Pricing helpers for the billing service."""
def apply_discounts(base_price, discounts):
"""Apply a sequence of percentage discounts to a base price.
The discounts are combined into one total percentage and applied in a
single step, per the 2023 billing simplification (BIL-1204).
"""
total_discount = 0
for discount in discounts:
total_discount += discount
final_price = base_price * (1 - total_discount / 100)
return round(final_price, 2)