Skip to main content

feat: add working application and synthetic sample data

GBB Demo authored on Nov 2, 2026

commit b2393bcaf142

Root commit: changes are relative to an empty tree.

4 files changed, +34 −0

  • .gitignore+3 −0
    @@ -1,0 +1,3 @@
    1+__pycache__/
    2+node_modules/
    3+.env
  • README.md+5 −0
    @@ -1,0 +1,5 @@
    1+# Ledger Billing
    2+
    3+A synthetic invoice calculator using integer cents and explicit discount rules.
    4+
    5+Synthetic evaluation project.
  • app.py+11 −0
    @@ -1,0 +1,11 @@
    1+def invoice_total(items, discount_percent=0):
    2+ if not isinstance(discount_percent, int) or not 0 <= discount_percent <= 100:
    3+ raise ValueError("Discount must be an integer from 0 to 100")
    4+ subtotal = 0
    5+ for item in items:
    6+ price, quantity = item["unit_cents"], item["quantity"]
    7+ if not isinstance(price, int) or not isinstance(quantity, int) or price < 0 or quantity < 0:
    8+ raise ValueError("Price and quantity must be nonnegative integers")
    9+ subtotal += price * quantity
    10+ return (subtotal * (100 - discount_percent) + 50) // 100
    11+
  • data/sample.json+15 −0
    @@ -1,0 +1,15 @@
    1+{
    2+ "environment": "demo",
    3+ "items": [
    4+ {
    5+ "id": "sample-1",
    6+ "name": "Explore the source",
    7+ "done": true
    8+ },
    9+ {
    10+ "id": "sample-2",
    11+ "name": "Review the draft PR",
    12+ "done": false
    13+ }
    14+ ]
    15+}