feat(workspaces): adds models
This commit is contained in:
22
src/api/Models/Domain.cs
Normal file
22
src/api/Models/Domain.cs
Normal 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
14
src/api/Models/Project.cs
Normal 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
13
src/api/Models/User.cs
Normal 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; } = [];
|
||||
}
|
||||
26
src/api/Models/Workspace.cs
Normal file
26
src/api/Models/Workspace.cs
Normal 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; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user