refactor: consolidate project structure by migrating authentication, identity, and shared UI components while removing legacy Web Client files.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace NexusReader.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an E-book uploaded or owned by a user.
|
||||
/// </summary>
|
||||
public class Ebook
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(255)]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(255)]
|
||||
public string Author { get; set; } = "Unknown";
|
||||
|
||||
[Required]
|
||||
public string FilePath { get; set; } = string.Empty;
|
||||
|
||||
public string? CoverUrl { get; set; }
|
||||
|
||||
public DateTime AddedDate { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? LastReadDate { get; set; }
|
||||
|
||||
// Relationship to NexusUser
|
||||
[Required]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public NexusUser? User { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace NexusReader.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Extended Identity user for the Nexus AI E-Reader SaaS platform.
|
||||
/// </summary>
|
||||
public class NexusUser : IdentityUser
|
||||
{
|
||||
/// <summary>
|
||||
/// Total number of AI tokens allowed for the current billing period.
|
||||
/// </summary>
|
||||
public int AITokenLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of AI tokens consumed in the current billing period.
|
||||
/// </summary>
|
||||
public int AITokensUsed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for the tenant (SaaS multi-tenancy support).
|
||||
/// </summary>
|
||||
public Guid TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current subscription plan (e.g., "Free", "Pro", "Enterprise").
|
||||
/// </summary>
|
||||
public string CurrentPlan { get; set; } = "Free";
|
||||
|
||||
/// <summary>
|
||||
/// Collection of e-books owned by the user.
|
||||
/// </summary>
|
||||
public ICollection<Ebook> Ebooks { get; set; } = new List<Ebook>();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
@@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="10.0.7" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user