-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #13
Conversation
…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.
There was a problem hiding this 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;
| 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(); |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
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.
| IsBusy = true; | ||
| try | ||
| { | ||
| var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("Account"); |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
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.
| var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("Account"); | |
| var accountsFromApi = await _apiService.GetAsync<List<AccountDto>>("account"); |
|
|
||
| var handler = new JwtSecurityTokenHandler(); | ||
| var jsonToken = handler.ReadJwtToken(SessionManager.CurrentToken); | ||
| _currentUserId = Convert.ToInt16(jsonToken.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier)?.Value); |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
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.
| _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 | |
| } |
| var format = "bin"; | ||
| if (payload is ReportRequestDto dto) | ||
| { | ||
| format = dto.ExportFormat.ToString().ToLower(); | ||
| } |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
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.
| var format = "bin"; | |
| if (payload is ReportRequestDto dto) | |
| { | |
| format = dto.ExportFormat.ToString().ToLower(); | |
| } | |
| var format = payload.ExportFormat.ToString().ToLower(); |
This pull request introduces several new DTO classes and updates to enums in the
FinTrackproject 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:
CategoryCreateDto,CategoryDto, andCategoryUpdateDtofor 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:
CreateDebtOfferRequestDto,DebtCreateDto,DebtDto, andDebtUpdateDtofor 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:
FeedbackCreateDtoandFeedbackDtofor 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:
NotificationDtofor 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:
ReportRequestDtoto 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:
ProfileSettingsDto,ProfileSettingsUpdateDto,UserAppSettingsDto,UserAppSettingsUpdateDto,UserNotificationSettingsDto, andUserNotificationSettingsUpdateDto. 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:
AcceptedPendingVideoUploadto theDebtStatusTypeenum 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:
Neutralvalue to theCurrencyConversionTypeenum for scenarios where no change occurs. ([FinTrack/Enums/CurrencyConversionType.csL3-R8](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-af923dfd8ad703b854984af5db0ecdcc89341458ee42294b5c815c5d341ea156L3-R8))Export Format:
ExportFormattoDocumentFormatfor improved clarity. ([FinTrack/Enums/ExportFormat.csL3-R3](https://github.com/EnesEfeTokta/FinTrackForWindows/pull/13/files#diff-de7220fed0e9d40c4218c7a2238793866325787e60fbe7a4cb6593dcc582b40dL3-R3))