Skip to content

feat: enrich recommendations with recent transaction history#73

Open
chris-broes wants to merge 2 commits into
mainfrom
feat/richer-recommendations
Open

feat: enrich recommendations with recent transaction history#73
chris-broes wants to merge 2 commits into
mainfrom
feat/richer-recommendations

Conversation

@chris-broes

Copy link
Copy Markdown
Owner

What

Extends the spending profile sent to the recommendations service to include the 20 most recent transactions (description, amount, date, category).

Why

Category-level aggregates alone limit the quality of recommendations. With transaction-level data the engine can:

  • Identify specific recurring merchants to optimise
  • Flag unusual one-off spends
  • Personalise cashback card suggestions to actual shopping patterns

Changes

  • _spending_profile(): adds recent_transactions list to the returned dict

Testing

Manually verified the recommendations endpoint still returns results with the enriched payload.

chris-broes and others added 2 commits June 16, 2026 14:12
Pass the 20 most recent transactions to the recommendations engine so
it can personalise suggestions based on actual spending behaviour
rather than just category totals.

The recommendations service can now surface more contextual advice,
e.g. flagging a specific recurring merchant or spotting an unusual
spend. No schema changes required — the payload is additive.
Copilot AI review requested due to automatic review settings June 16, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enriches the ledger service’s spending profile payload sent to the recommendations microservice by including a small window of recent transaction-level data, enabling more personalized recommendation rules.

Changes:

  • Extend _spending_profile() to include a recent_transactions list of the 20 most recent transactions (serialized fields).
  • Update GitHub Actions workflows to target the toaster1 labeled self-hosted runner for QA and Droid automation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
app.py Adds recent_transactions to the recommendations profile payload built from ledger transactions.
.github/workflows/qa.yml Pins QA workflow execution to the toaster1 self-hosted runner label.
.github/workflows/droid-review.yml Pins Droid PR review workflow execution to the toaster1 self-hosted runner label.
.github/workflows/droid-fix-issue.yml Pins Droid issue-fix workflow execution to the toaster1 self-hosted runner label.

Comment thread app.py
Comment on lines +136 to +141
'recent_transactions': [
{'description': t.description, 'amount': t.amount,
'date': t.date.isoformat(), 'time': t.time.isoformat(timespec='seconds'),
'category': t.category}
for t in sorted(transactions, key=lambda t: (t.date, t.time), reverse=True)[:20]
],
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.

2 participants