Add initial project structure with basic view models, views, and resources

This commit is contained in:
2026-09-14 19:46:46 +03:00
commit 45401645c6
68 changed files with 2538 additions and 0 deletions
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class CryptoType
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Cryptocurrency> Cryptocurrencies { get; set; } = new List<Cryptocurrency>();
}
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
using Avalonia.Media.Imaging;
using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore.Defaults;
namespace CryptoPortfolio_Tracker.Models;
public partial class Cryptocurrency : ObservableObject
{
public long Id { get; set; }
[ObservableProperty] public partial string Symbol { get; set; } = null!;
[ObservableProperty] public partial string Name { get; set; } = null!;
[ObservableProperty] public partial int CryptoTypeId { get; set; }
[ObservableProperty] public partial long NetworkId { get; set; }
[ObservableProperty] public partial string CoingeckoId { get; set; } = null!;
[ObservableProperty] public partial CryptoType CryptoType { get; set; } = null!;
[ObservableProperty] public partial Network Network { get; set; } = null!;
[ObservableProperty] public partial ICollection<Transaction> Transactions { get; set; } = new List<Transaction>();
[ObservableProperty] public partial ICollection<UserWallet> UserWallets { get; set; } = new List<UserWallet>();
[NotMapped] [ObservableProperty] public partial decimal? PriceChange24H { get; set; }
[NotMapped]
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsPositive))]
[NotifyPropertyChangedFor(nameof(IsNegative))]
public partial decimal? PriceChangePercentage24H { get; set; }
[NotMapped] [ObservableProperty] public partial decimal CurrentPriceUsd { get; set; }
[NotMapped] [ObservableProperty] public partial DateTime? PriceUpdatedAt { get; set; }
[NotMapped] [ObservableProperty] public partial decimal? MarketCapUsd { get; set; }
[NotMapped] [ObservableProperty] public partial decimal? Volume24HUsd { get; set; }
[NotMapped] [ObservableProperty] public partial Bitmap? Image { get; set; }
[NotMapped] public bool IsPositive => PriceChangePercentage24H > 0;
[NotMapped] public bool IsNegative => PriceChangePercentage24H < 0;
[NotMapped] public ObservableCollection<DateTimePoint> PriceHistory24H { get; set; } = [];
[NotMapped] public ObservableCollection<DateTimePoint> PriceHistory7D { get; set; } = [];
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class Network
{
public long Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Cryptocurrency> Cryptocurrencies { get; set; } = new List<Cryptocurrency>();
}
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class Transaction
{
public long Id { get; set; }
public long CryptocurrencyId { get; set; }
public long WalletId { get; set; }
public DateTime TransactionDate { get; set; }
public int TransactionTypeId { get; set; }
public decimal Amount { get; set; }
public decimal PriceUsd { get; set; }
public decimal TotalUsd { get; set; }
public decimal FeeUsd { get; set; }
public string? TransactionHash { get; set; }
public int StatusId { get; set; }
public string? SenderAddress { get; set; }
public string? RecipientAddress { get; set; }
public virtual Cryptocurrency Cryptocurrency { get; set; } = null!;
public virtual TransactionsStatus Status { get; set; } = null!;
public virtual TransactionType TransactionType { get; set; } = null!;
public virtual UserWallet Wallet { get; set; } = null!;
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class TransactionType
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Transaction> Transactions { get; set; } = new List<Transaction>();
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class TransactionsStatus
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Transaction> Transactions { get; set; } = new List<Transaction>();
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class User
{
public long Id { get; set; }
public string Login { get; set; } = null!;
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
public virtual ICollection<UserWallet> UserWallets { get; set; } = new List<UserWallet>();
}
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class UserWallet
{
public long Id { get; set; }
public string Name { get; set; } = null!;
public string Address { get; set; } = null!;
public int TypeId { get; set; }
public long UserId { get; set; }
public long? CryptocurrencyId { get; set; }
public decimal Amount { get; set; }
public virtual Cryptocurrency? Cryptocurrency { get; set; }
public virtual ICollection<Transaction> Transactions { get; set; } = new List<Transaction>();
public virtual WalletType Type { get; set; } = null!;
public virtual User User { get; set; } = null!;
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace CryptoPortfolio_Tracker.Models;
public partial class WalletType
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<UserWallet> UserWallets { get; set; } = new List<UserWallet>();
}