From a66077de6ae74c792c860030115f232c210f47c6 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Mon, 16 Jun 2025 18:46:19 -0700 Subject: [PATCH] Import shared file --- .../Entities/DatabaseObjects.cs | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 src/MistoxWebsite.Server/Entities/DatabaseObjects.cs diff --git a/src/MistoxWebsite.Server/Entities/DatabaseObjects.cs b/src/MistoxWebsite.Server/Entities/DatabaseObjects.cs new file mode 100755 index 0000000..5988e6c --- /dev/null +++ b/src/MistoxWebsite.Server/Entities/DatabaseObjects.cs @@ -0,0 +1,119 @@ +using System.Diagnostics; + +// Reflections of SQL Database objects + +namespace MistoxWebsite.Shared { + + public class PageLoadObject { + public Account? user { get; set; } + public AccountClaims? claims { get; set; } + public List? receipts { get; set; } + public List? products { get; set; } + public List? Cart { get; set; } + } + + public class DirObj { + public FileType? Type { get; set; } + public string Path { get; set; } = ""; + public DirObj? [] Children { get; set; } = new DirObj?[0]; + } + + public enum FileType { + File, + Directory + } + + public class Account { + public int ID { get; set; } // PK + public string UserName { get; set; } = ""; + public string Email { get; set; } = ""; + public bool EmailVerified { get; set; } = false; + public string PasswordHash { get; set; } = ""; + public WebSiteData SiteData { get; set; } = new WebSiteData(); + public string Error { get; set; } = ""; + } + + public class Product { + public int ID { get; set; } // PK + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + public int CurShowingIMG = 0; + public List Images { get; set; } = new List(); + public int Cost { get; set; } + public string URL { get; set; } = ""; + } + + public class WebSiteData { + public int AccountID { get; set; } // PK + public bool FailedPasswordLock { get; set; } = false; + public int PasswordAttempts { get; set; } = 5; + public int CurrentPasswordAttempts { get; set; } = 0; + public string Role { get; set; } = "Generic"; + public string EmailToken { get; set; } = ""; + } + + public class AccountInventory { + public int AccountID { get; set; } // PK + public int ProductID { get; set; } // PK + public string Item { get; set; } = string.Empty; // PK + public int Quantity { get; set; } + public string Stats { get; set; } = string.Empty; + } + + public class UserInventory { + public string Item { get; set; } = string.Empty; + public int Quantity { get; set; } + public string Stats { get; set; } = string.Empty; + } + + public class Receipt { + public int AccountID { get; set; } // PK + public int ProductID { get; set; } // PK + public string ReceiptID { get; set; } = string.Empty; + public int LineItem { get; set; } + public int TaxAmount { get; set; } + public int TotalCost { get; set; } + public DateTime Time { get; set; } + } + + public class ReceiptProduct { + public Receipt receipt { get; set; } = new Receipt(); + public Product product { get; set; } = new Product(); + } + + public class Cart { + public int ID { get; set; } + public int AccountID { get; set; } + public int ProductID { get; set; } + } + + public class ProjectMistData { + public int AccountID { get; set; } // PK + public int Credits { get; set; } + public int OddballTimer { get; set; } + public string SessionToken { get; set; } = ""; + public int SessionID { get; set; } + public int Kills { get; set; } + public int Deaths { get; set; } + } + + public class AccountClaims { + public string UserName { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string EmailVerified { get; set; } = string.Empty; + public string Role { get; set; } = string.Empty; + public string FailedPasswordLock { get; set; } = string.Empty; + } + + public class PaymentObject { + public string CardNumber { get; set; } = string.Empty; + public long ExperationMonth { get; set; } + public long ExperationYear { get; set; } + public string CVC { get; set; } = string.Empty; + public string FullName { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string Zip { get; set; } = string.Empty; + public List productIDs { get; set; } = new List(); + } + +} \ No newline at end of file