Open
Conversation
added 3 commits
January 14, 2026 20:14
- Backend: Add eager loading of category relationship in TransactionController::index() to prevent N+1 queries when fetching transactions list - Frontend: Memoize TransactionList component and use useCallback for handleUserProfileClick to prevent unnecessary re-renders when App state changes
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.
PR #3: Transaction Tags & Grid Feature
What I Did
This PR implements a new transaction tags feature with a many-to-many relationship between transactions and tags, along with a new data grid component that supports server-side pagination and sorting. The changes include:
Tagmodel and established a many-to-many relationship withTransactionthrough atransaction_tagsassociation tableGET /api/v1/transactions/gridendpoint with server-side pagination (page, size) and sorting (sort_by, sort_order) using raw SQL queries with JOINsTransactionGridReact component that displays transactions in a sortable, paginated table with tag badgesDepends On
This PR builds on PR #2 (
fix/haunted-codebasebranch). The feature branch was created fromfix/haunted-codebaseto ensure a stable codebase foundation.How to Test
Setup Database Schema:
docker compose -p dev -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.dev.yml exec backend php init.phpSeed the Database:
docker compose -p dev -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.dev.yml exec backend ./seed.shStart the Application (if not already running):
Test the Grid Endpoint:
http://localhost:3000in your browserTest API Directly:
curl "http://localhost:8000/api/v1/transactions/grid?page=1&size=10&sort_by=date&sort_order=desc"Should return JSON with
itemsarray andtotalcount.Architectural Decision Record (ADR)
Database Schema Evolution:
TransactionandTagentities to allow transactions to have multiple tags (e.g., "work", "travel", "reimbursable")@ManyToManyannotation with atransaction_tagsjoin tablecategoryrelationship intactBackend API Design:
/api/v1/transactions/gridendpoint to avoid breaking changes to existing transaction endpointsJSON_AGGfunctionFrontend State Management:
useState,useEffect,useCallback) for state managementComponent Design:
AI Usage Summary
AI tools were used for: