Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions FinTrack/Enums/CurrencyConversionType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace FinTrack.Enums
{
public enum CurrencyConversionType { Increase, Decrease }
}
13 changes: 13 additions & 0 deletions FinTrack/Enums/DebtStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace FinTrack.Enums
{
public enum DebtStatus
{
PendingProposal, // Teklif gönderildi, borçlunun onayı bekleniyor
AwaitingVideoUpload, // Teklif kabul edildi, video yüklenmesi bekleniyor
AwaitingOperatorApproval,// Video yüklendi, operatör onayı bekleniyor
Active, // Operatör onayladı, borç aktif
RejectedByBorrower, // Borçlu teklifi reddetti
RejectedByOperator, // Operatör videoyu reddetti
Completed // Borç ödendi
}
}
12 changes: 12 additions & 0 deletions FinTrack/Enums/ExportFormat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace FinTrack.Enums
{
public enum ExportFormat
{
PDF,
Word,
Excel,
Text,
Markdown,
XML
}
}
8 changes: 8 additions & 0 deletions FinTrack/Enums/MessageAuthor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace FinTrack.Enums
{
public enum MessageAuthor
{
Bot,
User
}
}
9 changes: 9 additions & 0 deletions FinTrack/Enums/ReportType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace FinTrack.Enums
{
public enum ReportType
{
Budget,
Account,
Transaction
}
}
19 changes: 19 additions & 0 deletions FinTrack/Helpers/NullToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace FinTrack.Helpers
{
public class NullToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value == null ? Visibility.Collapsed : Visibility.Visible;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
39 changes: 39 additions & 0 deletions FinTrack/Models/Currency/CurrencyModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using CommunityToolkit.Mvvm.ComponentModel;
using FinTrack.Enums;
using System.Windows.Media;

namespace FinTrack.Models.Currency
{
public partial class CurrencyModel : ObservableObject
{
[ObservableProperty]
private string toCurrencyFlag = string.Empty;

[ObservableProperty]
private string toCurrencyCode = string.Empty;

[ObservableProperty]
private string toCurrencyName = string.Empty;

[ObservableProperty]
private decimal toCurrencyPrice;

[ObservableProperty]
private string toCurrencyChange = string.Empty;

[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ToCurrencyChangeForeground))]
private CurrencyConversionType type = CurrencyConversionType.Increase;

private static readonly Brush IncreaseBrush = new SolidColorBrush(Colors.Green);
private static readonly Brush DecreaseBrush = new SolidColorBrush(Colors.Red);
private static readonly Brush DefaultBrush = new SolidColorBrush(Colors.Gray);

public Brush ToCurrencyChangeForeground => Type switch
{
CurrencyConversionType.Increase => IncreaseBrush,
CurrencyConversionType.Decrease => DecreaseBrush,
_ => DefaultBrush
};
}
}
87 changes: 87 additions & 0 deletions FinTrack/Models/Debt/DebtModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using CommunityToolkit.Mvvm.ComponentModel;
using FinTrack.Enums;
using System.Windows.Media;

