← All Reports
Dev Sprint 4 Report
Budget Tracking, Spending Breakdown, Household Management, Recurring Items
Overview
Sprint 4 delivered budget tracking and household management for Pantry App. Users can now view monthly grocery spend against a configurable budget, see spending breakdowns by store and category, manage household members and permissions, and set up recurring items for automatic restocking of staples.
The sprint introduced one new database table (recurring_items) with full RLS policies. Budget and spending features query existing budget_periods and receipts tables. Household management uses household_members with role-based access control. All 26 Sprint 3 tests continue to pass, with 4 new integration tests added covering budget queries, category breakdowns, member management, and recurring item workflows.
A pre-sprint fix enabled the Budget route in the navigation, which had been disabled since Sprint 2. All four stories passed triple-gate code review and UX validation confirmed the recurring items flow completes in 2-3 taps.
Deliverables
| ID |
Story |
Detail |
Status |
| NAV-FIX | Enable Budget Route | Removed disabled: true and badge: 'Sprint 4' from Budget nav item in AuthLayout.jsx | Done |
| BUD-001 | Monthly Budget Tracker | Month navigation, budget summary card with colour-coded progress bar (green/amber/terracotta), inline budget editing, receipts list with expandable item detail | Done |
| BUD-002 | Spending Breakdown | By-store and by-category horizontal bar charts (pure CSS, no chart library), derived from receipts.items JSONB, sorted descending with percentage labels | Done |
| HSH-002 | Household Member Management | Household name inline edit, members list with role badges (Manager/Member), action menu for role changes and removal with confirmation, current user row protected | Done |
| HSH-003 | Recurring Items | New recurring_items table with RLS, recurring items list on /settings with frequency badges, "Stock now" button, add/edit/delete forms, overdue highlighting | Done |
Key Decisions
Pure CSS Charts
Spending breakdown charts use CSS width percentages and flexbox rather than a chart library. This keeps bundle size small and avoids adding a dependency for a single feature.
Recurring Items RLS
The recurring_items table uses the existing get_user_household_ids() function for row-level security, consistent with all other household-scoped tables.
JSONB Category Aggregation
Category spending totals are derived client-side from the receipts.items JSONB array. This avoids a new server function while the data volume remains small.
Inline Budget Editing
Budget set/edit uses an inline form rather than a modal, keeping the interaction lightweight and consistent with the household name edit pattern in HSH-002.
Integration Test Coverage
| Test ID |
Description |
Result |
| BUD-001-spend | Insert budget_period and receipt, verify spend query returns correct total | Pass |
| BUD-002-category | Insert receipt with known items JSONB, verify category breakdown totals | Pass |
| HSH-002-members | Two users in household, verify role update and member delete via JS client | Pass |
| HSH-003-recur | Insert recurring item, trigger stock-now, verify inventory_items row created and next_due_date updated | Pass |
Acceptance Criteria Scorecard
BUD-001: Monthly Budget Tracker
- ✓ /budget renders (no longer disabled)
- ✓ Month navigation works, defaults to current month
- ✓ Summary card shows correct spend vs budget with correct colour coding
- ✓ Progress bar turns amber at 80%, terracotta at 100%
- ✓ Edit budget saves to budget_periods and updates immediately
- ✓ Receipts list shows all receipts for selected month
- ✓ Receipt detail shows full item list from JSONB
- ✓ Empty state shown when no receipts or no budget set
- ✓ Integration test passes: budget_period + receipt spend query
BUD-002: Spending Breakdown
- ✓ By-store breakdown shows correct totals for selected month
- ✓ By-category correctly parses receipts.items JSONB
- ✓ Both sections have loading and empty states
- ✓ Charts are responsive
- ✓ Integration test passes: category breakdown totals
HSH-002: Household Member Management
- ✓ /settings shows household name and members
- ✓ Household name inline edit saves correctly
- ✓ Manager can change another member's role
- ✓ Manager can remove a member (with confirmation)
- ✓ Current user's row has no action menu
- ✓ Invite button links to /settings/invite
- ✓ Loading and empty states present
- ✓ Integration test passes: role update and member delete
HSH-003: Recurring Items
- ✓ Migration applied to live DB, recurring_items table exists
- ✓ Recurring items list renders on /settings
- ✓ Add item form saves to recurring_items
- ✓ "Stock now" adds to inventory_items and updates next_due_date
- ✓ Overdue/due-today rows highlighted amber
- ✓ Edit and delete work with confirmation on delete
- ✓ Integration test passes: stock-now workflow
Sprint 4 Retrospective
Conducted at sprint close, 2026-03-20. Format: 3 standard questions plus action items.
What Went Well
- ✓Sprint planning was fast and thorough. PO had full AC for all 4 stories ready quickly, with 61 total acceptance criteria. Task breakdown and dependency graph were clear from the start.
- ✓Three parallel workstreams ran smoothly. Budget track (BUD-001/002), household settings track (HSH-002), and migration track (HSH-003) ran concurrently without blocking each other.
- ✓All stories passed PO sign-off with 61/61 AC items green. BUD-001, BUD-002, HSH-002, and HSH-003 all validated and approved.
- ✓Migration applied early, mitigating a key risk. Backend dev and DevOps coordinated well; the recurring_items table was ready before frontend needed it.
- ✓UX validation confirmed the recurring items flow at 2-3 taps. Grace persona target was under 4 taps, so the implementation exceeded the goal.
- ✓Triple-gate code review completed without major issues. Cross-review, Code Reviewer, and Lead sign-off all passed.
- ✓Zero regressions across all 26 existing tests. Pure CSS charts avoided a new dependency while keeping the spending breakdown clean.
- ✓WoW compliance held. No em dash violations, SA context (ZAR, local retailers, Lerato/Thabo/Grace personas) used consistently throughout.
What Could Be Improved
Cloudflare Pages deploy was blocked by a missing API token. The deploy credential gap identified in Sprint 3's retro was not resolved before Sprint 4 started. Deploy and smoke test are still pending.
File permission issues slowed planning docs. The docs/dev-sprint-4/ directory was root-owned, so the sprint planning doc had to live at docs/SPRINT-4-PLANNING.md instead.
Task dependency chain is long. The path from implementation to PO sign-off (code, test, review, sign-off) has 4 sequential gates. Some gates could overlap to reduce end-to-end time.
Category aggregation happens client-side from JSONB. This works at current data volumes but will need a server-side query or materialised view as receipt counts grow.
Action Items for Sprint 5
Fix directory permissions for docs/dev-sprint-5/ before sprint starts. Avoids the workaround needed this sprint.
Start deploy pipeline earlier. Do not wait for all sign-offs before the first deploy attempt. Consider adding a "deploy preview" step mid-sprint so QA can smoke test incrementally.
Resolve Cloudflare Pages API token storage. Automated deploys should not require manual credential entry. This is the second sprint where this has been flagged.
Continue the three-workstream parallelism pattern. It worked well this sprint and should be the default approach for future sprints with independent feature tracks.
Evaluate server-side category aggregation. If receipt volume grows beyond a few dozen per household per month, move the JSONB aggregation to a Supabase RPC or database view.
Retro conducted at sprint close, 2026-03-20. Actions are owned by the team going into Sprint 5.