Skip to content

Dev#17

Merged
UGing265 merged 176 commits intomainfrom
dev
Mar 24, 2026
Merged

Dev#17
UGing265 merged 176 commits intomainfrom
dev

Conversation

@UGing265
Copy link
Copy Markdown
Owner

V1.0.0 lets go

OpenCode and others added 30 commits February 9, 2026 05:47
feat: Add GitHub Actions workflow to prevent merging to main from non…
- Created comprehensive frontend design documentation for the Digital Paper Note application.
- Established a color palette and typography guidelines.
- Implemented a feature-based architecture for scalability.
- Developed authentication components including Login and Register forms.
- Integrated form validation using Zod and React Hook Form.
- Set up API service for authentication with error handling.
- Added reusable UI components (Button, Card, Input, etc.) with Tailwind CSS styling.
- Configured shadcn/ui for consistent design across components.
- Documented implementation tasks and architecture rules for future developers.
…, and error handling with dedicated pages and components.
- Created error parsing utility to extract field-specific and general errors from backend API responses.
- Enhanced LoginForm and RegisterForm components with improved error handling, loading states, and animations.
- Updated global styling with deeper yellow color and added smooth animations for better UI/UX.
- Improved layout and typography for authentication pages, ensuring a polished note-taking aesthetic.
- All changes verified with comprehensive testing scenarios to ensure functionality and responsiveness.
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…he UI.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Add yellow-first color tokens to globals.css
- Create 5 section components with professional dark theme design:
  - HeroSection: Gradient background, amber accents, rounded CTAs
  - ValuePropsSection: 3 key benefits with slate-900 icon boxes
  - UseCaseCardsSection: Wallet/PiggyBank/Debt cards with hover effects
  - WorkflowSection: 4-step process with connected circles
  - CTAFooterSection: Gradient CTA button with footer links
- Implement responsive design (mobile-first)
- Add Playwright E2E test infrastructure
- Update metadata and accessibility focus states
- Vietnamese content throughout

Design: Dark slate/navy theme with amber accents
Closes: homepage-prelogin-vang-xanh plan
- Restyle HeroSection with rounded top nav + two-column layout
- Update all content sections (ValueProps, UseCases, Workflow, CTA)
- Apply login-consistent palette: #FFFBEB, #FFFEF5, #F0D25D, #E8CB50
- Convert all homepage copy to English
- Update Playwright smoke tests
- Add documentation updates to docs/plan and docs/done

Closes: homepage-reference-sync-login-yellow plan
- Added TrustLogos and Testimonials components to the homepage for improved social proof.
- Redesigned CTA Footer Section with new layout, contact information, and a contact form.
- Updated HeroSection with new branding and messaging for clarity and engagement.
- Revamped UseCaseCardsSection and ValuePropsSection with concise descriptions and improved messaging.
- Overhauled WorkflowSection to present features in a more interactive and visually appealing manner.
- Introduced TrustAndTestimonials component to encapsulate trust elements and user testimonials.
- Created comprehensive frontend design documentation for the Digital Paper Note application.
- Established a color palette and typography guidelines.
- Implemented a feature-based architecture for scalability.
- Developed authentication components including Login and Register forms.
- Integrated form validation using Zod and React Hook Form.
- Set up API service for authentication with error handling.
- Added reusable UI components (Button, Card, Input, etc.) with Tailwind CSS styling.
- Configured shadcn/ui for consistent design across components.
- Documented implementation tasks and architecture rules for future developers.
…, and error handling with dedicated pages and components.
- Created error parsing utility to extract field-specific and general errors from backend API responses.
- Enhanced LoginForm and RegisterForm components with improved error handling, loading states, and animations.
- Updated global styling with deeper yellow color and added smooth animations for better UI/UX.
- Improved layout and typography for authentication pages, ensuring a polished note-taking aesthetic.
- All changes verified with comprehensive testing scenarios to ensure functionality and responsiveness.
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
UGing265 and others added 24 commits March 2, 2026 07:36
- Updated the TransferForm component to include an optional note field for transfers.
- Modified the CreateTransferRequest type to accommodate the new note field.
- Adjusted the UI to reflect that the note field is optional, changing the placeholder text and label accordingly.
- Ensured the note is sent as null if not provided during the transfer process.
…log, DebtInfoCard, DeleteTransactionDialog, EditTransactionDialog, NoteCard, TransferDetailsCard, and WalletInfoCard
- Implemented components for wallet details, including WalletHeader, WalletOverviewCard, ChildWalletList, and WalletDialogs.
- Created WalletsPage components such as WalletsStats, WalletSearchSort, ParentWalletCard, and EmptyState for better wallet organization and management.
- Added functionality for creating, editing, and deleting wallets with appropriate dialogs.
- Introduced new input fields for amount and notes in transfer forms.
- Enhanced user experience with loading states and conditional rendering based on wallet data.
- Created development setup guide in development.md
- Added favicon.svg for branding
- Documented frontend architecture in frontend/structure.md
- Introduced introduction.md for project overview
- Added mint.json for documentation configuration
- Created OpenAPI specification in openapi.json
- Documented PostgreSQL naming conventions in postgres-rename-inventory.md
- Added public assets including favicon and logo SVGs
@UGing265 UGing265 self-assigned this Mar 24, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2026

Important

Review skipped

Too many files!

This PR contains 294 files, which is 144 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9687cd6f-1472-4dda-aee6-cf7495319f30

📥 Commits

Reviewing files that changed from the base of the PR and between a9044b1 and 6be3f93.

