Skip to content

Conversation

@EnesEfeTokta
Copy link
Owner

This pull request introduces several new DTO classes and updates to enums in the FinTrack project to support enhanced functionality for categories, debts, feedback, notifications, reports, and user settings. Additionally, some enums have been expanded or renamed to improve clarity and functionality.

New DTO Classes

Category Management:

  • Added CategoryCreateDto, CategoryDto, and CategoryUpdateDto for handling category creation, retrieval, and updates. ([[1]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-4d8cfc2a9f5dc2bccd8e69afe7cabbf6393b3f28d94a2e387a724d99eb5e7e17R1-R7), [[2]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-6813a6856ed6fa8654c002ea70c2a0a748a9f6ae59ab0bd3598407cd87707d83R1-R10), [[3]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-960e6110973407e59bbe22107386a914b9cd21613ac6ef20867f3d06e0cd0aa4R1-R7))

Debt Management:

  • Introduced CreateDebtOfferRequestDto, DebtCreateDto, DebtDto, and DebtUpdateDto for managing debts and debt offers, including detailed tracking of statuses and timestamps. ([[1]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-dc9471fa6be5112f920b93c5e1f7f90ebf42f64b151882512d918c929584cc43R1-R17), [[2]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-a22fddb75a39f982b7221e571e2ba1a4832fd8cf732795ba24fcfda8c7109a7dR1-R13), [[3]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-7e3ab050bb62b390fb0f1c1ec984fe269590afa95b24292b290b8a9032c5a34cR1-R28), [[4]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-1e4be6961e63b26694bc4825ea972550e6e9d95ba990419d4e5490cbea6900d1R1-R9))

Feedback:

  • Added FeedbackCreateDto and FeedbackDto for submitting and retrieving user feedback with optional file attachments. ([[1]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-f66fd7fcf3e87bc26fb753b34511476665d0e4da07e6cf129cf3738a3047e87aR1-R12), [[2]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-9a023c82611e2e41e5f8fadf152f09ba1a9db8244c4dfb1e0d8693c070cb99aaR1-R15))

Notifications:

  • Created NotificationDto for managing user notifications, including read status and timestamps. ([FinTrack/Dtos/NotificationDtos/NotificationDto.csR1-R16](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-06625f91abf5c8923f64d907a3aa57620aec942c6a083415e9a6042f7fc5c535R1-R16))

Reporting:

  • Added ReportRequestDto to handle report generation requests with filters and export options. ([FinTrack/Dtos/ReportDtos/ReportRequestDto.csR1-R30](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-29739ddd76e63753f4601cb23f75a95a1a8fda932dc78c627571e7a6a60485eaR1-R30))

User Settings:

  • Introduced DTOs for managing user settings: ProfileSettingsDto, ProfileSettingsUpdateDto, UserAppSettingsDto, UserAppSettingsUpdateDto, UserNotificationSettingsDto, and UserNotificationSettingsUpdateDto. These cover profile settings, app preferences, and notification configurations. ([[1]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-d3d75033be075c82a0b25ff3dd6c528797609ada12d6ab45e8c2f52bd04d5b7aR1-R12), [[2]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-b79ce6e2f0862c7422acd76f705187bb82e221e4074344fad55fb799649e22a2R1-R9), [[3]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-34be2737c44783d98ef7a72c12309bb1198b496e94bfe08dab17eb413c601999R1-R13), [[4]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-2c24562484efd77b97567451670814579cee92dc558841b0063b67f6b4da2bfdR1-R10), [[5]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-e0d0a471c4a09b90af3464e9aed7e7ebf44e8222caa2d589a8391398795032a9R1-R14), [[6]](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-ca062973b8ee7411d968bff5f2528a00a764f77b952aa59025820848e95f23d9R1-R11))

Enum Updates

Debt Status:

  • Added a new status AcceptedPendingVideoUpload to the DebtStatusType enum for tracking video uploads in debt workflows. ([FinTrack/Enums/DebtStatus.csL6-R13](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-1b6f370e26267a4a620440539d1075fb9e7dc8cf95f104fe5801c34b9f6160adL6-R13))

Currency Conversion:

  • Added a new Neutral value to the CurrencyConversionType enum for scenarios where no change occurs. ([FinTrack/Enums/CurrencyConversionType.csL3-R8](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-af923dfd8ad703b854984af5db0ecdcc89341458ee42294b5c815c5d341ea156L3-R8))

Export Format:

  • Renamed ExportFormat to DocumentFormat for improved clarity. ([FinTrack/Enums/ExportFormat.csL3-R3](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-de7220fed0e9d40c4218c7a2238793866325787e60fbe7a4cb6593dcc582b40dL3-R3))

…ndicators

Added historical exchange rate chart and detailed change indicators (daily, weekly, monthly) to currency details. Updated CurrencyModel and CurrenciesViewModel to support new data, including change types and foreground colors. Improved UI in CurrenciesView.xaml to display charts, loading states, and dynamic change colors. Introduced a custom circular progress bar style for loading indicators.
…ency charts

Introduces DTOs for debt operations and updates DebtModel to support new status and user logic. Adds file upload support to ApiService for video approvals. Refactors DebtViewModel for API integration, offer response, and video upload. Enhances CurrenciesViewModel and CurrenciesView.xaml with period analysis, gauge, and pie charts. Updates styles and converters for improved UI consistency. Expands DebtStatusType enum and modernizes debt and currency views.
…n features

