Skip to content

feat(export): single-budget Excel export, async customer client - #317

Merged
arutsh merged 4 commits into
mainfrom
Budget/feat/Issue-316/excel-export-group1
Sep 23, 2026
Merged

arutsh merged 4 commits into
mainfrom
Budget/feat/Issue-316/excel-export-group1

Conversation

@arutsh

@arutsh arutsh commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds excel_export_service.py, building Sheet 1 (Original Budget) of the export workbook from a budget's categories/lines, with formula-linked summary/detail/footer sections (group 1 of issue excel-export: Export endpoint scaffolding + Sheet 1 (Original Budget) (group 1) #316 / OpenSpec change budget-feat-313-excel-export).
  • Converts customer_client.py from requests + functools.lru_cache to httpx.AsyncClient with a manual LRU cache, wired into main.py's lifespan (mirrors user_client.py's existing pattern); updates all callers and tests to await it.
  • Applies several code-review fixes: guards external service calls in the export path, treats duration_months None/0 identically, drops a dead parameter, moves category/line ordering into SQL instead of Python, shares the start+duration date-math formula between _compute_end_date and _period_label, simplifies redundant limit=None branches, and restores an auth rationale comment on /budgets/by-creator/{user_id}.

Test plan

  • python -m pytest -q in services/budget — 391 passed
  • python -m flake8 --max-line-length=100 on touched files — clean
  • black --check / mypy via pre-push hook — clean

🤖 Generated with Claude Code

closes #316

arutsh and others added 2 commits September 23, 2026 13:08
- excel_export_service.py builds Sheet 1 (Original Budget) from a budget's
  categories/lines, with formula-linked summary/detail/footer sections
- customer_client.py converted from requests+lru_cache to httpx.AsyncClient
  with a manual LRU cache, wired into main.py's lifespan (matches
  user_client.py's existing pattern); all callers/tests updated to await it
- code-review fixes: guard external service calls in the export path,
  treat duration_months None/0 identically, drop dead rate_cell param,
  order budget categories/lines by created_at/id in SQL instead of
  re-sorting in Python, share the start+duration date-math formula
  between _compute_end_date and _period_label, simplify redundant
  limit=None branches, restore the auth rationale comment on
  /budgets/by-creator/{user_id}

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Pre-push hook's black --check caught formatting drift in the two files
touched by the previous commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
grant-flow Ready Ready Preview Sep 23, 2026 1:15pm UTC

CI's mypy caught three arg-type errors not surfaced by the local
pre-push cache: annotate categories_by_id/ordered_category_ids as
UUID | None (category_id is a nullable FK), and assert owner_id is
not None before the get_customer_cached call, matching the same
idiom already used for owner_id elsewhere in this file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… implement subclasses for budget, dashboard, and expense list sheets
@arutsh
arutsh merged commit 0349a2c into main Sep 23, 2026
26 of 28 checks passed
@arutsh
arutsh deleted the Budget/feat/Issue-316/excel-export-group1 branch September 25, 2026 09:29

This branch was successfully deployed

1 active deployment
Preview — ffa95063 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

excel-export: Export endpoint scaffolding + Sheet 1 (Original Budget) (group 1)

1 participant