⛔ Files ignored due to path filters (6)
  • docs/docs/favicon.svg is excluded by !**/*.svg
  • docs/docs/public/favicon.svg is excluded by !**/*.svg
  • docs/docs/public/logo/dark.svg is excluded by !**/*.svg
  • docs/docs/public/logo/light.svg is excluded by !**/*.svg
  • docs/main/SRS_v1.1.pdf is excluded by !**/*.pdf
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (294)
  • .dockerignore
  • .env.example
  • .github/workflows/var-branch.yml
  • .gitignore
  • CHANGELOG.md
  • README.md
  • RELEASES.md
  • RULES.md
  • backend/.dockerignore
  • backend/Dockerfile
  • backend/MA6_Debt.sln
  • backend/src/API/API.csproj
  • backend/src/API/API.http
  • backend/src/API/Contracts/Transactions/CashAdjustmentRequest.cs
  • backend/src/API/Contracts/Transactions/QuickDeductRequest.cs
  • backend/src/API/Contracts/Transactions/UpdateTransactionRequest.cs
  • backend/src/API/Contracts/Transfers/CreateTransferRequest.cs
  • backend/src/API/Controllers/AuthController.cs
  • backend/src/API/Controllers/DebtPartnersController.cs
  • backend/src/API/Controllers/TransactionsController.cs
  • backend/src/API/Controllers/TransfersController.cs
  • backend/src/API/Controllers/UsersController.cs
  • backend/src/API/Controllers/WalletsController.cs
  • backend/src/API/Middleware/GlobalExceptionHandler.cs
  • backend/src/API/Program.cs
  • backend/src/API/Properties/launchSettings.json
  • backend/src/API/appsettings.json
  • backend/src/Application/Common/Behaviors/ValidationBehavior.cs
  • backend/src/Application/Common/Exceptions/NotFoundException.cs
  • backend/src/Application/Common/Interfaces/IApplicationDbContext.cs
  • backend/src/Application/Common/Interfaces/IPasswordHasher.cs
  • backend/src/Application/Common/Interfaces/ITokenGenerator.cs
  • backend/src/Application/Common/Locking/MonthLockPolicy.cs
  • backend/src/Application/Common/PagedResult.cs
  • backend/src/Application/Common/Security/PasswordHasher.cs
  • backend/src/Application/Common/Security/TokenGenerator.cs
  • backend/src/Application/DependencyInjection.cs
  • backend/src/Application/Features/Auth/Login/LoginCommand.cs
  • backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs
  • backend/src/Application/Features/Auth/Login/LoginRequest.cs
  • backend/src/Application/Features/Auth/Login/LoginResponse.cs
  • backend/src/Application/Features/Auth/Login/LoginValidator.cs
  • backend/src/Application/Features/Auth/Register/RegisterCommand.cs
  • backend/src/Application/Features/Auth/Register/RegisterCommandHandler.cs
  • backend/src/Application/Features/Auth/Register/RegisterRequest.cs
  • backend/src/Application/Features/Auth/Register/RegisterResponse.cs
  • backend/src/Application/Features/Auth/Register/RegisterValidator.cs
  • backend/src/Application/Features/DebtPartners/CreateDebtPartner/CreateDebtPartnerCommand.cs
  • backend/src/Application/Features/DebtPartners/CreateDebtPartner/CreateDebtPartnerCommandHandler.cs
  • backend/src/Application/Features/DebtPartners/CreateDebtPartner/CreateDebtPartnerValidator.cs
  • backend/src/Application/Features/DebtPartners/DebtPartnerDto.cs
  • backend/src/Application/Features/DebtPartners/DeleteDebtPartner/DeleteDebtPartnerCommand.cs
  • backend/src/Application/Features/DebtPartners/DeleteDebtPartner/DeleteDebtPartnerCommandHandler.cs
  • backend/src/Application/Features/DebtPartners/DeleteDebtPartner/DeleteDebtPartnerValidator.cs
  • backend/src/Application/Features/DebtPartners/GetDebtPartnerById/GetDebtPartnerByIdQuery.cs
  • backend/src/Application/Features/DebtPartners/GetDebtPartnerById/GetDebtPartnerByIdQueryHandler.cs
  • backend/src/Application/Features/DebtPartners/GetDebtPartners/GetDebtPartnersQuery.cs
  • backend/src/Application/Features/DebtPartners/GetDebtPartners/GetDebtPartnersQueryHandler.cs
  • backend/src/Application/Features/DebtPartners/UpdateDebtPartner/UpdateDebtPartnerCommand.cs
  • backend/src/Application/Features/DebtPartners/UpdateDebtPartner/UpdateDebtPartnerCommandHandler.cs
  • backend/src/Application/Features/DebtPartners/UpdateDebtPartner/UpdateDebtPartnerValidator.cs
  • backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommand.cs
  • backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommandHandler.cs
  • backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentValidator.cs
  • backend/src/Application/Features/Transactions/DeleteTransaction/DeleteTransactionCommand.cs
  • backend/src/Application/Features/Transactions/DeleteTransaction/DeleteTransactionCommandHandler.cs
  • backend/src/Application/Features/Transactions/DeleteTransaction/DeleteTransactionValidator.cs
  • backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQuery.cs
  • backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQueryHandler.cs
  • backend/src/Application/Features/Transactions/GetTransactionById/GetTransactionByIdQuery.cs
  • backend/src/Application/Features/Transactions/GetTransactionById/GetTransactionByIdQueryHandler.cs
  • backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQuery.cs
  • backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQueryHandler.cs
  • backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommand.cs
  • backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommandHandler.cs
  • backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductResponse.cs
  • backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductValidator.cs
  • backend/src/Application/Features/Transactions/TransactionDto.cs
  • backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommand.cs
  • backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommandHandler.cs
  • backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionValidator.cs
  • backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommand.cs
  • backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommandHandler.cs
  • backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferValidator.cs
  • backend/src/Application/Features/Transfers/GetTransferById/GetTransferByIdQuery.cs
  • backend/src/Application/Features/Transfers/GetTransferById/GetTransferByIdQueryHandler.cs
  • backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQuery.cs
  • backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQueryHandler.cs
  • backend/src/Application/Features/Transfers/TransferDto.cs
  • backend/src/Application/Features/Users/ChangePassword/ChangePasswordCommand.cs
  • backend/src/Application/Features/Users/ChangePassword/ChangePasswordCommandHandler.cs
  • backend/src/Application/Features/Users/ChangePassword/ChangePasswordValidator.cs
  • backend/src/Application/Features/Users/GetProfile/GetProfileQuery.cs
  • backend/src/Application/Features/Users/GetProfile/GetProfileQueryHandler.cs
  • backend/src/Application/Features/Users/GetUserPreferences/GetUserPreferencesQuery.cs
  • backend/src/Application/Features/Users/GetUserPreferences/GetUserPreferencesQueryHandler.cs
  • backend/src/Application/Features/Users/UpdateDefaultPartner/UpdateDefaultPartnerCommand.cs
  • backend/src/Application/Features/Users/UpdateDefaultPartner/UpdateDefaultPartnerCommandHandler.cs
  • backend/src/Application/Features/Users/UpdateDefaultWallet/UpdateDefaultWalletCommand.cs
  • backend/src/Application/Features/Users/UpdateDefaultWallet/UpdateDefaultWalletCommandHandler.cs
  • backend/src/Application/Features/Users/UpdateProfile/UpdateProfileCommand.cs
  • backend/src/Application/Features/Users/UpdateProfile/UpdateProfileCommandHandler.cs
  • backend/src/Application/Features/Users/UpdateProfile/UpdateProfileValidator.cs
  • backend/src/Application/Features/Wallets/CreateWallet/CreateWalletCommand.cs
  • backend/src/Application/Features/Wallets/CreateWallet/CreateWalletCommandHandler.cs
  • backend/src/Application/Features/Wallets/CreateWallet/CreateWalletValidator.cs
  • backend/src/Application/Features/Wallets/DeleteWallet/DeleteWalletCommand.cs
  • backend/src/Application/Features/Wallets/DeleteWallet/DeleteWalletCommandHandler.cs
  • backend/src/Application/Features/Wallets/DeleteWallet/DeleteWalletValidator.cs
  • backend/src/Application/Features/Wallets/GetWalletById/GetWalletByIdQuery.cs
  • backend/src/Application/Features/Wallets/GetWalletById/GetWalletByIdQueryHandler.cs
  • backend/src/Application/Features/Wallets/GetWallets/GetWalletsQuery.cs
  • backend/src/Application/Features/Wallets/GetWallets/GetWalletsQueryHandler.cs
  • backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletCommand.cs
  • backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletCommandHandler.cs
  • backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletValidator.cs
  • backend/src/Application/Features/Wallets/WalletDto.cs
  • backend/src/Domain/Domain.csproj
  • backend/src/Domain/Entities/DebtPartner.cs
  • backend/src/Domain/Entities/Transaction.cs
  • backend/src/Domain/Entities/Transfer.cs
  • backend/src/Domain/Entities/User.cs
  • backend/src/Domain/Entities/Wallet.cs
  • backend/src/Persistence/Data/ApplicationDbContext.cs
  • backend/src/Persistence/DependencyInjection.cs
  • backend/src/Persistence/Migrations/20260208102938_InitialCreate.Designer.cs
  • backend/src/Persistence/Migrations/20260208102938_InitialCreate.cs
  • backend/src/Persistence/Migrations/20260208103321_initDB.Designer.cs
  • backend/src/Persistence/Migrations/20260208103321_initDB.cs
  • backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.Designer.cs
  • backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.cs
  • backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.Designer.cs
  • backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.cs
  • backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.Designer.cs
  • backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.cs
  • backend/src/Persistence/Migrations/20260221164624_transfer-wallet.Designer.cs
  • backend/src/Persistence/Migrations/20260221164624_transfer-wallet.cs
  • backend/src/Persistence/Migrations/ApplicationDbContextModelSnapshot.cs
  • backend/src/Persistence/Persistence.csproj
  • database/dump-ma6_debt_db-202603020755.dump
  • docker-compose.yml
  • docs/docs/.mintlifyignore
  • docs/docs/DOCUMENTATION_INDEX.md
  • docs/docs/DOCUMENTATION_SUMMARY.md
  • docs/docs/api/introduction.md
  • docs/docs/backend/structure.md
  • docs/docs/design-system.md
  • docs/docs/development.md
  • docs/docs/frontend/structure.md
  • docs/docs/introduction.md
  • docs/docs/mint.json
  • docs/docs/openapi.json
  • docs/docs/postgres-rename-inventory.md
  • docs/done/Frontend_Component_Refactoring.md
  • docs/done/Frontend_Design.md
  • docs/done/Parent_Wallet_Focused_Dashboard.md
  • docs/done/Session_2026-03-02_Full_Summary.md
  • docs/done/US00_Auth_Frontend.md
  • docs/done/US00_Login_Backend.md
  • docs/done/US00_Register_Backend.md
  • docs/done/US00_Scalar_Backend.md
  • docs/done/US01_US02_FE_Workspace.md
  • docs/done/US01_Wallets_Backend.md
  • docs/done/US02_DebtPartner_Backend.md
  • docs/done/US03_Cash_Adjustment.md
  • docs/done/US03_Constraint_Hardening.md
  • docs/done/US03_DB_Migration_AutoStart.md
  • docs/done/US03_US04_QuickDeduct_Backend.md
  • docs/done/US03_US04_QuickDeduct_Frontend.md
  • docs/done/US05_US06_FE_History.md
  • docs/done/US05_US06_HistorySearch_DataLocking_Backend.md
  • docs/done/US07_Internal_Wallet_Transfers_Backend.md
  • docs/done/US07_Internal_Wallet_Transfers_Frontend.md
  • docs/done/US08_Debt_Management_Enhancement.md
  • docs/done/US08_FE_Repayment_History_Tagging.md
  • docs/done/US09_Profile_Management_and_Debt_Repayment_Fix.md
  • docs/done/Workspace_Tree_Navbar.md
  • docs/done/Workspace_Wallet_Modal_Navbar_Sync.md
  • docs/done/deploy-docker.md
  • docs/done/partner-wallet-ui-unification-dashboard.md
  • docs/done/tailwind-mobile-first.md
  • docs/done/update-transaction-endpoint.md
  • docs/openapi.json
  • docs/plan/Frontend_Component_Refactoring.md
  • docs/plan/Frontend_Design.md
  • docs/plan/Parent_Wallet_Focused_Dashboard.md
  • docs/plan/US00_Auth_Frontend.md
  • docs/plan/US00_Login.md
  • docs/plan/US00_Register.md
  • docs/plan/US00_Scalar.md
  • docs/plan/US01_US02_FE_Workspace.md
  • docs/plan/US01_Wallets.md
  • docs/plan/US02_DebtPartner.md
  • docs/plan/US03_Cash_Adjustment.md
  • docs/plan/US03_Constraint_Hardening.md
  • docs/plan/US03_DB_Migration_AutoStart.md
  • docs/plan/US03_US04_QuickDeduct_Backend.md
  • docs/plan/US03_US04_QuickDeduct_Frontend.md
  • docs/plan/US05_US06_FE_History.md
  • docs/plan/US05_US06_HistorySearch_DataLocking_Backend.md
  • docs/plan/US07_Internal_Wallet_Transfers_Frontend.md
  • docs/plan/US08_Debt_Management_Enhancement.md
  • docs/plan/Workspace_Tree_Navbar.md
  • docs/plan/Workspace_Wallet_Modal_Navbar_Sync.md
  • docs/plan/partner-wallet-ui-unification-dashboard.md
  • docs/plan/update-transaction-endpoint.md
  • frontend/.dockerignore
  • frontend/Dockerfile
  • frontend/components.json
  • frontend/next.config.ts
  • frontend/package.json
  • frontend/pnpm-workspace.yaml
  • frontend/postcss.config.mjs
  • frontend/src/app/(auth)/layout.tsx
  • frontend/src/app/(auth)/login/page.tsx
  • frontend/src/app/(auth)/register/page.tsx
  • frontend/src/app/(dashboard)/dashboard/page.tsx
  • frontend/src/app/(dashboard)/help/page.tsx
  • frontend/src/app/(dashboard)/history/[id]/page.tsx
  • frontend/src/app/(dashboard)/history/page.tsx
  • frontend/src/app/(dashboard)/layout.tsx
  • frontend/src/app/(dashboard)/page.tsx
  • frontend/src/app/(dashboard)/partners/page.tsx
  • frontend/src/app/(dashboard)/profile/page.tsx
  • frontend/src/app/(dashboard)/quick-deduct/page.tsx
  • frontend/src/app/(dashboard)/transfer/page.tsx
  • frontend/src/app/(dashboard)/wallet/page.tsx
  • frontend/src/app/(dashboard)/wallets/[id]/page.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/MonthlyChart.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/RecentHistoryPanel.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/StatsCards.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/SummaryCards.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/WalletsPanel.tsx
  • frontend/src/app/(dashboard)/wallets/dashboard/components/index.ts
  • frontend/src/app/(dashboard)/wallets/dashboard/page.tsx
  • frontend/src/app/(dashboard)/wallets/page.tsx
  • frontend/src/app/(dashboard)/workspace/page.tsx
  • frontend/src/app/globals.css
  • frontend/src/app/layout.tsx
  • frontend/src/app/page.tsx
  • frontend/src/components/ui/accordion.tsx
  • frontend/src/components/ui/button.tsx
  • frontend/src/components/ui/card.tsx
  • frontend/src/components/ui/dialog.tsx
  • frontend/src/components/ui/form.tsx
  • frontend/src/components/ui/input.tsx
  • frontend/src/components/ui/label.tsx
  • frontend/src/components/ui/page-header.tsx
  • frontend/src/components/ui/sonner.tsx
  • frontend/src/components/ui/tabs.tsx
  • frontend/src/features/README.md
  • frontend/src/features/auth/api/auth.ts
  • frontend/src/features/auth/components/LoginForm.tsx
  • frontend/src/features/auth/components/RegisterForm.tsx
  • frontend/src/features/auth/types/auth.ts
  • frontend/src/features/auth/utils/errorParser.ts
  • frontend/src/features/debt/api/debtPartners.ts
  • frontend/src/features/debt/components/DebtPartnerForm.tsx
  • frontend/src/features/debt/components/DebtPartnerList.tsx
  • frontend/src/features/debt/components/HybridBalanceInput.tsx
  • frontend/src/features/debt/components/PartnerMoneyDialog.tsx
  • frontend/src/features/debt/components/PartnerNameDialog.tsx
  • frontend/src/features/debt/components/PartnerRepaymentDialog.tsx
  • frontend/src/features/debt/hooks/useDebtPartners.ts
  • frontend/src/features/debt/types/debtPartner.ts
  • frontend/src/features/history/api/history.ts
  • frontend/src/features/history/components/HistoryFilters.tsx
  • frontend/src/features/history/components/HistoryList.tsx
  • frontend/src/features/history/components/HistoryPageContainer.tsx
  • frontend/src/features/history/components/HistoryRow.tsx
  • frontend/src/features/history/components/TransactionDetail/AmountCard.tsx
  • frontend/src/features/history/components/TransactionDetail/DebtDialog.tsx
  • frontend/src/features/history/components/TransactionDetail/DebtInfoCard.tsx
  • frontend/src/features/history/components/TransactionDetail/DeleteTransactionDialog.tsx
  • frontend/src/features/history/components/TransactionDetail/EditTransactionDialog.tsx
  • frontend/src/features/history/components/TransactionDetail/NoteCard.tsx
  • frontend/src/features/history/components/TransactionDetail/TransactionHeader.tsx
  • frontend/src/features/history/components/TransactionDetail/TransferDetailsCard.tsx
  • frontend/src/features/history/components/TransactionDetail/WalletInfoCard.tsx
  • frontend/src/features/history/components/TransactionDetail/index.ts
  • frontend/src/features/history/components/TransactionDetailPage.tsx
  • frontend/src/features/history/hooks/useHistoryQueryState.ts
  • frontend/src/features/history/types/history.ts
  • frontend/src/features/history/utils/historyKind.ts
  • frontend/src/features/home/components/CTAFooterSection.tsx
  • frontend/src/features/home/components/ContactForm.tsx
  • frontend/src/features/home/components/HeroSection.tsx
  • frontend/src/features/home/components/TrustAndTestimonials.tsx
  • frontend/src/features/home/components/UseCaseCardsSection.tsx
  • frontend/src/features/home/components/ValuePropsSection.tsx
  • frontend/src/features/home/components/WorkflowSection.tsx
  • frontend/src/features/home/components/workflow-mocks/ProcessingUI.tsx
  • frontend/src/features/home/components/workflow-mocks/ReviewUI.tsx
  • frontend/src/features/home/components/workflow-mocks/SetupUI.tsx

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@UGing265 UGing265 merged commit 1ec8c5a into main Mar 24, 2026
2 checks passed
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

V1.0.0 Release - Complete Debt Tracking Application with Backend API and Frontend Integration

✨ Enhancement

Grey Divider

Walkthroughs

Description
• **Complete backend API implementation** for debt tracking application with full CRUD operations
  for wallets, debt partners, and transactions
• **Database schema migration to snake_case naming convention** with PostgreSQL compatibility and
  new audit fields for transaction tracking
• **US-03 Quick Deduct feature** with hybrid debt-tagging supporting two payer modes
  (ToiTra/PartnerTra) and automatic debt notification
• **US-04 Debt notification system** with balance tracking and direction indicators
  (PartnerOwesUser/UserOwesPartner/Settled)
• **Transaction management** with update/delete handlers including partner balance rollback and
  month-based locking policy
• **Internal wallet transfer system** with automatic paired transaction generation and audit trail
  linking
• **User profile and preferences management** with default wallet/partner selection
• **Monthly statistics dashboard** with expense, income, and debt metrics calculation
• **Comprehensive validation pipeline** with FluentValidation and MediatR pipeline behavior
  integration
• **Frontend API clients and hooks** for transaction history, wallets, debt partners, and transfers
  with pagination and filtering
• **Error handling improvements** including NotFoundException and InvalidOperationException support
  in global exception handler
• **CORS configuration** for React frontend with auto-migration support for Development/Staging
  environments
• **Multiple file formatting normalization** (CRLF to LF line endings) across backend codebase
Diagram
flowchart LR
  A["Database Schema<br/>snake_case migration"] --> B["Transaction Entity<br/>with audit fields"]
  B --> C["Quick Deduct Handler<br/>US-03 feature"]
  C --> D["Debt Notification<br/>US-04 response"]
  D --> E["Transaction API<br/>Controller"]
  E --> F["Frontend API Client<br/>with pagination"]
  F --> G["History Hook<br/>with filtering"]
  
  H["Wallet Management<br/>CRUD operations"] --> E
  I["Debt Partner CRUD<br/>with soft delete"] --> E
  J["Transfer System<br/>paired transactions"] --> E
  
  K["User Preferences<br/>default wallet/partner"] --> E
  L["Month Lock Policy<br/>Vietnam timezone"] --> E
  
  M["Validation Pipeline<br/>MediatR behavior"] --> C
  M --> H
  M --> I
  
  N["Global Exception Handler<br/>NotFoundException"] --> E
Loading

Grey Divider

File Changes

1. backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.cs ⚙️ Configuration changes +716/-0

Database schema migration to snake_case naming convention

• New migration file that converts database schema from PascalCase to snake_case naming convention
• Renames all table names to lowercase (e.g., Walletswallets, DebtPartnersdebt_partners)
• Renames all column names to snake_case (e.g., UserIduser_id, CreatedAtcreated_at)
• Renames InitialBalance column to balance in the debt_partners table
• Updates all primary key and foreign key constraint names to lowercase snake_case format

backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.cs


2. backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.Designer.cs ⚙️ Configuration changes +328/-0

Migration designer snapshot for snake_case schema conversion

• Auto-generated designer file for the snake_case migration
• Defines the target model state after applying the migration
• Maps all entity properties to their new snake_case column names using HasColumnName()
• Updates all table names and constraint names to lowercase snake_case format

backend/src/Persistence/Migrations/20260214192826_ConvertToSnakeCaseAndRenameBalance.Designer.cs


3. backend/src/Persistence/Migrations/ApplicationDbContextModelSnapshot.cs ⚙️ Configuration changes +155/-63

Model snapshot with snake_case columns and new transaction fields

• Updates the current model snapshot to reflect snake_case naming convention
• Adds HasColumnName() mappings for all entity properties to snake_case columns
• Updates table names to lowercase (e.g., wallets, users, transactions)
• Adds HasName() for primary keys and HasDatabaseName() for indexes with snake_case names
• Adds new properties to Transaction entity: DebtAmount, PartnerBalanceAfter,
 PartnerBalanceBefore, PayerMode, TotalAmount
• Adds new properties to Transfer entity: DestinationTransactionId, SourceTransactionId,
 UserId
• Updates all foreign key constraint names to snake_case format

backend/src/Persistence/Migrations/ApplicationDbContextModelSnapshot.cs


View more (232)
4. backend/src/Persistence/Migrations/20260208102938_InitialCreate.Designer.cs Formatting +280/-280

Line ending normalization in initial migration designer

• Line ending normalization (CRLF to LF conversion)
• No functional changes to the migration designer content

backend/src/Persistence/Migrations/20260208102938_InitialCreate.Designer.cs


5. backend/src/Persistence/Migrations/20260208103321_initDB.Designer.cs Formatting +280/-280

Line ending normalization in initDB migration designer

• Line ending normalization (CRLF to LF conversion)
• No functional changes to the migration designer content

backend/src/Persistence/Migrations/20260208103321_initDB.Designer.cs


6. backend/src/Persistence/Migrations/20260208102938_InitialCreate.cs Formatting +195/-195

Line ending normalization in initial migration

• Line ending normalization (CRLF to LF conversion)
• No functional changes to the migration logic

backend/src/Persistence/Migrations/20260208102938_InitialCreate.cs


7. backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.Designer.cs ⚙️ Configuration changes +348/-0

Migration designer for new transaction fields addition

• New migration designer file for adding transaction-related fields
• Defines model state with new Transaction properties: DebtAmount, PartnerBalanceAfter,
 PartnerBalanceBefore, PayerMode, TotalAmount
• Maps all properties to snake_case column names
• Includes all foreign key constraints with snake_case naming

backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.Designer.cs


8. backend/src/Persistence/Migrations/20260221164624_transfer-wallet.Designer.cs ⚙️ Configuration changes +372/-0

Migration designer for transfer-wallet relationship enhancement

• New migration designer file for transfer-wallet relationship changes
• Adds UserId property to Transfer entity with snake_case column mapping
• Adds SourceTransactionId and DestinationTransactionId properties to Transfer entity
• Includes new foreign key constraint fk_transfers_users_user_id for the UserId relationship
• Updates all table and constraint names to snake_case format

backend/src/Persistence/Migrations/20260221164624_transfer-wallet.Designer.cs


9. backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommandHandler.cs ✨ Enhancement +251/-0

Transaction update handler with debt balance management

• New command handler for updating transactions with comprehensive debt tracking logic
• Implements partner balance rollback and recomputation when transaction details change
• Handles three scenarios: removing partner, adding new partner, and updating existing partner debt
• Computes wallet and partner deltas based on PayerMode (ToiTra or PartnerTra)
• Enforces month-based locking policy to prevent editing locked transactions
• Validates transaction ownership and partner existence before updates

backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommandHandler.cs


10. backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferValidator.cs ✨ Enhancement +140/-0

Transfer creation validator with wallet and balance checks

• New validator for CreateTransferCommand with comprehensive validation rules
• Validates required fields: UserId, FromWalletId, ToWalletId, Amount
• Ensures source and destination wallets are different and belong to the user
• Validates sufficient balance in source wallet before transfer
• Validates optional SourceTransactionId and DestinationTransactionId belong to respective
 wallets
• Uses custom async validation for database-dependent checks

backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferValidator.cs


11. frontend/src/features/transaction/components/index.ts ✨ Enhancement +1/-0

Transaction components barrel export file

• New barrel export file for transaction components
• Exports QuickDebtForm component for use in other modules

frontend/src/features/transaction/components/index.ts


12. backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQueryHandler.cs ✨ Enhancement +228/-0

Paginated transaction query handler with transfer enrichment

• New handler implementing paginated transaction retrieval with user-scoped filtering by wallet,
 partner, and keyword search
• Supports soft-deleted wallet/partner lookups using IgnoreQueryFilters() for historical data
 integrity
• Enriches transactions with transfer context (direction, wallet names) and applies month-lock
 policy
• Implements efficient batch loading of wallet and partner data to minimize database queries

backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQueryHandler.cs


13. backend/src/API/Controllers/TransactionsController.cs ✨ Enhancement +212/-0

Transaction REST API controller with quick deduct support

• New REST controller exposing transaction CRUD operations and monthly statistics
• Implements US-03 Quick Deduct endpoint and US-04 debt notification response
• Provides cash adjustment endpoint for personal-only transactions without debt tracking
• Extracts current user ID from JWT subject claim for authorization

backend/src/API/Controllers/TransactionsController.cs


14. backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.Designer.cs ⚙️ Configuration changes +276/-0

Database schema migration designer snapshot

• Auto-generated EF Core migration designer file documenting database schema state
• Defines entity relationships for User, Wallet, DebtPartner, Transaction, and Transfer
• Establishes foreign key constraints and cascade/restrict delete behaviors

backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.Designer.cs


15. backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommandHandler.cs ✨ Enhancement +209/-0

Quick deduct command handler with hybrid debt-tagging

• Implements US-03 hybrid debt-tagging logic with two payer modes: ToiTra (user pays) and
 PartnerTra (partner pays)
• Resolves default wallet/partner from user preferences when not explicitly provided
• Enforces defensive invariants to prevent bypass of business rules (partner requirement, debt
 constraints)
• Builds US-04 debt notification with human-readable message and direction indicator

backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommandHandler.cs


16. backend/src/API/Middleware/GlobalExceptionHandler.cs Error handling +115/-74

Enhanced global exception handler with business rule errors

• Adds handling for NotFoundException (404 responses) and InvalidOperationException (400
 business rule violations)
• Extends existing validation and unauthorized exception handlers
• Maintains consistent error response format with RFC 7231 problem details

backend/src/API/Middleware/GlobalExceptionHandler.cs


17. backend/src/Persistence/Data/ApplicationDbContext.cs ⚙️ Configuration changes +78/-69

Database context configuration for snake_case naming

• Adds OnConfiguring method to enable snake_case naming convention for PostgreSQL columns
• Configures warning suppression for pending model changes
• Maintains existing entity relationships and soft-delete query filter for DebtPartner

backend/src/Persistence/Data/ApplicationDbContext.cs


18. backend/src/Application/Features/Transactions/GetTransactionById/GetTransactionByIdQueryHandler.cs ✨ Enhancement +145/-0

Single transaction query handler with transfer context

• New handler for retrieving single transaction by ID with user-scoped authorization
• Fetches wallet and partner details including soft-deleted records for historical accuracy
• Enriches response with transfer context and applies month-lock policy

backend/src/Application/Features/Transactions/GetTransactionById/GetTransactionByIdQueryHandler.cs


19. backend/src/API/Controllers/TransfersController.cs ✨ Enhancement +132/-0

Transfer REST API controller

• New REST controller for internal wallet transfer operations
• Provides endpoints to create transfers and retrieve transfer history with optional filtering
• Extracts user ID from JWT for authorization and scoping

backend/src/API/Controllers/TransfersController.cs


20. backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductValidator.cs ✨ Enhancement +123/-0

Quick deduct command validator with business rules

• Implements FluentValidation rules for QuickDeductCommand enforcing US-03 business constraints
• Validates wallet/partner ownership, debt amount constraints, and payer mode requirements
• Includes async validation for default wallet/partner resolution

backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductValidator.cs


21. backend/src/Application/Common/Security/TokenGenerator.cs Formatting +78/-78

Token generator file formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Common/Security/TokenGenerator.cs


22. backend/src/API/Controllers/UsersController.cs ✨ Enhancement +127/-0

User profile and preferences REST API controller

• New REST controller for user profile and preference management
• Provides endpoints to get/update profile, change password, and manage default wallet/partner
 preferences
• Extracts user ID from JWT subject claim for authorization

backend/src/API/Controllers/UsersController.cs


23. backend/src/API/Controllers/WalletsController.cs ✨ Enhancement +112/-0

Wallet management REST API controller

• New REST controller for wallet CRUD operations
• Provides endpoints to create, retrieve, update, and delete wallets with user-scoped authorization
• Extracts user ID from JWT for authorization

backend/src/API/Controllers/WalletsController.cs


24. backend/src/API/Controllers/DebtPartnersController.cs ✨ Enhancement +110/-0

Debt partner management REST API controller

• New REST controller for debt partner CRUD operations
• Provides endpoints to create, retrieve, update, and delete debt partners with user-scoped
 authorization
• Extracts user ID from JWT for authorization

backend/src/API/Controllers/DebtPartnersController.cs


25. backend/src/Application/Features/Auth/Register/RegisterCommandHandler.cs Formatting +71/-71

Register command handler file formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Features/Auth/Register/RegisterCommandHandler.cs


26. backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQueryHandler.cs ✨ Enhancement +108/-0

Monthly statistics query handler for dashboard

• New handler for retrieving monthly transaction statistics for dashboard visualization
• Groups transactions by month and calculates expense, income, debt increase/decrease metrics
• Derives debt changes from PartnerBalanceBefore and PartnerBalanceAfter audit fields

backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQueryHandler.cs


27. backend/src/API/Program.cs ⚙️ Configuration changes +43/-27

Program startup configuration with CORS and auto-migration

• Adds CORS policy configuration for React frontend (configurable origins)
• Implements auto-migration logic for Development and Staging environments
• Simplifies OpenAPI configuration and adds database context import
• Applies CORS middleware to request pipeline

backend/src/API/Program.cs


28. backend/src/Application/Features/Transactions/DeleteTransaction/DeleteTransactionCommandHandler.cs ✨ Enhancement +98/-0

Transaction deletion handler with balance rollback

• New handler for soft-deleting transactions with partner balance rollback
• Derives original partner delta from audit fields or reconstructs from payer mode
• Enforces month-lock policy to prevent deletion of locked transactions

backend/src/Application/Features/Transactions/DeleteTransaction/DeleteTransactionCommandHandler.cs


29. backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletValidator.cs ✨ Enhancement +100/-0

Wallet update validator with circular reference detection

• New validator for UpdateWalletCommand enforcing wallet hierarchy constraints
• Validates wallet ownership, prevents self-parenting, and detects circular references
• Includes async validation for parent wallet traversal

backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletValidator.cs


30. backend/src/API/Controllers/AuthController.cs Formatting +43/-44

Auth controller file formatting and response type documentation

• Line ending normalization (CRLF to LF) with no functional changes
• Adds explicit response type annotations to ProducesResponseType attributes

backend/src/API/Controllers/AuthController.cs


31. backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommandHandler.cs ✨ Enhancement +87/-0

Transfer creation handler with paired transaction generation

• New handler for creating internal wallet transfers with automatic transaction generation
• Creates paired debit/credit transactions with auto-generated notes referencing wallet names
• Links transfer to source and destination transactions for audit trail

backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommandHandler.cs


32. backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommandHandler.cs ✨ Enhancement +86/-0

Cash adjustment handler for personal transactions

• New handler for personal-only cash adjustment transactions (no partner/debt)
• Supports credit (add money) and debit (subtract money) directions
• Enforces anti-bypass constraints to prevent partner/debt field usage

backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommandHandler.cs


33. backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs Formatting +42/-42

Login command handler file formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs


34. backend/src/Application/Common/Interfaces/IApplicationDbContext.cs Formatting +42/-42

Application database context interface formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Common/Interfaces/IApplicationDbContext.cs


35. backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQueryHandler.cs ✨ Enhancement +67/-0

Transfer query handler with filtering and pagination

• New handler for retrieving user-scoped transfer history with optional filtering
• Supports filtering by wallet, date range, and pagination
• Returns transfer DTOs with source/destination transaction IDs for audit trail

backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQueryHandler.cs


36. backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductResponse.cs ✨ Enhancement +73/-0

Quick deduct response model with debt notification

• New response model for Quick Deduct command including transaction and US-04 debt notification
• Defines DebtNotification class with balance, direction, and human-readable message
• Includes DebtDirection enum for UI state indication (PartnerOwesUser, UserOwesPartner, Settled)

backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductResponse.cs


37. backend/src/Application/Common/Security/PasswordHasher.cs Formatting +44/-44

Password hasher file formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Common/Security/PasswordHasher.cs


38. backend/src/Domain/Entities/Transaction.cs ✨ Enhancement +41/-1

Transaction entity extended with US-03 audit fields

• Adds US-03 audit fields: PayerMode, TotalAmount, DebtAmount, PartnerBalanceBefore,
 PartnerBalanceAfter
• Includes comprehensive XML documentation explaining field semantics and debt calculation
• Maintains backward compatibility with nullable audit fields

backend/src/Domain/Entities/Transaction.cs


39. backend/src/Application/Features/Transactions/TransactionDto.cs ✨ Enhancement +58/-0

Transaction data transfer object with transfer context

• New DTO for transaction API responses including wallet/partner names and transfer context
• Defines PayerMode enum (ToiTra, PartnerTra) and TransferDirection enum (Outgoing, Incoming)
• Includes US-03 audit fields and month-lock status

backend/src/Application/Features/Transactions/TransactionDto.cs


40. backend/src/Application/Features/Auth/Register/RegisterValidator.cs Formatting +25/-25

Register validator file formatting normalization

• Line ending normalization (CRLF to LF) with no functional changes

backend/src/Application/Features/Auth/Register/RegisterValidator.cs


41. backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.cs ⚙️ Configuration changes +68/-0

Database migration for US-03 transaction audit fields

• New EF Core migration adding US-03 audit columns to transactions table
• Adds payer_mode, total_amount, debt_amount, partner_balance_before,
 partner_balance_after columns
• All new columns are nullable for backward compatibility

backend/src/Persistence/Migrations/20260215064000_AddUs03TransactionFields.cs


42. backend/src/Application/Common/Locking/MonthLockPolicy.cs ✨ Enhancement +64/-0

Month locking policy with Vietnam timezone support

• New utility class for month-based locking logic with Vietnam timezone support
• Implements IsLocked() method to check if transaction date differs from current month
• Handles multiple timezone resolution strategies (IANA, Windows, custom fallback)
• Provides timezone conversion utilities for UTC and local datetime handling

backend/src/Application/Common/Locking/MonthLockPolicy.cs


43. backend/src/Persistence/Migrations/20260221164624_transfer-wallet.cs Database migration +71/-0

Add user and transaction audit trail to transfers

• Adds destination_transaction_id and source_transaction_id columns to transfers table
• Adds user_id column to transfers table with foreign key to users
• Creates index on user_id for query performance
• Enables audit trail linking between transfers and underlying transactions

backend/src/Persistence/Migrations/20260221164624_transfer-wallet.cs


44. backend/src/Domain/Entities/Wallet.cs Formatting +25/-25

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to entity structure

backend/src/Domain/Entities/Wallet.cs


45. backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommand.cs ✨ Enhancement +55/-0

Quick deduct transaction command with debt tagging

• New CQRS command for quick deduct transactions with hybrid debt-tagging
• Supports optional wallet and partner selection with defaults
• Includes PayerMode enum for ToiTra/PartnerTra payment modes
• Comprehensive XML documentation for all properties

backend/src/Application/Features/Transactions/QuickDeduct/QuickDeductCommand.cs


46. backend/src/Domain/Entities/User.cs Formatting +29/-29

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to entity structure

backend/src/Domain/Entities/User.cs


47. backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommand.cs ✨ Enhancement +59/-0

Cash adjustment transaction command

• New CQRS command for personal cash adjustment transactions
• Defines AdjustmentDirection enum (Credit/Debit)
• Enforces personal-only flow with required note for audit trail
• Supports optional transaction date parameter

backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentCommand.cs


48. backend/src/Application/Features/Users/UpdateProfile/UpdateProfileCommandHandler.cs ✨ Enhancement +59/-0

User profile update command handler

• Handler for updating user profile (username and email)
• Validates username and email uniqueness across other users
• Throws NotFoundException if user not found
• Throws ValidationException for duplicate username/email

backend/src/Application/Features/Users/UpdateProfile/UpdateProfileCommandHandler.cs


49. backend/src/Application/Common/Interfaces/IPasswordHasher.cs Formatting +22/-22

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to interface

backend/src/Application/Common/Interfaces/IPasswordHasher.cs


50. backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentValidator.cs ✨ Enhancement +44/-0

Cash adjustment validator

• Validator for cash adjustment command with personal-only enforcement
• Validates required fields (UserId, WalletId, Amount)
• Ensures wallet belongs to current user
• Enforces note length constraints

backend/src/Application/Features/Transactions/CashAdjustment/CreateCashAdjustmentValidator.cs


51. backend/src/Application/Features/Wallets/DeleteWallet/DeleteWalletCommandHandler.cs ✨ Enhancement +47/-0

Wallet deletion command handler

• Handler for soft-deleting wallets with validation
• Prevents deletion of wallets with child wallets or transactions
• Throws NotFoundException if wallet not found
• Throws InvalidOperationException for constraint violations

backend/src/Application/Features/Wallets/DeleteWallet/DeleteWalletCommandHandler.cs


52. backend/src/Application/Features/Wallets/CreateWallet/CreateWalletCommandHandler.cs ✨ Enhancement +52/-0

Wallet creation command handler

• Handler for creating new wallets with optional parent wallet
• Validates parent wallet exists and belongs to user
• Returns WalletDto with initial zero balance
• Supports hierarchical wallet structure

backend/src/Application/Features/Wallets/CreateWallet/CreateWalletCommandHandler.cs


53. backend/src/Application/Features/Transfers/GetTransferById/GetTransferByIdQueryHandler.cs ✨ Enhancement +45/-0

Get transfer by ID query handler

• Query handler for retrieving single transfer by ID
• Scoped to current user for security
• Maps transfer entity to TransferDto with audit trail fields
• Throws NotFoundException if transfer not found

backend/src/Application/Features/Transfers/GetTransferById/GetTransferByIdQueryHandler.cs


54. backend/src/Domain/Entities/DebtPartner.cs ✨ Enhancement +21/-23

Simplify debt partner balance model

• Replaces InitialBalance and Type fields with single signed Balance field
• Simplifies debt partner model by removing type discrimination
• Maintains all other properties and relationships

backend/src/Domain/Entities/DebtPartner.cs


55. backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletCommandHandler.cs ✨ Enhancement +51/-0

Wallet update command handler

• Handler for updating wallet metadata (name, description, parent)
• Validates wallet ownership before update
• Supports clearing parent wallet relationship
• Returns updated WalletDto

backend/src/Application/Features/Wallets/UpdateWallet/UpdateWalletCommandHandler.cs


56. backend/src/API/Contracts/Transactions/QuickDeductRequest.cs ✨ Enhancement +42/-0

Quick deduct API request contract

• API contract for quick deduct transaction requests
• Maps to QuickDeductCommand with optional wallet/partner resolution
• Includes payer mode, total, debt amount, and optional note/date

backend/src/API/Contracts/Transactions/QuickDeductRequest.cs


57. backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.cs Database migration +48/-0

Migrate debt partners to signed balance

• Migration to convert InitialBalance to signed value based on Type
• Positive values for Receivable, negative for Payable
• Drops Type column after conversion
• Includes rollback logic to restore Type column

backend/src/Persistence/Migrations/20260214092505_DebtPartnersSignedInitialBalanceDropType.cs


58. backend/src/Application/Features/Users/UpdateDefaultPartner/UpdateDefaultPartnerCommandHandler.cs ✨ Enhancement +43/-0

Update default debt partner handler

• Handler for setting user's default debt partner
• Validates partner exists and belongs to user
• Allows clearing default partner by passing null
• Throws NotFoundException for invalid partner

backend/src/Application/Features/Users/UpdateDefaultPartner/UpdateDefaultPartnerCommandHandler.cs


59. backend/src/Application/Features/Users/UpdateDefaultWallet/UpdateDefaultWalletCommandHandler.cs ✨ Enhancement +43/-0

Update default wallet handler

• Handler for setting user's default wallet
• Validates wallet exists and belongs to user
• Allows clearing default wallet by passing null
• Throws NotFoundException for invalid wallet

backend/src/Application/Features/Users/UpdateDefaultWallet/UpdateDefaultWalletCommandHandler.cs


60. backend/src/Application/Features/Users/ChangePassword/ChangePasswordCommandHandler.cs ✨ Enhancement +44/-0

Change password command handler

• Handler for changing user password with verification
• Validates current password before allowing change
• Hashes new password using IPasswordHasher
• Throws ValidationException for incorrect current password

backend/src/Application/Features/Users/ChangePassword/ChangePasswordCommandHandler.cs


61. backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQuery.cs ✨ Enhancement +38/-0

Get transactions query with pagination

• Query for retrieving paginated transactions with optional filtering
• Supports filtering by wallet, partner, and keyword search
• Includes pagination parameters (page, pageSize)
• Returns PagedResult<TransactionDto>

backend/src/Application/Features/Transactions/GetTransactions/GetTransactionsQuery.cs


62. backend/src/Application/Features/Wallets/GetWalletById/GetWalletByIdQueryHandler.cs ✨ Enhancement +40/-0

Get wallet by ID query handler

• Query handler for retrieving single wallet with calculated balance
• Scoped to current user for security
• Calculates balance from related transactions
• Throws NotFoundException if wallet not found

backend/src/Application/Features/Wallets/GetWalletById/GetWalletByIdQueryHandler.cs


63. backend/src/Application/DependencyInjection.cs ✨ Enhancement +27/-23

Add validation pipeline behavior to MediatR

• Adds ValidationBehavior<,> as MediatR pipeline behavior
• Enables automatic validation for all CQRS commands/queries
• Imports Application.Common.Behaviors namespace

backend/src/Application/DependencyInjection.cs


64. backend/src/Application/Features/DebtPartners/UpdateDebtPartner/UpdateDebtPartnerCommandHandler.cs ✨ Enhancement +40/-0

Update debt partner command handler

• Handler for updating debt partner name and balance
• Validates partner exists and belongs to user
• Excludes soft-deleted partners
• Returns updated DebtPartnerDto

backend/src/Application/Features/DebtPartners/UpdateDebtPartner/UpdateDebtPartnerCommandHandler.cs


65. backend/src/Application/Features/DebtPartners/GetDebtPartnerById/GetDebtPartnerByIdQueryHandler.cs ✨ Enhancement +38/-0

Get debt partner by ID query handler

• Query handler for retrieving single debt partner
• Scoped to current user and excludes soft-deleted partners
• Maps to DebtPartnerDto
• Throws NotFoundException if partner not found

backend/src/Application/Features/DebtPartners/GetDebtPartnerById/GetDebtPartnerByIdQueryHandler.cs


66. backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionValidator.cs ✨ Enhancement +33/-0

Update transaction validator

• Validator for transaction updates with debt amount constraints
• Validates debt amount is non-negative and not exceeding total
• Enforces valid PayerMode enum values
• Validates note length and required fields

backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionValidator.cs


67. backend/src/API/Contracts/Transactions/UpdateTransactionRequest.cs ✨ Enhancement +38/-0

Update transaction API request contract

• API contract for updating transaction with debt tracking
• Supports adding/modifying debt information
• Includes optional partner ID, payer mode, amounts, and note

backend/src/API/Contracts/Transactions/UpdateTransactionRequest.cs


68. backend/src/Application/Features/Wallets/GetWallets/GetWalletsQueryHandler.cs ✨ Enhancement +35/-0

Get wallets query handler

• Query handler for retrieving all user wallets
• Calculates balance for each wallet from transactions
• Returns sorted list by wallet name
• Scoped to current user

backend/src/Application/Features/Wallets/GetWallets/GetWalletsQueryHandler.cs


69. backend/src/Application/Features/Wallets/CreateWallet/CreateWalletValidator.cs ✨ Enhancement +38/-0

Create wallet validator

• Validator for wallet creation with parent validation
• Ensures parent wallet belongs to current user if provided
• Validates required fields (UserId, Name)
• Async validation for parent wallet existence

backend/src/Application/Features/Wallets/CreateWallet/CreateWalletValidator.cs


70. backend/src/Application/Features/DebtPartners/CreateDebtPartner/CreateDebtPartnerCommandHandler.cs ✨ Enhancement +38/-0

Create debt partner command handler

• Handler for creating new debt partner
• Initializes with provided name and balance
• Sets IsDeleted to false and CreatedAt timestamp
• Returns DebtPartnerDto

backend/src/Application/Features/DebtPartners/CreateDebtPartner/CreateDebtPartnerCommandHandler.cs


71. backend/src/Persistence/DependencyInjection.cs ⚙️ Configuration changes +22/-20

Add snake case naming convention to EF Core

• Adds .UseSnakeCaseNamingConvention() to EF Core configuration
• Enables automatic snake_case column naming for PostgreSQL
• Improves database naming consistency

backend/src/Persistence/DependencyInjection.cs


72. backend/src/API/Contracts/Transfers/CreateTransferRequest.cs ✨ Enhancement +38/-0

Create transfer API request contract

• API contract for creating internal wallet transfers
• Includes source/destination wallet IDs and amount
• Supports optional audit trail transaction references
• Includes optional note for transfer documentation

backend/src/API/Contracts/Transfers/CreateTransferRequest.cs


73. backend/src/Application/Features/DebtPartners/GetDebtPartners/GetDebtPartnersQueryHandler.cs ✨ Enhancement +33/-0

Get debt partners query handler

• Query handler for retrieving all user debt partners
• Excludes soft-deleted partners
• Returns sorted list by partner name
• Scoped to current user

backend/src/Application/Features/DebtPartners/GetDebtPartners/GetDebtPartnersQueryHandler.cs


74. backend/src/Application/Common/Behaviors/ValidationBehavior.cs ✨ Enhancement +36/-0

Validation pipeline behavior for MediatR

• MediatR pipeline behavior for automatic request validation
• Collects validation errors from all registered validators
• Throws ValidationException if validation fails
• Enables centralized validation across all commands/queries

backend/src/Application/Common/Behaviors/ValidationBehavior.cs


75. backend/src/Application/Features/DebtPartners/DeleteDebtPartner/DeleteDebtPartnerCommandHandler.cs ✨ Enhancement +33/-0

Delete debt partner command handler

• Handler for soft-deleting debt partner
• Sets IsDeleted flag instead of hard delete
• Validates partner exists and belongs to user
• Throws NotFoundException if partner not found

backend/src/Application/Features/DebtPartners/DeleteDebtPartner/DeleteDebtPartnerCommandHandler.cs


76. backend/src/Application/Features/Users/GetProfile/GetProfileQueryHandler.cs ✨ Enhancement +37/-0

Get user profile query handler

• Query handler for retrieving user profile information
• Returns username, email, name, and creation date
• Throws NotFoundException if user not found
• Scoped to current user

backend/src/Application/Features/Users/GetProfile/GetProfileQueryHandler.cs


77. backend/src/Application/Features/Users/GetUserPreferences/GetUserPreferencesQueryHandler.cs ✨ Enhancement +34/-0

Get user preferences query handler

• Query handler for retrieving user preferences (default wallet/partner)
• Returns empty preferences if user not found
• Scoped to current user

backend/src/Application/Features/Users/GetUserPreferences/GetUserPreferencesQueryHandler.cs


78. backend/src/Application/Features/Auth/Login/LoginValidator.cs Formatting +17/-17

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to validator

backend/src/Application/Features/Auth/Login/LoginValidator.cs


79. backend/src/API/Contracts/Transactions/CashAdjustmentRequest.cs ✨ Enhancement +32/-0

Cash adjustment API request contract

• API contract for cash adjustment requests
• Includes wallet ID, direction (Credit/Debit), amount, and required note
• Supports optional transaction date

backend/src/API/Contracts/Transactions/CashAdjustmentRequest.cs


80. backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQuery.cs ✨ Enhancement +20/-0

Get monthly statistics query

• Query for retrieving monthly transaction statistics
• Returns expense, income, debt increase/decrease metrics
• Configurable month range (default 6 months)
• Includes MonthlyStatsDto with formatted month labels

backend/src/Application/Features/Transactions/GetMonthlyStats/GetMonthlyStatsQuery.cs


81. backend/src/Application/Common/Interfaces/ITokenGenerator.cs Formatting +16/-16

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to interface

backend/src/Application/Common/Interfaces/ITokenGenerator.cs


82. backend/src/Application/Features/Auth/Register/RegisterRequest.cs ✨ Enhancement +14/-19

Remove data annotations from register request

• Removes [Required] and [EmailAddress] data annotations
• Removes [MinLength(3)] constraint from Name field
• Simplifies to plain properties for validation via FluentValidation

backend/src/Application/Features/Auth/Register/RegisterRequest.cs


83. backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQuery.cs ✨ Enhancement +25/-0

Get transfers query with filtering

• Query for retrieving transfer history with optional filtering
• Supports wallet ID filter and date range filtering
• Includes pagination parameters
• Returns IReadOnlyList<TransferDto>

backend/src/Application/Features/Transfers/GetTransfers/GetTransfersQuery.cs


84. backend/src/Persistence/Migrations/20260208103321_initDB.cs Formatting +22/-22

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to migration

backend/src/Persistence/Migrations/20260208103321_initDB.cs


85. backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommand.cs ✨ Enhancement +29/-0

Update transaction command

• CQRS command for updating transaction with debt tracking
• Supports adding/modifying partner and debt information
• Includes optional transaction date override
• Returns TransactionDto

backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommand.cs


86. backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommand.cs ✨ Enhancement +24/-0

Create transfer command

• CQRS command for creating internal wallet transfers
• Includes source/destination wallet IDs and amount
• Supports optional audit trail transaction references
• Returns TransferDto

backend/src/Application/Features/Transfers/CreateTransfer/CreateTransferCommand.cs


87. backend/src/Application/Features/Transfers/TransferDto.cs ✨ Enhancement +20/-0

Transfer data transfer object

• DTO for transfer representation in application layer
• Includes audit trail references to source/destination transactions
• Contains transfer metadata (ID, wallets, amount, timestamp)

backend/src/Application/Features/Transfers/TransferDto.cs


88. backend/src/Application/Features/Auth/Register/RegisterCommand.cs Formatting +11/-11

File formatting normalization

• Line ending normalization (CRLF to LF)
• No functional changes to command

backend/src/Application/Features/Auth/Register/RegisterCommand.cs


89. backend/src/Domain/Entities/Transfer.cs ✨ Enhancement +6/-0

Add user and audit trail to transfer entity

• Adds UserId and User navigation property for user scoping
• Adds SourceTransactionId and DestinationTransactionId for audit trail
• Enables tracking transfer origins and destinations

backend/src/Domain/Entities/Transfer.cs


90. backend/src/Application/Comm...

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Mar 24, 2026

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. JWT expiry mismatch 🐞 Bug ✓ Correctness
Description
LoginCommandHandler returns an Expiration timestamp of now+24h, but the JWT exp claim is generated
from Jwt:ExpirationMinutes (60 by default). Clients relying on the Expiration field will keep using
an already-expired token and hit unexpected 401s.
Code

backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs[R36-40]

+        return new LoginResponse
+        {
+            Token = token,
+            Expiration = DateTime.UtcNow.AddHours(24)
+        };
Evidence
LoginCommandHandler hard-codes Expiration to 24 hours, while TokenGenerator sets the token expiry to
the configured ExpirationMinutes (60) and appsettings.json sets it to 60, creating a mismatch
between server-issued token validity and the response metadata.

backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs[34-40]
backend/src/Application/Common/Security/TokenGenerator.cs[31-37]
backend/src/Application/Common/Security/TokenGenerator.cs[67-73]
backend/src/API/appsettings.json[15-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`LoginResponse.Expiration` is set to `UtcNow+24h`, but JWT `exp` is set to `UtcNow+ExpirationMinutes`. This mismatch causes clients to treat expired JWTs as still valid.

## Issue Context
JWT expiry is determined in `TokenGenerator` using `Jwt:ExpirationMinutes`.

## Fix Focus Areas
- backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs[34-40]
- backend/src/Application/Common/Security/TokenGenerator.cs[31-37]
- backend/src/API/appsettings.json[15-20]

## Suggested fix
Derive `LoginResponse.Expiration` from the same configured expiration minutes (or remove the field and let clients parse `exp`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Hardcoded JWT secret 🐞 Bug ⛨ Security
Description
The repository contains a concrete JWT signing secret in backend appsettings.json, and
docker-compose does not override it for the Production container. Deployments that use this config
allow anyone with repo access to forge tokens and bypass authentication.
Code

backend/src/API/appsettings.json[R15-19]

+  "Jwt": {
+    "Secret": "your-super-secret-key-change-this-in-production-min-32-chars!",
+    "Issuer": "MA6Debt",
+    "Audience": "MA6DebtUsers",
+    "ExpirationMinutes": 60
Evidence
backend/src/API/appsettings.json hardcodes Jwt:Secret. The backend reads JWT settings from
configuration and only checks for missing values, not for a default/unsafe value. The provided
docker-compose.yml sets ASPNETCORE_ENVIRONMENT=Production but does not set Jwt__Secret, so the
committed secret will be used in production by default.

backend/src/API/appsettings.json[15-20]
backend/src/API/Program.cs[47-56]
docker-compose.yml[33-49]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A JWT signing secret is committed in `appsettings.json` and is used by default in Docker production runs, enabling token forgery.

## Issue Context
`Program.cs` reads `Jwt:Secret` and only validates it's non-empty.

## Fix Focus Areas
- backend/src/API/appsettings.json[15-20]
- backend/src/API/Program.cs[47-56]
- docker-compose.yml[33-49]

## Suggested fix
- Remove the concrete secret from `appsettings.json` (use a placeholder or omit it).
- Require `Jwt__Secret` via environment variables/secret manager in Production (optionally fail fast if it matches a known placeholder).
- Set `Jwt__Secret` in deployment configuration (not committed).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Exception message disclosure 🐞 Bug ⛨ Security
Description
GlobalExceptionHandler returns InvalidOperationException.Message to the client in a 400 response.
This exposes internal business logic/diagnostics in API responses and makes it easier to
reverse-engineer server behavior.
Code

backend/src/API/Middleware/GlobalExceptionHandler.cs[R89-107]

+            else if (exception is InvalidOperationException invalidOperationException)
            {
-                _logger.LogError(exception, "An unhandled exception has occurred.");
+                _logger.LogWarning("Business rule violation: {Message}", invalidOperationException.Message);

-                httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError;
+                httpContext.Response.StatusCode = StatusCodes.Status400BadRequest;

                var response = new ValidationErrorResponse
                {
-                    Type = "https://tools.ietf.org/html/rfc7231#section-6.6.1",
-                    Title = "Internal Server Error",
-                    Status = StatusCodes.Status500InternalServerError,
+                    Type = "https://tools.ietf.org/html/rfc7231#section-6.5.1",
+                    Title = "Bad Request",
+                    Status = StatusCodes.Status400BadRequest,
                    Errors = new Dictionary<string, string[]>
                    {
-                        { "InternalServerError", new string[] { "An error occurred while processing your request." } }
+                        { "BusinessRule", new string[] { invalidOperationException.Message } }
                    }
                };

                await httpContext.Response.WriteAsJsonAsync(response, cancellationToken);
                return true;
Evidence
The handler explicitly serializes invalidOperationException.Message into the response body. The
codebase throws InvalidOperationException with diagnostic-style strings (e.g., "This should have
been caught by validation"), which will be exposed to callers.

backend/src/API/Middleware/GlobalExceptionHandler.cs[89-107]
backend/src/Application/Features/Transactions/UpdateTransaction/UpdateTransactionCommandHandler.cs[190-199]
backend/src/Application/Features/Wallets/CreateWallet/CreateWalletCommandHandler.cs[25-34]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`InvalidOperationException.Message` is returned to clients, disclosing internal implementation details.

## Issue Context
Handlers use `InvalidOperationException` for business rules and internal invariants.

## Fix Focus Areas
- backend/src/API/Middleware/GlobalExceptionHandler.cs[89-107]

## Suggested fix
Return a generic client-safe message (and optionally a stable error code), while logging the detailed exception message server-side.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. CORS empty-origins bug 🐞 Bug ⛯ Reliability
Description
CORS policy uses allowedOrigins?.Split(...) ?? default, so a configured empty string becomes an
empty origins array (not null) and results in WithOrigins() receiving no allowed origins. This
breaks all browser cross-origin calls when Cors:Origins is present but empty/whitespace.
Code

backend/src/API/Program.cs[R26-32]

+                var allowedOrigins = builder.Configuration["Cors:Origins"];
+                options.AddPolicy("AllowReactApp",
+                    builder => builder
+                        .WithOrigins(allowedOrigins?.Split(',', StringSplitOptions.RemoveEmptyEntries) ?? new[] { "http://localhost:3000" })
+                        .AllowAnyMethod()
+                        .AllowAnyHeader()
+                        .AllowCredentials());
Evidence
Split(...RemoveEmptyEntries) returns an empty array for ""/whitespace inputs, which bypasses the
null-coalescing fallback. This yields a policy that does not allow any origins, breaking the
frontend in that configuration state.

backend/src/API/Program.cs[24-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Empty/whitespace `Cors:Origins` produces `WithOrigins([])` and blocks all cross-origin requests.

## Issue Context
`Cors:Origins` is a comma-separated string.

## Fix Focus Areas
- backend/src/API/Program.cs[24-33]

## Suggested fix
Use `string.IsNullOrWhiteSpace(allowedOrigins)` to decide fallback, otherwise split and pass the resulting array.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. EF drift warning suppressed 🐞 Bug ⛯ Reliability
Description
ApplicationDbContext ignores EF Core PendingModelChangesWarning globally, which can hide
model/schema drift and increase the chance of runtime failures when migrations are missing. This is
especially risky since Production does not auto-migrate in Program.cs.
Code

backend/src/Persistence/Data/ApplicationDbContext.cs[R19-26]

+        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        {
+            base.OnConfiguring(optionsBuilder);
+            optionsBuilder
+                .UseSnakeCaseNamingConvention()
+                .ConfigureWarnings(w =>
+                    w.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning));
+        }
Evidence
The DbContext is configured to ignore PendingModelChangesWarning, reducing visibility into schema
drift. Program.cs only auto-migrates in Development/Staging, so production drift will not be
corrected automatically and will also be harder to detect.

backend/src/Persistence/Data/ApplicationDbContext.cs[19-26]
backend/src/API/Program.cs[83-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Suppressing `PendingModelChangesWarning` can mask missing migrations and schema drift.

## Issue Context
Auto-migration only runs in Development/Staging.

## Fix Focus Areas
- backend/src/Persistence/Data/ApplicationDbContext.cs[19-26]
- backend/src/API/Program.cs[83-107]

## Suggested fix
Remove the suppression, or scope it to Development only, and/or add a CI check that verifies migrations are up to date.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. JWT in localStorage 🐞 Bug ⛨ Security
Description
The frontend persists the bearer token in localStorage, which is accessible to any injected script.
This increases the impact of any XSS by enabling token theft and account compromise.
Code

frontend/src/lib/authToken.ts[R3-9]

+export const setAuthToken = (token: string) => {
+  if (typeof window === "undefined") {
+    return;
+  }
+
+  localStorage.setItem(TOKEN_KEY, token);
+};
Evidence
setAuthToken stores the JWT via localStorage.setItem. LocalStorage is readable by JavaScript, so
any XSS can exfiltrate the token.

frontend/src/lib/authToken.ts[1-9]
frontend/src/features/auth/components/LoginForm.tsx[62-70]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Storing JWTs in `localStorage` makes them accessible to injected scripts, increasing XSS blast radius.

## Issue Context
Login flow calls `setAuthToken(response.token)`.

## Fix Focus Areas
- frontend/src/lib/authToken.ts[1-25]
- frontend/src/features/auth/components/LoginForm.tsx[62-70]

## Suggested fix
Switch to httpOnly, Secure cookies (server-issued) or keep tokens only in memory with an appropriate refresh strategy, and remove localStorage persistence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +36 to +40
return new LoginResponse
{
Token = token,
Expiration = DateTime.UtcNow.AddHours(24)
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. Jwt expiry mismatch 🐞 Bug ✓ Correctness

LoginCommandHandler returns an Expiration timestamp of now+24h, but the JWT exp claim is generated
from Jwt:ExpirationMinutes (60 by default). Clients relying on the Expiration field will keep using
an already-expired token and hit unexpected 401s.
Agent Prompt
## Issue description
`LoginResponse.Expiration` is set to `UtcNow+24h`, but JWT `exp` is set to `UtcNow+ExpirationMinutes`. This mismatch causes clients to treat expired JWTs as still valid.

## Issue Context
JWT expiry is determined in `TokenGenerator` using `Jwt:ExpirationMinutes`.

## Fix Focus Areas
- backend/src/Application/Features/Auth/Login/LoginCommandHandler.cs[34-40]
- backend/src/Application/Common/Security/TokenGenerator.cs[31-37]
- backend/src/API/appsettings.json[15-20]

## Suggested fix
Derive `LoginResponse.Expiration` from the same configured expiration minutes (or remove the field and let clients parse `exp`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +15 to +19
"Jwt": {
"Secret": "your-super-secret-key-change-this-in-production-min-32-chars!",
"Issuer": "MA6Debt",
"Audience": "MA6DebtUsers",
"ExpirationMinutes": 60
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

2. Hardcoded jwt secret 🐞 Bug ⛨ Security

The repository contains a concrete JWT signing secret in backend appsettings.json, and
docker-compose does not override it for the Production container. Deployments that use this config
allow anyone with repo access to forge tokens and bypass authentication.
Agent Prompt
## Issue description
A JWT signing secret is committed in `appsettings.json` and is used by default in Docker production runs, enabling token forgery.

## Issue Context
`Program.cs` reads `Jwt:Secret` and only validates it's non-empty.

## Fix Focus Areas
- backend/src/API/appsettings.json[15-20]
- backend/src/API/Program.cs[47-56]
- docker-compose.yml[33-49]

## Suggested fix
- Remove the concrete secret from `appsettings.json` (use a placeholder or omit it).
- Require `Jwt__Secret` via environment variables/secret manager in Production (optionally fail fast if it matches a known placeholder).
- Set `Jwt__Secret` in deployment configuration (not committed).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +89 to 107
else if (exception is InvalidOperationException invalidOperationException)
{
_logger.LogError(exception, "An unhandled exception has occurred.");
_logger.LogWarning("Business rule violation: {Message}", invalidOperationException.Message);

httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError;
httpContext.Response.StatusCode = StatusCodes.Status400BadRequest;

var response = new ValidationErrorResponse
{
Type = "https://tools.ietf.org/html/rfc7231#section-6.6.1",
Title = "Internal Server Error",
Status = StatusCodes.Status500InternalServerError,
Type = "https://tools.ietf.org/html/rfc7231#section-6.5.1",
Title = "Bad Request",
Status = StatusCodes.Status400BadRequest,
Errors = new Dictionary<string, string[]>
{
{ "InternalServerError", new string[] { "An error occurred while processing your request." } }
{ "BusinessRule", new string[] { invalidOperationException.Message } }
}
};

await httpContext.Response.WriteAsJsonAsync(response, cancellationToken);
return true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

3. Exception message disclosure 🐞 Bug ⛨ Security

GlobalExceptionHandler returns InvalidOperationException.Message to the client in a 400 response.
This exposes internal business logic/diagnostics in API responses and makes it easier to
reverse-engineer server behavior.
Agent Prompt
## Issue description
`InvalidOperationException.Message` is returned to clients, disclosing internal implementation details.

## Issue Context
Handlers use `InvalidOperationException` for business rules and internal invariants.

## Fix Focus Areas
- backend/src/API/Middleware/GlobalExceptionHandler.cs[89-107]

## Suggested fix
Return a generic client-safe message (and optionally a stable error code), while logging the detailed exception message server-side.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant