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 Transactions { get; set; } = new List(); [ObservableProperty] public partial ICollection UserWallets { get; set; } = new List(); [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 PriceHistory24H { get; set; } = []; [NotMapped] public ObservableCollection PriceHistory7D { get; set; } = []; }