init efcore
This commit is contained in:
16
BlueLaminate/BlueLaminate.EFCore/Entities/InventoryItem.cs
Normal file
16
BlueLaminate/BlueLaminate.EFCore/Entities/InventoryItem.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class InventoryItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public SteamUser User { get; set; } = null!;
|
||||
public int SkinInstanceId { get; set; }
|
||||
public SkinInstance SkinInstance { get; set; } = null!;
|
||||
|
||||
// Steam asset ID — changes on trade, not a stable identifier.
|
||||
public string AssetId { get; set; } = null!;
|
||||
public DateTimeOffset AcquiredAt { get; set; }
|
||||
|
||||
public ICollection<TradeItem> TradeItems { get; set; } = new List<TradeItem>();
|
||||
}
|
||||
15
BlueLaminate/BlueLaminate.EFCore/Entities/PriceHistory.cs
Normal file
15
BlueLaminate/BlueLaminate.EFCore/Entities/PriceHistory.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class PriceHistory
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int SkinId { get; set; }
|
||||
public Skin Skin { get; set; } = null!;
|
||||
public int ConditionId { get; set; }
|
||||
public SkinCondition Condition { get; set; } = null!;
|
||||
|
||||
public decimal Price { get; set; }
|
||||
public string Currency { get; set; } = null!;
|
||||
public DateTimeOffset RecordedAt { get; set; }
|
||||
public string Source { get; set; } = null!;
|
||||
}
|
||||
24
BlueLaminate/BlueLaminate.EFCore/Entities/Skin.cs
Normal file
24
BlueLaminate/BlueLaminate.EFCore/Entities/Skin.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class Skin
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int WeaponId { get; set; }
|
||||
public Weapon Weapon { get; set; } = null!;
|
||||
|
||||
public string Name { get; set; } = null!;
|
||||
public string Rarity { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
|
||||
public decimal FloatMin { get; set; }
|
||||
public decimal FloatMax { get; set; }
|
||||
|
||||
// Computed in the database: float_min = 0.0 AND float_max = 1.0.
|
||||
// A skin with a capped float range behaves differently in tradeup calculations.
|
||||
public bool TrueFloat { get; private set; }
|
||||
|
||||
public ICollection<SkinCondition> Conditions { get; set; } = new List<SkinCondition>();
|
||||
public ICollection<SkinInstance> Instances { get; set; } = new List<SkinInstance>();
|
||||
public ICollection<PriceHistory> PriceHistories { get; set; } = new List<PriceHistory>();
|
||||
}
|
||||
15
BlueLaminate/BlueLaminate.EFCore/Entities/SkinCondition.cs
Normal file
15
BlueLaminate/BlueLaminate.EFCore/Entities/SkinCondition.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class SkinCondition
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int SkinId { get; set; }
|
||||
public Skin Skin { get; set; } = null!;
|
||||
|
||||
public string Condition { get; set; } = null!;
|
||||
public decimal MinFloat { get; set; }
|
||||
public decimal MaxFloat { get; set; }
|
||||
|
||||
public ICollection<SkinInstance> Instances { get; set; } = new List<SkinInstance>();
|
||||
public ICollection<PriceHistory> PriceHistories { get; set; } = new List<PriceHistory>();
|
||||
}
|
||||
20
BlueLaminate/BlueLaminate.EFCore/Entities/SkinInstance.cs
Normal file
20
BlueLaminate/BlueLaminate.EFCore/Entities/SkinInstance.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class SkinInstance
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int SkinId { get; set; }
|
||||
public Skin Skin { get; set; } = null!;
|
||||
public int ConditionId { get; set; }
|
||||
public SkinCondition Condition { get; set; } = null!;
|
||||
|
||||
// FloatValue + PaintSeed form a stable fingerprint across trades; the Steam
|
||||
// asset_id changes on every trade but these do not.
|
||||
public decimal FloatValue { get; set; }
|
||||
public string PaintSeed { get; set; } = null!;
|
||||
public bool StatTrak { get; set; }
|
||||
public bool Souvenir { get; set; }
|
||||
public DateTimeOffset FirstSeenAt { get; set; }
|
||||
|
||||
public ICollection<InventoryItem> InventoryItems { get; set; } = new List<InventoryItem>();
|
||||
}
|
||||
13
BlueLaminate/BlueLaminate.EFCore/Entities/SteamUser.cs
Normal file
13
BlueLaminate/BlueLaminate.EFCore/Entities/SteamUser.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class SteamUser
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string SteamId { get; set; } = null!;
|
||||
public string? DisplayName { get; set; }
|
||||
public DateTimeOffset LastSyncedAt { get; set; }
|
||||
|
||||
public ICollection<InventoryItem> InventoryItems { get; set; } = new List<InventoryItem>();
|
||||
public ICollection<Trade> TradesSent { get; set; } = new List<Trade>();
|
||||
public ICollection<Trade> TradesReceived { get; set; } = new List<Trade>();
|
||||
}
|
||||
15
BlueLaminate/BlueLaminate.EFCore/Entities/Trade.cs
Normal file
15
BlueLaminate/BlueLaminate.EFCore/Entities/Trade.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class Trade
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int FromUserId { get; set; }
|
||||
public SteamUser FromUser { get; set; } = null!;
|
||||
public int ToUserId { get; set; }
|
||||
public SteamUser ToUser { get; set; } = null!;
|
||||
|
||||
public DateTimeOffset TradedAt { get; set; }
|
||||
public string? SteamTradeId { get; set; }
|
||||
|
||||
public ICollection<TradeItem> TradeItems { get; set; } = new List<TradeItem>();
|
||||
}
|
||||
10
BlueLaminate/BlueLaminate.EFCore/Entities/TradeItem.cs
Normal file
10
BlueLaminate/BlueLaminate.EFCore/Entities/TradeItem.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class TradeItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int TradeId { get; set; }
|
||||
public Trade Trade { get; set; } = null!;
|
||||
public int InventoryItemId { get; set; }
|
||||
public InventoryItem InventoryItem { get; set; } = null!;
|
||||
}
|
||||
11
BlueLaminate/BlueLaminate.EFCore/Entities/Weapon.cs
Normal file
11
BlueLaminate/BlueLaminate.EFCore/Entities/Weapon.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace BlueLaminate.EFCore.Entities;
|
||||
|
||||
public class Weapon
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string Type { get; set; } = null!;
|
||||
public string Team { get; set; } = null!;
|
||||
|
||||
public ICollection<Skin> Skins { get; set; } = new List<Skin>();
|
||||
}
|
||||
Reference in New Issue
Block a user