feat(workspaces): adds models

This commit is contained in:
2026-01-27 14:33:16 -05:00
parent 33c6dadb78
commit fe0686050d
8 changed files with 1119 additions and 1 deletions

22
src/api/Models/Domain.cs Normal file
View File

@@ -0,0 +1,22 @@
namespace Api.Models;
public enum DomainStatus
{
Pending,
Verified,
Active
}
public class Domain
{
public Guid Id { get; set; }
public Guid WorkspaceId { get; set; }
public required string Hostname { get; set; }
public DomainStatus Status { get; set; } = DomainStatus.Pending;
public required string VerificationToken { get; set; }
public DateTime CreatedAt { get; set; }
// Navigation properties
public Workspace Workspace { get; set; } = null!;
public ICollection<ShortLink> ShortLinks { get; set; } = [];
}

14
src/api/Models/Project.cs Normal file
View File

@@ -0,0 +1,14 @@
namespace Api.Models;
public class Project
{
public Guid Id { get; set; }
public Guid WorkspaceId { get; set; }
public required string Name { get; set; }
public DateTime CreatedAt { get; set; }
// Navigation properties
public Workspace Workspace { get; set; } = null!;
public ICollection<ShortLink> ShortLinks { get; set; } = [];
public ICollection<QRCodeDesign> QRCodeDesigns { get; set; } = [];
}

13
src/api/Models/User.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace Api.Models;
public class User
{
public Guid Id { get; set; }
public required string Email { get; set; }
public required string PasswordHash { get; set; }
public DateTime? VerifiedAt { get; set; }
public DateTime CreatedAt { get; set; }
// Navigation properties
public ICollection<Workspace> Workspaces { get; set; } = [];
}

View File

@@ -0,0 +1,26 @@
namespace Api.Models;
public enum WorkspacePlan
{
Free,
Pro,
Business
}
public class Workspace
{
public Guid Id { get; set; }
public Guid OwnerUserId { get; set; }
public required string Name { get; set; }
public WorkspacePlan Plan { get; set; } = WorkspacePlan.Free;
public DateTime CreatedAt { get; set; }
// Navigation properties
public User Owner { get; set; } = null!;
public ICollection<Project> Projects { get; set; } = [];
public ICollection<Domain> Domains { get; set; } = [];
public ICollection<ShortLink> ShortLinks { get; set; } = [];
public ICollection<QRCodeDesign> QRCodeDesigns { get; set; } = [];
public ICollection<Event> Events { get; set; } = [];
public ICollection<Asset> Assets { get; set; } = [];
}