feat(export): single-budget Excel export, async customer client - #317
Merged
Merged
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 changebudget-feat-313-excel-export).customer_client.pyfromrequests+functools.lru_cachetohttpx.AsyncClientwith a manual LRU cache, wired intomain.py'slifespan(mirrorsuser_client.py's existing pattern); updates all callers and tests toawaitit.duration_monthsNone/0identically, drops a dead parameter, moves category/line ordering into SQL instead of Python, shares the start+duration date-math formula between_compute_end_dateand_period_label, simplifies redundantlimit=Nonebranches, and restores an auth rationale comment on/budgets/by-creator/{user_id}.Test plan
python -m pytest -qinservices/budget— 391 passedpython -m flake8 --max-line-length=100on touched files — cleanblack --check/mypyvia pre-push hook — clean🤖 Generated with Claude Code
closes #316