Skip to content

Commit fe4391c

Browse files
committed
feat(*.cs & *.xaml): Add currency DTOs and integrate API for rates
Introduces new DTOs for currency data transfer, removes ScottPlot.WPF dependency, and updates CurrencyModel to include an Id. Refactors CurrenciesViewModel to fetch live currency data from the API instead of using sample data, and updates the currencies list UI for better virtualization. Also translates static text in AccountViewModel from Turkish to English.
1 parent 70f6d89 commit fe4391c

13 files changed

+172
-136
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class CalculatedRatesDto
4+
{
5+
public DateTime SnapshotTimestamp { get; set; }
6+
public string BaseCurrency { get; set; } = string.Empty;
7+
public Dictionary<string, decimal> CrossRates { get; set; } = new();
8+
}
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class ChangeSummaryDto
4+
{
5+
// Değişim Miktarı
6+
public decimal? DailyChangeValue { get; set; }
7+
public decimal? WeeklyChangeValue { get; set; }
8+
public decimal? MonthlyChangeValue { get; set; }
9+
10+
// Değişim Oranı
11+
public decimal? DailyChangePercentage { get; set; }
12+
public decimal? WeeklyChangePercentage { get; set; }
13+
public decimal? MonthlyChangePercentage { get; set; }
14+
}
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class CurrencyHistoryDto
4+
{
5+
public string BaseCurrency { get; set; } = string.Empty;
6+
public string TargetCurrency { get; set; } = string.Empty;
7+
public DateTime StartDate { get; set; }
8+
public DateTime EndDate { get; set; }
9+
10+
public ChangeSummaryDto ChangeSummary { get; set; } = new();
11+
12+
public List<HistoricalRatePointDto> HistoricalRates { get; set; } = new();
13+
}
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class CurrencySummaryDto
4+
{
5+
public int Id { get; set; }
6+
public string Code { get; set; } = string.Empty;
7+
public string Name { get; set; } = string.Empty;
8+
public string? IconUrl { get; set; }
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class HistoricalRatePointDto
4+
{
5+
public DateTime Date { get; set; }
6+
public decimal Rate { get; set; }
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class LatestRatesResponseDto
4+
{
5+
public string BaseCurrency { get; set; } = string.Empty;
6+
public DateTime SnapshotTimestamp { get; set; }
7+
public List<RateDetailDto> Rates { get; set; } = new();
8+
}
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class RateDetailDto
4+
{
5+
public int Id { get; set; }
6+
public string Code { get; set; } = string.Empty;
7+
public string Name { get; set; } = string.Empty;
8+
public string? CountryName { get; set; }
9+
public string? CountryCode { get; set; }
10+
public string? IconUrl { get; set; }
11+
12+
public decimal Rate { get; set; }
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace FinTrackWebApi.Dtos.CurrencyDtos
2+
{
3+
public class SpecificCurrencyDto
4+
{
5+
public int Id { get; set; }
6+
public string CurrencyCode { get; set; } = string.Empty;
7+
public string CurrencyName { get; set; } = string.Empty;
8+
public string? CountryCode { get; set; }
9+
public string? CountryName { get; set; }
10+
public string? Status { get; set; }
11+
public DateTime? AvailableFrom { get; set; }
12+
public DateTime? AvailableUntil { get; set; }
13+
public string? IconUrl { get; set; }
14+
15+
public CalculatedRatesDto? RatesInfo { get; set; }
16+
}
17+
}

FinTrack/FinTrackForWindows.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.6.25358.103" />
5656
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
5757
<PackageReference Include="Npgsql" Version="9.0.3" />
58-
<PackageReference Include="ScottPlot.WPF" Version="5.0.55" />
5958
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.1-dev-02307" />
6059
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.1-dev-02317" />
6160
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />

FinTrack/Models/Currency/CurrencyModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace FinTrackForWindows.Models.Currency
66
{
77
public partial class CurrencyModel : ObservableObject
88
{
9+
public int Id { get; set; }
10+
911
[ObservableProperty]
1012
private string toCurrencyFlag = string.Empty;
1113

0 commit comments

Comments
 (0)