namespace FinTrack.Models.Debt
{
public partial class DebtModel : ObservableObject
{
[ObservableProperty]
private string lenderName = string.Empty;

[ObservableProperty]
private string borrowerName = string.Empty;

[ObservableProperty]
private string borrowerEmail = string.Empty;

[ObservableProperty]
private decimal amount;

[ObservableProperty]
private DateTime dueDate;

[ObservableProperty]
[NotifyPropertyChangedFor(nameof(StatusText))]
[NotifyPropertyChangedFor(nameof(StatusBrush))]
[NotifyPropertyChangedFor(nameof(IsActionRequired))]
[NotifyPropertyChangedFor(nameof(IsRejected))]
private DebtStatus status;

[ObservableProperty]
[NotifyPropertyChangedFor(nameof(DebtTitle))]
[NotifyPropertyChangedFor(nameof(UserIconPath))]
[NotifyPropertyChangedFor(nameof(IsCurrentUserTheBorrower))]
private string currentUserName = string.Empty;

public string DebtTitle => IsCurrentUserTheBorrower ? $"Your debt: {LenderName}" : $"Debt owed to you: {BorrowerName}";

public string UserIconPath => IsCurrentUserTheBorrower ? "/Assets/Images/Icons/user-red.png" : "/Assets/Images/Icons/user-green.png";

public bool IsCurrentUserTheBorrower => BorrowerName == CurrentUserName;

[ObservableProperty]
private string? rejectionReason;

[ObservableProperty]
private DateTime createdDate = DateTime.Now;

private static readonly Brush GreenBrush = new SolidColorBrush(Colors.Green);
private static readonly Brush RedBrush = new SolidColorBrush(Colors.Red);
private static readonly Brush BlueBrush = new SolidColorBrush(Colors.Blue);
private static readonly Brush OrangeBrush = new SolidColorBrush(Colors.Orange);
private static readonly Brush GrayBrush = new SolidColorBrush(Colors.Gray);

public Brush StatusBrush => Status switch
{
DebtStatus.Active => GreenBrush,
DebtStatus.AwaitingVideoUpload => BlueBrush,
DebtStatus.AwaitingOperatorApproval => OrangeBrush,
DebtStatus.RejectedByOperator => RedBrush,
DebtStatus.RejectedByBorrower => RedBrush,
_ => GrayBrush
};

public string StatusText => Status switch
{
DebtStatus.AwaitingVideoUpload => "Status: Awaiting Video Approval",
DebtStatus.AwaitingOperatorApproval => "Status: FinTrack Operator Approval Pending",
DebtStatus.Active => "Status: Active - In force",
DebtStatus.RejectedByOperator => "Status: Rejected by Operator",
DebtStatus.RejectedByBorrower => "Status: Rejected by Borrower",
_ => "Status: Unknown"
};

public bool IsActionRequired => Status == DebtStatus.AwaitingVideoUpload;

public bool IsRejected => Status == DebtStatus.RejectedByBorrower || Status == DebtStatus.RejectedByOperator;

public string InfoText => Status switch
{
DebtStatus.Active => $"Final Payment: {DueDate:dd.MM.yyyy}",
DebtStatus.AwaitingOperatorApproval => "Video uploaded",
DebtStatus.RejectedByOperator => $"Reason: {RejectionReason}",
_ => string.Empty
};
}
}
28 changes: 28 additions & 0 deletions FinTrack/Models/FinBot/ChatMessageModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using CommunityToolkit.Mvvm.ComponentModel;
using FinTrack.Enums;
using System.Collections.ObjectModel;

namespace FinTrack.Models.FinBot
{
public partial class ChatMessageModel : ObservableObject
{
[ObservableProperty]
private string text;

[ObservableProperty]
private MessageAuthor author;

[ObservableProperty]
private DateTime timestamp = DateTime.Now;

public ObservableCollection<string>? QuickActions { get; set; }

public bool IsSentByCurrentUser => Author == MessageAuthor.User;

public ChatMessageModel(string _text, MessageAuthor _author)
{
text = _text;
author = _author;
}
}
}
19 changes: 19 additions & 0 deletions FinTrack/Models/Report/SelectableOptionReport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using CommunityToolkit.Mvvm.ComponentModel;

namespace FinTrack.Models.Report
{
public partial class SelectableOptionReport : ObservableObject
{
[ObservableProperty]
private string name;

[ObservableProperty]
private bool isSelected;

public SelectableOptionReport(string _name, bool _isSelected = false)
{
name = _name;
isSelected = _isSelected;
}
}
}
83 changes: 79 additions & 4 deletions FinTrack/Styles/ModernStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<SolidColorBrush x:Key="ErrorBrush" Color="#F85149"/>
<SolidColorBrush x:Key="AccentBrush" Color="#58A6FF"/>