Introduces DTOs for categories, feedback, notifications, and reports. Adds helper classes for UI behaviors and file operations. Refactors enums and models for consistency. Updates ViewModels to use new DTOs and API methods, improves feedback/report/notification logic, and enhances error handling and UI responsiveness. Integrates Microsoft.Xaml.Behaviors.Wpf for advanced UI behaviors.
Introduces DTOs for profile, app, and notification settings. Refactors AppSettingsContentViewModel, NotificationSettingsContentViewModel, and ProfileSettingsContentViewModel to use DTOs and async API calls. Updates related XAML views for improved binding and loading states.
Unused using directives were removed across multiple files to improve code clarity and reduce unnecessary dependencies. Minor code cleanups were performed, such as fixing variable references and formatting, to enhance maintainability.
@EnesEfeTokta EnesEfeTokta requested a review from Copilot July 30, 2025 13:40
@EnesEfeTokta EnesEfeTokta self-assigned this Jul 30, 2025
@EnesEfeTokta EnesEfeTokta added the enhancement New feature or request label Jul 30, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a comprehensive set of DTO classes and enum updates to enhance the FinTrack application's functionality across multiple domains including categories, debts, feedback, notifications, reports, and user settings. The changes also include significant UI improvements and API integration updates.

  • Addition of new DTO classes for complete CRUD operations across all major features
  • Updates to existing enums for improved clarity and new status tracking
  • Enhanced ViewModels with proper API integration and async operations
  • UI improvements including loading states, validation, and better user experience

Reviewed Changes

Copilot reviewed 55 out of 56 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ViewModels/*.cs Updated to integrate with new DTOs and provide async API operations
Views/*.xaml Enhanced UI with loading indicators, validation, and improved user interactions
Dtos//.cs New DTO classes for categories, debts, feedback, notifications, reports, and settings
Enums/*.cs Updated enums with new values and renamed for better clarity
Services/Api/*.cs Enhanced API service with file upload and report download capabilities
Models/*.cs Updated models to support new features and proper data binding
Helpers/*.cs New helper classes for converters, behaviors, and file operations
Comments suppressed due to low confidence (5)

FinTrack/ViewModels/FeedbackViewModel.cs:29

  • Property name should follow PascalCase convention. Consider renaming 'isSending' to 'IsSending' to match other observable properties in this class.
        private bool isSending = false;

FinTrack/ViewModels/NotificationViewModel.cs:17

  • The field name '_notifications' uses underscore prefix while other observable properties in this class don't. Consider using 'notifications' for consistency with the existing pattern.
        private ObservableCollection<NotificationModel> _notifications = new();

FinTrack/ViewModels/NotificationViewModel.cs:22

  • The field name '_isLoading' uses underscore prefix while other observable properties in this class don't. Consider using 'isLoading' for consistency with the existing pattern.
        private bool _isLoading;

FinTrack/ViewModels/NotificationSettingsContentViewModel.cs:18

  • Inconsistent field naming convention. This field uses underscore prefix while other observable properties in the codebase typically don't. Consider using 'enableDesktopNotifications' for consistency.
        private bool _enableDesktopNotifications;

FinTrack/ViewModels/AppSettingsContentViewModel.cs:18

  • Inconsistent field naming convention. This field uses underscore prefix while other observable properties in the codebase typically don't. Consider using 'selectedAppearanceType' for consistency.
        private AppearanceType _selectedAppearanceType;

Comment on lines +59 to 66
await _apiService.PostAsync<object>("Feedback", newFeedback);

// TODO: feedbackMessage should be sent to a server or an email...
// TODO: Burada sisteme bir e-posta göndermekte fayda var...

MessageBox.Show(feedbackMessage, "Feedback Submitted", MessageBoxButton.OK, MessageBoxImage.Information);
_logger.LogInformation("Feedback submitted: Subject: {Subject}, Type: {Type}, Description: {Description}, File Path: {FilePath}",
subject, feedbackType, description, filePath);
newFeedback.Subject, newFeedback.Type, newFeedback.Description, newFeedback.SavedFilePath);

ClearForm();
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for the API call. If this operation fails, the user won't receive any feedback about the error, and the form clearing at line 67 will still occur.

Copilot uses AI. Check for mistakes.
IsBusy = true;
try
{
var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("Account");
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Inconsistent API endpoint casing. This line uses 'Account' while line 96 uses 'categories' (lowercase). This inconsistency could lead to API call failures.

Suggested change
var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("Account");
var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("account");

Copilot uses AI. Check for mistakes.

var handler = new JwtSecurityTokenHandler();
var jsonToken = handler.ReadJwtToken(SessionManager.CurrentToken);
_currentUserId = Convert.ToInt16(jsonToken.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier)?.Value);
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Potential null reference exception. If the claim is not found, FirstOrDefault returns null, and accessing .Value will throw a NullReferenceException. Also, Convert.ToInt16 will throw if the value is null or invalid.

Suggested change
_currentUserId = Convert.ToInt16(jsonToken.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier)?.Value);
var userIdClaim = jsonToken.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier);
if (userIdClaim != null && int.TryParse(userIdClaim.Value, out var userId))
{
_currentUserId = userId;
}
else
{
_logger.LogError("Failed to retrieve or parse user ID from JWT claims.");
_currentUserId = -1; // Default value indicating an error
}

Copilot uses AI. Check for mistakes.
Comment on lines +307 to +311
var format = "bin";
if (payload is ReportRequestDto dto)
{
format = dto.ExportFormat.ToString().ToLower();
}
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The method accepts a generic type T but then checks if it's specifically a ReportRequestDto. This breaks the generic contract and creates tight coupling. Consider either making the method specific to ReportRequestDto or finding a more generic way to determine the file extension.

Suggested change
var format = "bin";
if (payload is ReportRequestDto dto)
{
format = dto.ExportFormat.ToString().ToLower();
}
var format = payload.ExportFormat.ToString().ToLower();

Copilot uses AI. Check for mistakes.
@EnesEfeTokta EnesEfeTokta merged commit c66fffa into main Jul 30, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants