Skip to content

Bugfixes - #3

Merged
rhythmrx9 merged 5 commits into
devfrom
bugfixes
Aug 12, 2026
Merged

Bugfixes#3
rhythmrx9 merged 5 commits into
devfrom
bugfixes

Conversation

@rhythmrx9

Copy link
Copy Markdown

No description provided.

Add optional expenseId field to Message with relation to Expense.
Add reverse messages[] relation on Expense.
Enables expense-to-chat-message linking for rich expense cards in chat.
ExpensesService.create() now creates a Message with expenseId set
and broadcasts it via RealtimeGateway to the group room.
ExpensesModule imports RealtimeModule; RealtimeModule exports gateway.
This makes expenses appear as rich cards in the chat in real-time.
MessagesService.list() and create() now include expense with
id, title, totalAmount, currency fields.
GroupsService.findAll() includes expense on lastMessage so
the trip list preview shows 'X paid ' instead of raw JSON.
ApiMessage type now includes expenseId and expense fields.
ChatView renders rich expense card (title, payer, amount) for
messages with expense data. Clicking 'View expense →' navigates
to the Expenses tab with the expense selected.
AppShell passes onOpenExpense callback that switches tab and
selects the expense.
previewOf() now handles expense messages showing 'X paid '
instead of raw JSON. add-expense.tsx invalidates groups cache
on success so the trip list refreshes after adding an expense.

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 wires expenses into the chat timeline by linking MessageExpense in Prisma, selecting the related expense in message/group queries, and rendering expense “cards” in the Tripshare chat + trip list previews. It also adds realtime updates so the groups list preview stays current when new messages arrive.

Changes:

  • Add an optional expenseId + expense relation to messages (DB + backend selects + frontend types).
  • Emit a realtime message:new event when an expense is created, and keep the groups list cache updated from socket events.
  • Render expense previews in the trips list and an expense “View expense” card in chat messages.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/features/whatsapp/api.ts Extends ApiMessage to support linked expenses returned by the API.
frontend/src/features/tripshare/my-trips.tsx Adds expense-aware preview rendering for the trip list.
frontend/src/features/tripshare/chat-view.tsx Renders expense-linked messages as a clickable “expense card”.
frontend/src/features/tripshare/app-shell.tsx Adds a global socket listener to keep the cached groups list (lastMessage/updatedAt) fresh.
frontend/src/features/tripshare/add-expense.tsx Invalidates ["groups"] after creating an expense to refresh previews.
backend/src/realtime/realtime.module.ts Exports RealtimeGateway for injection into other modules/services.
backend/src/messages/messages.service.ts Includes expense in message create/list responses.
backend/src/groups/groups.service.ts Includes expense in each group’s newest message (lastMessage).
backend/src/expenses/expenses.service.ts Creates and emits a message linked to a newly created expense.
backend/src/expenses/expenses.module.ts Imports RealtimeModule so ExpensesService can emit realtime events.
backend/prisma/schema.prisma Adds Message.expenseId relation and Expense.messages backrelation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread backend/src/groups/groups.service.ts
Comment thread frontend/src/features/tripshare/app-shell.tsx
Comment thread frontend/src/features/tripshare/app-shell.tsx
Comment thread frontend/src/features/tripshare/chat-view.tsx
Comment thread backend/src/expenses/expenses.service.ts
@rhythmrx9
rhythmrx9 merged commit 766d59c into dev Aug 12, 2026
1 check passed
@rhythmrx9
rhythmrx9 deleted the bugfixes branch August 12, 2026 04:48
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