DTOs for index mostly done, doing DB models

This commit is contained in:
gamer147
2024-09-12 00:35:31 -04:00
parent ac3b002d74
commit 79505e0c1a
69 changed files with 1523 additions and 21 deletions

View File

@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations.Schema;
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
public class ClassEntry : BaseEntity<int>
{
/// <summary>
/// The name of the class.
/// </summary>
public string Name { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,10 @@
using Microsoft.EntityFrameworkCore;
namespace SVSim.Database.Models;
[Owned]
public class CollectionInfo
{
public int CraftCost { get; set; }
public int DustReward { get; set; }
}

View File

@@ -0,0 +1,8 @@
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
public class DegreeEntry : BaseEntity<int>
{
}

View File

@@ -0,0 +1,8 @@
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
public class EmblemEntry : BaseEntity<long>
{
}

View File

@@ -0,0 +1,8 @@
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
public class FormatEntry : BaseEntity<int>
{
public string Name { get; set; } = string.Empty;
}

View File

@@ -1,12 +1,37 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DCGEngine.Database.Models;
using SVSim.Database.Enums;
namespace SVSim.Database.Models;
public class ShadowverseCardEntry : CardEntry
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public override long Id { get; set; }
/// <summary>
/// The rarity of this card.
/// </summary>
public Rarity Rarity { get; set; }
#region Owned
/// <summary>
/// Info about this card in the collection, if it can be collected.
/// </summary>
public CollectionInfo? CollectionInfo { get; set; }
#endregion
#region Navigation Properties
/// <summary>
/// The class this card belongs to, or optionally none for neutral cards.
/// </summary>
public ClassEntry? Class { get; set; }
/// <summary>
/// The set this card belongs to.
/// </summary>
public CardSetEntry CardSet { get; set; } = new ShadowverseCardSetEntry();
#endregion
}

View File

@@ -0,0 +1,8 @@
using System.ComponentModel.DataAnnotations.Schema;
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
public class ShadowverseCardSetEntry : CardSetEntry
{
}

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using DCGEngine.Database.Models;
using SVSim.Database.Enums;
@@ -8,6 +9,9 @@ namespace SVSim.Database.Models;
/// </summary>
public class SocialAccountConnection : BaseEntity<Guid>
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public override Guid Id { get; set; }
/// <summary>
/// The type of the social account.
/// </summary>

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using DCGEngine.Database.Models;
namespace SVSim.Database.Models;
@@ -7,6 +8,9 @@ namespace SVSim.Database.Models;
/// </summary>
public class Viewer : BaseEntity<ulong>
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public override ulong Id { get; set; }
/// <summary>
/// This user's name displayed in game.
/// </summary>
@@ -16,6 +20,18 @@ public class Viewer : BaseEntity<ulong>
/// This user's short identifier.
/// </summary>
public ulong ShortUdid { get; set; }
public DateTime LastLogin { get; set; }
#region Owned
public ViewerInfo Info { get; set; } = new ViewerInfo();
public ViewerMissionData MissionData { get; set; } = new ViewerMissionData();
public ViewerCurrency Currency { get; set; } = new ViewerCurrency();
#endregion
#region Navigation Properties

View File

@@ -0,0 +1,18 @@
using Microsoft.EntityFrameworkCore;
namespace SVSim.Database.Models;
[Owned]
public class ViewerCurrency
{
public ulong Crystals { get; set; }
public ulong AndroidCrystals { get; set; }
public ulong IosCrystals { get; set; }
public ulong SteamCrystals { get; set; }
public ulong DmmCrystals { get; set; }
public ulong FreeCrystals { get; set; }
public ulong TotalCrystals { get; set; }
public ulong LifeTotalCrystals { get; set; }
public ulong RedEther { get; set; }
public ulong Rupees { get; set; }
}

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
namespace SVSim.Database.Models;
[Owned]
public class ViewerInfo
{
public DateTime BirthDate { get; set; }
public string CountryCode { get; set; } = string.Empty;
public int MaxFriends { get; set; }
public bool IsOfficial { get; set; }
public bool IsOfficialMarkDisplayed { get; set; }
#region Navigation Properties
public EmblemEntry SelectedEmblem { get; set; } = new EmblemEntry();
public DegreeEntry SelectedDegree { get; set; } = new DegreeEntry();
#endregion
}

View File

@@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore;
namespace SVSim.Database.Models;
[Owned]
public class ViewerMissionData
{
public bool HasReceivedPickTwoMission { get; set; }
public int MissionReceiveType { get; set; }
public DateTime MissionChangeTime { get; set; }
public int TutorialState { get; set; }
}