<SolidColorBrush x:Key="BotMessageBackgroundBrush" Color="#2C2F3B"/>
<SolidColorBrush x:Key="UserMessageBackgroundBrush" Color="#0078D7"/>

<SolidColorBrush x:Key="StatusGreenBrush" Color="#4CAF50"/>
<SolidColorBrush x:Key="StatusRedBrush" Color="#F44336"/>
<SolidColorBrush x:Key="CardDarkerBackgroundBrush" Color="#21243B"/> <!-- For nested cards -->
Expand Down Expand Up @@ -546,7 +549,7 @@
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="12,5"/>
<Setter Property="Margin" Value="0,0,8,8"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Width" Value="90"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
Expand All @@ -567,6 +570,41 @@
</Setter>
</Style>

<Style x:Key="ReportFormatToggleButtonStyle" TargetType="RadioButton">
<Setter Property="Background" Value="#dc3545"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="12,5"/>
<Setter Property="Margin" Value="0,0,8,8"/>
<Setter Property="Width" Value="90"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{StaticResource AccentBlueBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource AccentBlueBrush}"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource TopBarTextSecondaryBrush}"/>
</Trigger>
</Style.Triggers>
</Style>

<!-- 2. Düzenle/Sil gibi ikonlu butonlar için stil -->
<Style x:Key="IconOnlyButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
Expand Down Expand Up @@ -825,10 +863,10 @@
</Style>

<Style x:Key="ModernDatePickerStyle" TargetType="DatePicker">
<Setter Property="Background" Value="#2D3A4F" /> <!-- ModernTextBox'unuzun arkaplan rengiyle aynı yapın -->
<Setter Property="Foreground" Value="White" /> <!-- Yazı rengi -->
<Setter Property="Background" Value="#2D3A4F" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="BorderBrush" Value="#4A5A74" /> <!-- ModernTextBox'unuzun kenarlık rengiyle aynı yapın -->
<Setter Property="BorderBrush" Value="#4A5A74" />
<Setter Property="Padding" Value="10,8" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
Expand Down Expand Up @@ -869,4 +907,41 @@
</Setter>
</Style>

<!-- Kullanıcı Mesaj Balonu Stili -->
<Style x:Key="UserMessageBorderStyle" TargetType="Border">
<Setter Property="Background" Value="{StaticResource PrimaryAccentBrush}"/>
<!-- Mor tonu -->
<Setter Property="CornerRadius" Value="20,20,5,20"/>
<Setter Property="Padding" Value="15"/>
<Setter Property="Margin" Value="80,5,5,5"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="MaxWidth" Value="450"/>
</Style>

<!-- FinBot Mesaj Balonu Stili -->
<Style x:Key="BotMessageBorderStyle" TargetType="Border">
<Setter Property="Background" Value="{StaticResource CardDarkerBackgroundBrush}"/>
<Setter Property="CornerRadius" Value="20,20,20,5"/>
<Setter Property="Padding" Value="15"/>
<Setter Property="Margin" Value="5,5,80,5"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="MaxWidth" Value="450"/>
</Style>

<!-- Hızlı Eylem Buton Stili -->
<Style x:Key="QuickActionButtonStyle" TargetType="Button" BasedOn="{StaticResource PrimaryButtonStyle}">
<Setter Property="Background" Value="{StaticResource CardDarkerBackgroundBrush}"/>
<Setter Property="Foreground" Value="{StaticResource TopBarTextSecondaryBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource ProgressBarBackgroundBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="15,10"/>
<Setter Property="Margin" Value="5"/>
</Style>

<Style x:Key="ChatQuickActionButtonStyle" TargetType="Button" BasedOn="{StaticResource QuickActionButtonStyle}">
<Setter Property="Command" Value="{Binding DataContext.SendQuickActionCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<Setter Property="CommandParameter" Value="{Binding Content, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Width" Value="150"/>
</Style>

</ResourceDictionary>
Loading
Loading